53 Foam::token Foam::functionEntry::readLine(Istream& is)
61 return token(word(readFuncNameArgs(is)), is.lineNumber());
73 const token fName(is);
88 string::const_reverse_iterator rit = fNameWord.rbegin();
89 rit != fNameWord.rend();
103 const token nextToken(is);
115 fNameArgs = fNameWord + fNameArgs;
120 fNameArgs = fNameWord;
179 const word& functionName,
186 "functionEntry::execute" 187 "(const word& functionName, dictionary& parentDict, Istream&)" 190 if (!executedictionaryIstreamMemberFunctionTablePtr_)
192 cerr<<
"functionEntry::execute" 193 <<
"(const word&, dictionary&, Istream&)" 194 <<
" not yet initialised, function = " 201 executedictionaryIstreamMemberFunctionTable::iterator mfIter =
202 executedictionaryIstreamMemberFunctionTablePtr_->find(functionName);
204 if (mfIter == executedictionaryIstreamMemberFunctionTablePtr_->end())
207 <<
"Unknown functionEntry '" << functionName
210 <<
"Valid functionEntries are :" <<
endl 211 << executedictionaryIstreamMemberFunctionTablePtr_->toc()
215 return mfIter()(parentDict, is);
221 const word& functionName,
229 "functionEntry::execute" 230 "(const word&, const dictionary&, primitiveEntry&, Istream&)" 233 if (!executeprimitiveEntryIstreamMemberFunctionTablePtr_)
235 cerr<<
"functionEntry::execute" 236 <<
"(const word&, const dictionary&, primitiveEntry&, Istream&)" 237 <<
" not yet initialised, function = " 244 executeprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
245 executeprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
247 if (mfIter == executeprimitiveEntryIstreamMemberFunctionTablePtr_->end())
250 <<
"Unknown functionEntry '" << functionName
253 <<
"Valid functionEntries are :" <<
endl 254 << executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
258 return mfIter()(parentDict, entry, is);
268 os << operator[](0) <<
endl;
273 <<
"Incorrect number of tokens in functionEntry, " 274 "should be a single word." Istream & readList(string &)
Read a '(...)' delimited set of characters into a string.
functionEntry(const word &, const dictionary &, Istream &)
Construct from keyword, parent dictionary and Istream.
punctuationToken pToken() const
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static bool insert(dictionary &parentDict, const string &)
Insert the given string in a sub-dict context.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & wordToken() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds items read from Istream.
void putBack(const token &)
Put back token.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label lineNumber() const
Return current stream line number.
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
virtual void write(Ostream &) const
Write.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read, written and printed, and the types and values of its tokens analysed.
A class for handling words, derived from string.
virtual const fileName & name() const
Return the name of the stream.
static bool execute(const word &functionName, dictionary &parentDict, Istream &)
Execute the functionEntry in a sub-dict context.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
const string & anyStringToken() const
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const string & stringToken() const
ISstream & putback(const char &)
Low-level putback character function.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
static string readFuncNameArgs(Istream &is)
Read the function name and optional argument list.
Input from memory buffer stream.
virtual bool read(const dictionary &, Istream &)
Read tokens from the given stream.
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)
A class for handling character strings derived from std::string.
bool isPunctuation() const