A class for handling keywords in dictionaries. More...
Public Types | |
enum | option : unsigned char { LITERAL = 0, REGEX = 1, RECURSIVE = 0x80, LITERAL_RECURSIVE = (LITERAL | RECURSIVE), REGEX_RECURSIVE = (REGEX | RECURSIVE) } |
Public Member Functions | |
keyType () | |
keyType (const keyType &)=default | |
keyType (keyType &&)=default | |
keyType (const word &str) | |
keyType (word &&str) | |
keyType (const string &str) | |
keyType (string &&str) | |
keyType (const std::string &str, option opt) | |
keyType (std::string &&str, option opt) | |
keyType (const char *str, option opt=option::LITERAL) | |
keyType (Istream &is) | |
bool | isLiteral () const noexcept |
bool | isPattern () const noexcept |
bool | assign (const token &tok) |
void | setType (option opt, bool adjust=false) |
bool | compile () noexcept |
void | uncompile () noexcept |
void | uncompile (bool adjust) |
void | clear () |
void | swap (keyType &rhs) |
bool | match (const std::string &text, bool literal=false) const |
bool | operator() (const std::string &text) const |
void | operator= (const std::string &)=delete |
void | operator= (const keyType &str) |
void | operator= (keyType &&str) |
void | operator= (const word &str) |
void | operator= (const string &str) |
void | operator= (const char *str) |
keyType (const std::string &s, bool isPattern) | |
![]() | |
word ()=default | |
word (const word &)=default | |
word (word &&w)=default | |
word (const string &s, bool doStrip=true) | |
word (string &&s, bool doStrip=true) | |
word (const std::string &s, bool doStrip=true) | |
word (std::string &&s, bool doStrip=true) | |
word (const char *s, bool doStrip=true) | |
word (const char *s, size_type len, bool doStrip) | |
word (Istream &is) | |
void | stripInvalid () |
word | lessExt () const |
word | ext () const |
word & | ext (const word &ending) |
word & | operator= (const word &s) |
word & | operator= (word &&s) |
word & | operator= (const string &s) |
word & | operator= (string &&s) |
word & | operator= (const std::string &s) |
word & | operator= (std::string &&s) |
word & | operator= (const char *s) |
template<class PrimitiveType > | |
Foam::word | printf (const char *fmt, const PrimitiveType &val) |
template<class PrimitiveType > | |
Foam::word | printf (const std::string &fmt, const PrimitiveType &val) |
bool | hasExt () const |
bool | hasExt (const char *ending) const |
bool | hasExt (const std::string &ending) const |
bool | hasExt (const wordRe &ending) const |
bool | removeExt () |
![]() | |
string ()=default | |
string (const std::string &str) | |
string (std::string &&str) | |
string (const char *str) | |
string (const char *str, const size_type len) | |
string (const char c) | |
string (const size_type len, const char c) | |
string (Istream &is) | |
bool | match (const std::string &text) const |
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) |
bool | removeStart (const std::string &text) |
bool | removeStart (const char c) |
bool | removeEnd (const std::string &text) |
bool | removeEnd (const char c) |
void | swap (std::string &str) |
bool | operator() (const std::string &text) const |
bool | starts_with (const std::string &s) const |
bool | starts_with (const char c) const |
bool | ends_with (const std::string &s) const |
bool | ends_with (const char c) const |
size_type | count (const char c) const |
bool | startsWith (const std::string &s) const |
bool | endsWith (const std::string &s) const |
bool | removeTrailing (const char c) |
Static Public Member Functions | |
static bool | valid (const char c) |
![]() | |
template<class PrimitiveType > | |
static word | printf (const char *fmt, const PrimitiveType &val) |
template<class PrimitiveType > | |
static word | printf (const std::string &fmt, const PrimitiveType &val) |
static bool | valid (char c) |
static word | validate (const std::string &s, const bool prefix=false) |
static word | validate (const char *first, const char *last, const bool prefix=false) |
![]() | |
template<class StringType > | |
static bool | valid (const std::string &str) |
template<class StringType > | |
static bool | stripInvalid (std::string &str) |
template<class StringType > | |
static StringType | validate (const std::string &str) |
Static Public Attributes | |
static const keyType | null |
![]() | |
static const char *const | typeName = "word" |
static int | debug |
static const word | null |
![]() | |
static const char *const | typeName = "string" |
static int | debug |
static const string | null |
Additional Inherited Members | |
![]() | |
std::string::size_type | find_ext () const |
word | ext () const |
bool | ext (const word &ending) |
bool | hasPath () const |
bool | hasExt () const |
bool | hasExt (const char *ending) const |
bool | hasExt (const std::string &ending) const |
bool | hasExt (const wordRe &ending) const |
bool | removeExt () |
bool | removePath () |
![]() | |
static std::string::size_type | find_ext (const std::string &str) |
template<class PrimitiveType > | |
static std::string::size_type | string_printf (std::string &output, const char *fmt, const PrimitiveType &val) |
template<class PrimitiveType > | |
static std::string::size_type | string_printf (std::string &output, const std::string &fmt, const PrimitiveType &val) |
A class for handling keywords in dictionaries.
A keyType is the keyword of a dictionary. It differs from word in that it also accepts patterns (regular expressions). It is very similar to wordRe, but doesn't store a regular expression.
enum option : unsigned char |
|
inline |
Definition at line 33 of file keyTypeI.H.
Definition at line 40 of file keyTypeI.H.
Definition at line 47 of file keyTypeI.H.
Definition at line 54 of file keyTypeI.H.
Definition at line 61 of file keyTypeI.H.
Definition at line 68 of file keyTypeI.H.
Definition at line 75 of file keyTypeI.H.
Definition at line 82 of file keyTypeI.H.
|
inlinestatic |
Definition at line 24 of file keyTypeI.H.
References Foam::constant::universal::c, and word::valid().
|
inlinenoexcept |
Definition at line 91 of file keyTypeI.H.
Referenced by GeometricField::Boundary::readField().
|
inlinenoexcept |
Definition at line 97 of file keyTypeI.H.
Referenced by dictionary::add(), Ostream::beginBlock(), dictionary::changeKeyword(), Foam::findStrings(), Foam::getAcceptableFunctionKeys(), Foam::inplaceSubsetStrings(), Foam::operator<<(), wordRe::operator=(), Foam::subsetStrings(), wordRe::wordRe(), Ostream::write(), and Ostream::writeKeyword().
Definition at line 66 of file keyType.C.
References Foam::FieldOps::assign(), token::isQuotedString(), token::isWord(), token::stringToken(), and token::wordToken().
Referenced by Foam::operator>>().
Definition at line 103 of file keyTypeI.H.
References word::debug.
|
inlinenoexcept |
Definition at line 120 of file keyTypeI.H.
|
inlinenoexcept |
Definition at line 127 of file keyTypeI.H.
|
inline |
Definition at line 133 of file keyTypeI.H.
References word::debug.
|
inline |
Definition at line 145 of file keyTypeI.H.
References clear().
void swap | ( | keyType & | rhs | ) |
Definition at line 43 of file keyType.C.
References string::swap().
Definition at line 55 of file keyType.C.
References regExpPosix::match().
|
inline |
Definition at line 154 of file keyTypeI.H.
References Foam::stringOps::match().
|
delete |
|
inline |
Definition at line 160 of file keyTypeI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 172 of file keyTypeI.H.
References clear().
|
inline |
Definition at line 191 of file keyTypeI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 198 of file keyTypeI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 184 of file keyTypeI.H.
References Foam::FieldOps::assign().
|
static |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.