ENH: add Foam::SubStrings container and stringOps::split

- generic means of holding ranges of substring iterators
This commit is contained in:
Mark Olesen
2017-07-20 19:53:57 +02:00
parent 8df433860f
commit 910967c070
6 changed files with 255 additions and 3 deletions

View File

@ -30,12 +30,14 @@ Description
SourceFiles
stringOps.C
stringOpsTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef stringOps_H
#define stringOps_H
#include "string.H"
#include "SubStrings.H"
#include "word.H"
#include "dictionary.H"
#include "HashTable.H"
@ -302,14 +304,21 @@ namespace stringOps
Foam::word name(const std::string& fmt, const PrimitiveType& val);
} // End namespace stringOps
//- Split a string into sub-strings at the delimiter character.
// An empty sub-strings are suppressed.
template<class StringType>
Foam::SubStrings<StringType> split
(
const StringType& str,
const char delimiter
);
} // End namespace stringOps
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository