Go to the documentation of this file.
37 namespace functionEntries
53 primitiveEntryIstream,
63 Foam::token Foam::functionEntries::wordDirective::evaluate
65 const dictionary& parentDict,
74 if (tok.isStringType())
79 str = tok.stringToken();
90 "Premature end while reading #word - missing '}'?"
97 <<
"Invalid input for #word."
98 " Expecting a string or block to expand, but found" <<
nl
109 tok = std::move(result);
132 entry.append(std::move(tok),
true);
A keyword and a list of tokens is an 'entry'.
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds an item read from Istream.
void inplaceExpand(std::string &s, const HashTable< string > &mapping, const char sigil='$')
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Macros for easy insertion into member function selection tables.
static bool execute(const dictionary &parentDict, primitiveEntry &entry, Istream &is)
Execute in a primitiveEntry context.
static void reportReadWarning(const IOstream &, const std::string &)
Report a read warning (on std::cerr)
static const token undefinedToken
An undefined token.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
addNamedToMemberFunctionSelectionTable(functionEntry, calcEntry, execute, dictionaryIstream, calc)
Begin block [isseparator].
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
static bool continueReadUntilRightBrace(Istream &is, std::string &str, const bool stripComments=true)
Slurp a string until a closing '}' is found.
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.