37 namespace functionEntries
55 bool Foam::functionEntries::ifEntry::isTrue(ITstream& its)
59 if (its.front().isScalar())
62 logic = Switch(its.front().scalarToken());
75 bool Foam::functionEntries::ifEntry::execute
77 DynamicList<filePos>& stack,
78 dictionary& parentDict,
82 const label nNested = stack.size();
84 stack.push_back(filePos(is.name(), is.lineNumber()));
88 dynamic_cast<ISstream&
>(is).getLine(line);
91 IStringStream lineStream(line);
92 const primitiveEntry
e(
"ifEntry", parentDict, lineStream);
94 const bool doIf = ifEntry::isTrue(
e.stream());
102 if (stack.size() != nNested)
105 <<
"Did not find matching #endif for condition starting" 106 <<
" at line " << stack.back().second()
116 bool Foam::functionEntries::ifEntry::execute
123 return execute(stack, parentDict, is);
errorManipArg< error, int > exit(error &err, const int errNo=1)
defineTypeNameAndDebug(codeStream, 0)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
const dimensionedScalar e
Elementary charge.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Macros for easy insertion into member function selection tables.
addNamedToMemberFunctionSelectionTable(functionEntry, calcEntry, execute, dictionaryIstream, calc)
static bool execute(const bool equal, DynamicList< filePos > &stack, dictionary &parentDict, Istream &is)
Main driver: depending on 'equal' starts evaluating or skips forward to else.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...