A class for handling keywords in dictionaries. More...
#include <OpenFOAM/keyType.H>
A class for handling keywords in dictionaries.
A keyType is the keyword of a dictionary. It differs from word in that it accepts patterns (regular expressions).
Public Member Functions | |
keyType () | |
Construct null. | |
keyType (const keyType &) | |
Construct as copy. | |
keyType (const word &) | |
Construct as copy of word. | |
keyType (const string &) | |
Construct as copy of string. Expect it to be regular expression. | |
keyType (const char *) | |
Construct as copy of character array. | |
keyType (const std::string &, const bool isPattern) | |
Construct as copy of std::string. | |
keyType (Istream &) | |
Construct from Istream. | |
bool | isPattern () const |
Should be treated as a match rather than a literal string. | |
const keyType & | operator= (const keyType &) |
const keyType & | operator= (const word &) |
const keyType & | operator= (const string &) |
Assign from regular expression. | |
const keyType & | operator= (const char *) |
![]() | |
word () | |
Construct null. | |
word (const word &) | |
Construct as copy. | |
word (const char *, const bool doStripInvalid=true) | |
Construct as copy of character array. | |
word (const char *, const size_type, const bool doStripInvalid) | |
Construct as copy with a maximum number of characters. | |
word (const string &, const bool doStripInvalid=true) | |
Construct as copy of string. | |
word (const std::string &, const bool doStripInvalid=true) | |
Construct as copy of std::string. | |
word (Istream &) | |
Construct from Istream. | |
![]() | |
string () | |
Construct null. | |
string (const std::string &) | |
Construct from std::string. | |
string (const char *) | |
Construct as copy of character array. | |
string (const char *, const size_type) | |
Construct as copy of specified number of characters. | |
string (const char) | |
Construct from a single character. | |
string (Istream &) | |
Construct from Istream. | |
size_type | count (const char) const |
Count and return the number of a given character in the string. | |
string & | replace (const string &oldStr, const string &newStr, size_type start=0) |
Replace first occurence of sub-string oldStr with newStr. | |
string & | replaceAll (const string &oldStr, const string &newStr, size_type start=0) |
Replace all occurences of sub-string oldStr with newStr. | |
string & | expand () |
Expand initial tildes and all occurences of environment variables. | |
bool | removeRepeated (const char) |
Remove repeated characters returning true if string changed. | |
string | removeRepeated (const char) const |
Return string with repeated characters removed. | |
bool | removeTrailing (const char) |
Remove trailing character returning true if string changed. | |
string | removeTrailing (const char) const |
Return string with trailing character removed. | |
string | operator() (const size_type i, const size_type n) const |
Return the sub-string from the i-th character for n characters. | |
string | operator() (const size_type n) const |
Return the sub-string from the first character for n characters. |
Friends | |
Istream & | operator>> (Istream &, keyType &) |
Ostream & | operator<< (Ostream &, const keyType &) |
Additional Inherited Members | |
![]() | |
static bool | valid (char) |
Is this character valid for a word. | |
![]() | |
template<class String > | |
static bool | valid (const string &) |
Is this string type valid? | |
template<class String > | |
static bool | meta (const string &, const char quote='\\') |
Does this string have particular meta-characters? | |
template<class String > | |
static bool | stripInvalid (string &) |
Strip invalid characters from the given string. | |
template<class String > | |
static String | validate (const string &) |
Return a valid String from the given string. | |
template<class String > | |
static string | quotemeta (const string &, const char quote='\\') |
Return a String with quoted meta-characters from the given string. | |
![]() | |
static const char *const | typeName = "word" |
static int | debug |
static const word | null |
![]() |
|
inline |
Construct null.
Definition at line 32 of file keyTypeI.H.
Construct as copy.
Definition at line 39 of file keyTypeI.H.
Construct as copy of word.
Definition at line 46 of file keyTypeI.H.
Construct as copy of string. Expect it to be regular expression.
Definition at line 54 of file keyTypeI.H.
|
inline |
Construct as copy of character array.
Definition at line 62 of file keyTypeI.H.
|
inline |
Construct as copy of std::string.
Definition at line 71 of file keyTypeI.H.
Construct from Istream.
Definition at line 34 of file keyTypeIO.C.
|
inline |
Should be treated as a match rather than a literal string.
Definition at line 83 of file keyTypeI.H.
Referenced by dictionary::add(), dictionary::changeKeyword(), Ostream::write(), and Ostream::writeKeyword().
|
inline |
Definition at line 91 of file keyTypeI.H.
|
inline |
|
inline |
|
inline |
Reimplemented from word.
Definition at line 117 of file keyTypeI.H.