Public Member Functions | |
exprString ()=default | |
Default construct. More... | |
exprString (const exprString &rhs)=default | |
Copy construct. More... | |
exprString (exprString &&rhs)=default | |
Move construct. More... | |
exprString (const std::string &s, bool doValidate=true) | |
Copy construct from std::string. More... | |
exprString (std::string &&s, bool doValidate=true) | |
Move construct from std::string. More... | |
exprString (const char *s, bool doValidate=true) | |
Construct as copy of character array. More... | |
exprString (const std::string &str, const dictionary &dict, const bool stripComments=true) | |
exprString (std::string &&str, const dictionary &dict, const bool stripComments=true) | |
exprString (Istream &is, const dictionary &dict, const bool stripComments=true) | |
~exprString ()=default | |
Destructor. More... | |
bool | valid () const |
Check for unexpanded '$' entries. Fatal if any exist. More... | |
void | expand (const dictionary &dict, const bool stripComments=true) |
void | trim () |
Inplace trim leading and trailing whitespace. More... | |
bool | readEntry (const word &keyword, const dictionary &dict, bool mandatory=true, const bool stripComments=true) |
exprString & | operator= (const exprString &str)=default |
Copy assign. More... | |
exprString & | operator= (exprString &&str)=default |
Move assign. More... | |
exprString & | operator= (const char *str) |
Copy assign from c-string. No expansions, no comment stripping. More... | |
exprString & | operator= (const std::string &str) |
Copy assign from string. No expansions, no comment stripping. More... | |
exprString & | operator= (std::string &&str) |
Move assign from string. No expansions, no comment stripping. More... | |
bool | writeEntry (const word &keyword, Ostream &os, bool writeEmpty=false) const |
Public Member Functions inherited from string | |
string ()=default | |
Default construct. More... | |
string (const std::string &str) | |
Copy construct from std::string. More... | |
string (std::string &&str) | |
Move construct from std::string. More... | |
string (const char *str) | |
Construct as copy of character array. More... | |
string (const char *str, const size_type len) | |
Construct as copy with a maximum number of characters. More... | |
string (const char c) | |
Construct from a single character. More... | |
string (const size_type len, const char c) | |
Construct fill copies of a single character. More... | |
string (Istream &is) | |
Construct from Istream. More... | |
bool | match (const std::string &text) const |
Test for equality. More... | |
string & | replace (const std::string &s1, const std::string &s2, size_type pos=0) |
string & | replaceAll (const std::string &s1, const std::string &s2, size_type pos=0) |
string & | replaceAny (const std::string &s1, const char c2, size_type pos=0) |
string & | expand (const bool allowEmpty=false) |
bool | removeRepeated (const char character) |
Remove repeated characters. More... | |
bool | removeStart (const std::string &text) |
Remove the given text from the start of the string. More... | |
bool | removeStart (const char c) |
Remove leading character, unless string is a single character. More... | |
bool | removeEnd (const std::string &text) |
Remove the given text from the end of the string. More... | |
bool | removeEnd (const char c) |
Remove trailing character, unless string is a single character. More... | |
void | swap (std::string &str) |
Swap contents. Self-swapping is a no-op. More... | |
bool | operator() (const std::string &text) const |
Test for equality. Allows use as a predicate. More... | |
bool | starts_with (const std::string &s) const |
True if string starts with the given prefix (cf. C++20) More... | |
bool | starts_with (const char c) const |
True if string starts with the given character (cf. C++20) More... | |
bool | ends_with (const std::string &s) const |
True if string ends with the given suffix (cf. C++20) More... | |
bool | ends_with (const char c) const |
True if string ends with the given character (cf. C++20) More... | |
size_type | count (const char c) const |
bool | startsWith (const std::string &s) const |
Deprecated(2019-11) More... | |
bool | endsWith (const std::string &s) const |
Deprecated(2019-11) More... | |
bool | removeTrailing (const char c) |
Deprecated(2019-11) More... | |
Static Public Member Functions | |
static void | inplaceExpand (std::string &str, const dictionary &dict, const bool stripComments=true) |
static exprString | getEntry (const word &keyword, const dictionary &dict, const bool stripComments=true) |
static exprString | getOptional (const word &keyword, const dictionary &dict, const bool stripComments=true) |
static exprString | toExpr (const std::string &str) |
Copy convert string to exprString. More... | |
static exprString | toExpr (std::string &&str) |
Move convert string to exprString. More... | |
Static Public Member Functions inherited from string | |
template<class StringType > | |
static bool | valid (const std::string &str) |
Does the string contain valid characters only? More... | |
template<class StringType > | |
static bool | stripInvalid (std::string &str) |
Strip invalid characters from the given string. More... | |
template<class StringType > | |
static StringType | validate (const std::string &str) |
Return a valid String from the given string. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from string | |
static const char *const | typeName = "string" |
The type name "string". More... | |
static int | debug |
The debug flag. More... | |
static const string | null |
An empty string. More... | |
Protected Member Functions inherited from string | |
std::string::size_type | find_ext () const |
Find position of a file extension dot, return npos on failure. More... | |
word | ext () const |
Return file name extension (part after last .) More... | |
bool | ext (const word &ending) |
Append a '.' and the ending. More... | |
bool | hasPath () const |
Return true if it contains a '/' character. More... | |
bool | hasExt () const |
Return true if it has an extension or simply ends with a '.'. More... | |
bool | hasExt (const char *ending) const |
Return true if the extension is the same as the given ending. More... | |
bool | hasExt (const std::string &ending) const |
Return true if the extension is the same as the given ending. More... | |
bool | hasExt (const wordRe &ending) const |
Return true if the extension matches the given ending. More... | |
bool | removeExt () |
Remove extension, returning true if string changed. More... | |
bool | removePath () |
Remove leading path, returning true if string changed. More... | |
Static Protected Member Functions inherited from string | |
static std::string::size_type | find_ext (const std::string &str) |
Find position of a file extension dot, return npos on failure. More... | |
template<class PrimitiveType > | |
static std::string::size_type | string_printf (std::string &output, const char *fmt, const PrimitiveType &val) |
A printf-style formatter for a primitive. More... | |
template<class PrimitiveType > | |
static std::string::size_type | string_printf (std::string &output, const std::string &fmt, const PrimitiveType &val) |
A printf-style formatter for a primitive. More... | |
Definition at line 60 of file exprString.H.
|
default |
Default construct.
Referenced by exprString::exprString().
|
default |
Copy construct.
|
default |
Move construct.
|
inlineexplicit |
Copy construct from std::string.
Definition at line 33 of file exprStringI.H.
References exprString::exprString(), and exprString::valid().
|
inlineexplicit |
Move construct from std::string.
Definition at line 50 of file exprStringI.H.
References exprString::exprString(), and exprString::valid().
|
inlineexplicit |
Construct as copy of character array.
Definition at line 67 of file exprStringI.H.
References exprString::exprString(), and exprString::valid().
|
inline |
Copy construct and expand with dictionary variables, and strip C/C++ comments from the input
Definition at line 84 of file exprStringI.H.
References dict, exprString::expand(), and exprString::exprString().
|
inline |
Move construct and expand with dictionary variables, and strip C/C++ comments from the input
Definition at line 97 of file exprStringI.H.
References dict, exprString::expand(), and exprString::exprString().
|
inline |
Construct from Istream and expand with dictionary variables, and strip C/C++ comments from the input
Definition at line 110 of file exprStringI.H.
References dict, exprString::expand(), and exprString::exprString().
|
default |
Destructor.
References exprString::expand(), exprString::getEntry(), exprString::getOptional(), exprString::inplaceExpand(), exprString::readEntry(), exprString::toExpr(), exprString::trim(), and exprString::valid().
|
static |
Inplace expansion with dictionary variables, and strip C/C++ comments from the input.
Definition at line 34 of file exprString.C.
References dict, expressionEntry::inplaceExpand(), exprString::inplaceExpand(), and Foam::stringOps::inplaceRemoveComments().
Referenced by exprString::inplaceExpand(), and exprString::~exprString().
|
static |
Get and expand expression with dictionary entries, optionally strip C/C++ comments from the input.
Expansion behaviour as per inplaceExpand
keyword | Lookup key. Uses LITERAL (not REGEX) |
Definition at line 51 of file exprString.C.
References dict, exprString::getEntry(), and exprString::readEntry().
Referenced by exprString::getEntry(), and exprString::~exprString().
|
static |
Get and expand expression with dictionary entries, optionally strip C/C++ comments from the input.
Expansion behaviour as per inplaceExpand
keyword | Lookup key. Uses LITERAL (not REGEX) |
Definition at line 66 of file exprString.C.
References dict, exprString::getOptional(), and exprString::readEntry().
Referenced by exprString::getOptional(), and exprString::~exprString().
|
inlinestatic |
Copy convert string to exprString.
No expansions, know what you are doing.
Definition at line 143 of file exprStringI.H.
References exprString::toExpr().
Referenced by exprString::toExpr(), and exprString::~exprString().
|
inlinestatic |
Move convert string to exprString.
No expansions, know what you are doing.
Definition at line 154 of file exprStringI.H.
References exprString::toExpr().
|
inline |
Check for unexpanded '$' entries. Fatal if any exist.
Definition at line 125 of file exprStringI.H.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and exprString::valid().
Referenced by exprString::exprString(), exprString::valid(), and exprString::~exprString().
void expand | ( | const dictionary & | dict, |
const bool | stripComments = true |
||
) |
Inplace expansion with dictionary variables, and strip C/C++ comments from the input
Definition at line 82 of file exprString.C.
References dict, and exprString::expand().
Referenced by exprString::expand(), exprString::exprString(), and exprString::~exprString().
void trim | ( | ) |
Inplace trim leading and trailing whitespace.
Definition at line 96 of file exprString.C.
References Foam::stringOps::inplaceTrim(), and exprString::trim().
Referenced by exprString::trim(), and exprString::~exprString().
bool readEntry | ( | const word & | keyword, |
const dictionary & | dict, | ||
bool | mandatory = true , |
||
const bool | stripComments = true |
||
) |
Read/expand entry with dictionary variables, and strip C/C++ comments from the input
keyword | Lookup key. Uses LITERAL (not REGEX) |
Definition at line 102 of file exprString.C.
References clear(), dict, keyType::LITERAL, and exprString::readEntry().
Referenced by Function1Expression< Type >::Function1Expression(), exprString::getEntry(), exprString::getOptional(), PatchExprField< Type >::PatchExprField(), exprString::readEntry(), and exprString::~exprString().
|
default |
|
default |
Move assign.
References exprString::operator=(), and exprString::writeEntry().
|
inline |
Copy assign from c-string. No expansions, no comment stripping.
Definition at line 167 of file exprStringI.H.
References exprString::operator=(), and ObukhovLength::operator=().
|
inline |
Copy assign from string. No expansions, no comment stripping.
Definition at line 180 of file exprStringI.H.
References exprString::operator=(), and ObukhovLength::operator=().
|
inline |
Move assign from string. No expansions, no comment stripping.
Definition at line 193 of file exprStringI.H.
References exprString::operator=(), and ObukhovLength::operator=().
Dictionary entry for expression string, normally suppressing empty strings. Generally used verbatim output (readability)
Definition at line 125 of file exprString.C.
References os(), token::setType(), token::VERBATIM, and exprString::writeEntry().
Referenced by exprString::operator=(), and exprString::writeEntry().