34 void Foam::primitiveEntry::append
36 const token& currToken,
37 const dictionary& dict,
41 if (currToken.isWord())
43 const word& w = currToken.wordToken();
50 !(w[0] ==
'$' && expandVariable(w, dict))
51 && !(w[0] ==
'#' && expandFunction(w, dict, is))
58 else if (currToken.isVariable())
60 const string& w = currToken.stringToken();
69 && expandVariable(w, dict)
83 bool Foam::primitiveEntry::expandFunction
86 const dictionary& parentDict,
90 word functionName =
keyword(1, keyword.size()-1);
99 "primitiveEntry::readData(const dictionary&, Istream&)" 102 label blockCount = 0;
112 append(currToken, dict, is);
147 append(currToken, dict, is);
153 "primitiveEntry::readData(const dictionary&, Istream&)" 156 if (currToken.
good())
179 std::ostringstream os;
180 os <<
"ill defined primitiveEntry starting at keyword '" 182 <<
" on line " << keywordLineNumber
187 "primitiveEntry::readEntry(const dictionary&, Istream&)",
207 is.
name() +
'.' + key,
222 is.
name() +
'.' + key,
270 this->
write(os,
false);
287 const label nPrintTokens = 10;
289 os <<
" primitiveEntry '" << e.
keyword() <<
"' comprises ";
293 os <<
nl <<
" " << e[i].
info();
296 if (e.
size() > nPrintTokens)
versionNumber version() const
Return the stream version.
bool bad() const
Return true if stream is corrupted.
ITstream(const string &name, const UList< token > &tokens, streamFormat format=ASCII, versionNumber version=currentVersion)
Construct from components.
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.
T & newElmt(const label)
Return subscript-checked element of UList.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static bool execute(const word &functionName, dictionary &parentDict, Istream &)
Execute the functionEntry in a sub-dict context.
void size(const label)
Override size to be inconsistent with allocated storage.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const fileName & name() const
Return the dictionary name.
A class for handling keywords in dictionaries.
const keyType & keyword() const
Return keyword.
static const dictionary null
Null dictionary.
void write(Ostream &) const
Write.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T & operator[](const label)
Return element of UList.
const double e
Elementary charge.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A helper class for outputting values to Ostream.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define SafeFatalIOErrorIn(functionName, ios, msg)
Report an error message using Foam::FatalIOError.
streamFormat format() const
Return current stream format.
virtual Ostream & write(const token &)=0
Write next token to stream.
primitiveEntry(const keyType &, Istream &)
Construct from keyword and a Istream.
A token holds items read from Istream.
label lineNumber() const
Return current stream line number.
label tokenIndex() const
Return the current token index.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
A keyword and a list of tokens is an 'entry'.
Istream(streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
Set stream status.
void print(Ostream &) const
Print description of IOstream to Ostream.
virtual const fileName & name() const
Return the name of the stream.
static int disableFunctionEntries
virtual bool read(const dictionary &, Istream &)
Read tokens from the given stream.
label size() const
Return the number of elements in the UList.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
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.
List< token > tokenList
List of tokens, used for a IOdictionary entry.
InfoProxy< primitiveEntry > info() const
Return info proxy.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
entry(const keyType &)
Construct from keyword.