58 std::swap(type_,
rhs.type_);
64 if (!literal && isPattern())
69 return !compare(text);
78 assign(tok.wordToken());
82 else if (tok.isQuotedString())
106 <<
"Zero-length regex"
118 <<
"Wrong token type - expected word or string, found "
124 <<
"Bad token - could not get keyType";
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
void setBad() noexcept
Set stream state to be 'bad'.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A class for handling keywords in dictionaries.
bool assign(const token &tok)
Assign from word or string token.
static const keyType null
An empty keyType.
bool compile() noexcept
Mark as regular expression.
void uncompile() noexcept
Mark as literal string.
keyType()
Default construct, empty literal.
void swap(keyType &rhs)
Swap contents. Self-swapping is a no-op.
bool isPattern() const noexcept
The keyType is treated as a pattern, not as literal string.
bool match(const std::string &text, bool literal=false) const
Smart match as regular expression or as a string.
bool match(const std::string &text) const
True if the regex matches the entire text.
void swap(std::string &str)
Swap contents. Self-swapping is a no-op.
A token holds an item read from Istream.
const string & stringToken() const
Return const reference to the string contents.
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
bool isQuotedString() const noexcept
Token is (quoted) STRING (string variant).
const word & wordToken() const
Return const reference to the word contents.
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE).
InfoProxy< token > info() const noexcept
Return info proxy, for printing token information to a stream.
A class for handling words, derived from Foam::string.
word()=default
Default construct.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
void assign(Field< Tout > &result, const Field< T1 > &a, const UnaryOp &op)
Populate a field as the result of a unary operation on an input.
regExpCxx regExp
Selection of preferred regular expression implementation.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
errorManipArg< error, int > exit(error &err, const int errNo=1)