53 Foam::token Foam::functionEntry::readLine(Istream& is)
62 return token(word(argStringLine.first()), argStringLine.second());
77 const token fName(is);
92 string::const_reverse_iterator rit = fNameWord.rbegin();
93 rit != fNameWord.rend();
107 const token nextToken(is);
124 if (fNameLineNumber != lineNumber0)
128 +
string(fNameLineNumber - lineNumber0,
'\n')
133 fNameArgs = fNameWord + fNameArgs;
139 fNameArgs = fNameWord;
205 "functionEntry::execute"
206 "(const word& functionName, dictionary& parentDict, Istream&)"
209 if (!executedictionaryIstreamMemberFunctionTablePtr_)
211 cerr<<
"functionEntry::execute"
212 <<
"(const word&, dictionary&, Istream&)"
213 <<
" not yet initialised, function = "
220 executedictionaryIstreamMemberFunctionTable::iterator mfIter =
221 executedictionaryIstreamMemberFunctionTablePtr_->find(
functionName);
223 if (mfIter == executedictionaryIstreamMemberFunctionTablePtr_->end())
229 <<
"Valid functionEntries are :" <<
endl
230 << executedictionaryIstreamMemberFunctionTablePtr_->toc()
234 return mfIter()(parentDict, is);
248 "functionEntry::execute"
249 "(const word&, const dictionary&, primitiveEntry&, Istream&)"
252 if (!executeprimitiveEntryIstreamMemberFunctionTablePtr_)
254 cerr<<
"functionEntry::execute"
255 <<
"(const word&, const dictionary&, primitiveEntry&, Istream&)"
256 <<
" not yet initialised, function = "
263 executeprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
264 executeprimitiveEntryIstreamMemberFunctionTablePtr_->find(
functionName);
266 if (mfIter == executeprimitiveEntryIstreamMemberFunctionTablePtr_->end())
272 <<
"Valid functionEntries are :" <<
endl
273 << executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
277 return mfIter()(parentDict,
entry, is);
287 os << operator[](0) <<
endl;
292 <<
"Incorrect number of tokens in functionEntry, "
293 "should be a single word."
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
label lineNumber() const
Return current stream line number.
virtual const fileName & name() const
Return the name of the stream.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
Istream & readList(string &)
Read a '(...)' delimited set of characters into a string.
ISstream & putback(const char &)
Low-level putback character function.
Input from memory buffer stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &)
Put back token.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of different types.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
A keyword and a list of tokens is an 'entry'.
A functionEntry causes entries to be added/manipulated on the specified dictionary given an input str...
virtual void write(Ostream &) const
Write.
static bool insert(dictionary &parentDict, const string &)
Insert the given string in a sub-dict context.
static bool execute(const word &functionName, dictionary &parentDict, Istream &)
Execute the functionEntry in a sub-dict context.
static Tuple2< string, label > readFuncNameArgs(Istream &is)
Read the function name and optional argument list.
functionEntry(const word &, const dictionary &, Istream &)
Construct from keyword, parent dictionary and Istream.
A functionName is a word starting with '#'.
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read,...
virtual bool read(const dictionary &, Istream &)
Read tokens from the given stream.
A class for handling character strings derived from std::string.
A token holds items read from Istream.
bool isPunctuation() const
const string & stringToken() const
punctuationToken pToken() const
const string & anyStringToken() const
const word & wordToken() const
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)