34 void Foam::primitiveEntry::append
36 const token& currToken,
37 const dictionary&
dict,
45 else if (currToken.isFunctionName())
47 if (!expandFunction(currToken.functionNameToken(),
dict, is))
52 else if (currToken.isVariable())
54 if (!expandVariable(currToken.variableToken(),
dict))
66 bool Foam::primitiveEntry::expandFunction
68 const functionName& funcName,
69 const dictionary& parentDict,
77 void Foam::primitiveEntry::readEntry(
const dictionary&
dict, Istream& is)
88 std::ostringstream os;
89 os <<
"ill defined primitiveEntry starting at keyword '"
91 <<
" on line " << startLineNumber()
92 <<
" and ending at line " << is.lineNumber();
112 entry(key, is.lineNumber()),
115 is.
name() +
'/' + key,
128 entry(key, is.lineNumber()),
131 is.
name() +
'/' + key,
148 "primitiveEntry::read(const dictionary&, Istream&) start"
154 label blockCount = 0;
165 append(currToken,
dict, is);
201 append(currToken,
dict, is);
207 "primitiveEntry::read(const dictionary&, Istream&) end"
210 if (currToken.
good())
223 if (!contentsOnly && keyword().size())
228 for (
label i=0; i<size(); ++i)
247 this->
write(os,
false);
264 const label nPrintTokens = 10;
266 os <<
" primitiveEntry '" <<
e.keyword() <<
"' comprises ";
268 for (
label i=0; i<
min(
e.size(), nPrintTokens); i++)
270 os <<
nl <<
" " <<
e[i].info();
273 if (
e.size() > nPrintTokens)
label lineNumber() const
Return current stream line number.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
bool bad() const
Return true if stream is corrupted.
label tokenIndex() const
Return the current token index.
A helper class for outputting values to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Istream & read(token &)=0
Return next token from stream.
bool eof() const
Return true if end of input seen.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T & newElmt(const label)
Return subscript-checked element of UList.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
static const dictionary null
Null dictionary.
A keyword and a list of tokens is an 'entry'.
static int disableFunctionEntries
virtual bool execute(dictionary &contextDict, Istream &is)=0
Expand the functionEntry into the contextDict.
A class for handling keywords in dictionaries.
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read,...
void write(Ostream &) const
Write.
virtual Istream & read(token &)
Inherit read from ITstream.
const dictionary & dict() const
This entry is not a dictionary,.
primitiveEntry(const label keyLineNumber, const keyType &key)
Construct from line number and keyword.
A token holds items read from Istream.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
bool read(const char *, int32_t &)
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.
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
word format(conversionProperties.lookup("format"))
points setSize(newPointi)