34 bool Foam::entry::getKeyword
47 is.read(keywordToken).bad()
49 || !keywordToken.good()
58 keywordLineNo = is.lineNumber();
64 bool Foam::entry::getKeyword
72 bool ok = getKeyword(keyword, keywordToken, keywordLineNo, is);
90 <<
"entry::getKeyword(keyType&, Istream&)" <<
std::endl
91 <<
" in file " << __FILE__
107 is.
fatalCheck(
"entry::New(const dictionary& parentDict, Istream&)");
110 label keywordLineNo = -1;
114 bool valid = getKeyword(keyword, keyToken, keywordLineNo, is);
130 return parentDict.
add
139 cerr<<
"--> FOAM Warning : " <<
std::endl
141 <<
"entry::New(dictionary&, Istream&)" <<
std::endl
142 <<
" in file " << __FILE__
160 if (disableFunctionEntries)
164 return parentDict.
add(fe.
ptr(),
false);
169 return fe->execute(parentDict, is);
174 !disableFunctionEntries
186 string s(keyword(2, keyword.size() - 3));
191 keyword.std::string::replace(1, keyword.size() - 1,
s);
196 const word varName = keyword(1, keyword.size() - 1);
209 <<
"Attempt to use undefined variable " << varName
219 return parentDict.
add
228 <<
"Attempt to substitute sub-dictionary"
230 <<
"for keyword " << varName
237 const word varName = keyword(1, keyword.size() - 1);
250 <<
"Attempt to use undefined variable " << keyword
262 parentDict.
add(iter());
269 <<
"Attempt to substitute primitive entry "
270 << *ePtr <<
"as a sub-dictionary"
284 bool mergeEntry =
false;
287 if (disableFunctionEntries)
310 if (existingPtr->
isDict())
338 <<
"ERROR! duplicate entry: " << keyword
347 return parentDict.
add
355 return parentDict.
add
371 label keywordLineNo = -1;
374 if (!getKeyword(keyword, keywordLineNo, is))
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Template class for intrusive linked lists.
virtual const fileName & name() const
Return the name of the stream.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &)
Put back token.
bool eof() const
Return true if end of input seen.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
T * ptr()
Return object pointer for reuse.
A keyword and a list of tokens is a 'dictionaryEntry'.
Read/write List of dictionaries.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
const entry * lookupScopedEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present,.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
void clear()
Clear the dictionary.
static const dictionary null
Null dictionary.
A keyword and a list of tokens is an 'entry'.
virtual bool isDict() const
Return true if this entry is a dictionary.
virtual ITstream & stream() const =0
Return token stream if this entry is a primitive entry.
const keyType & keyword() const
Return keyword.
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
virtual bool isStream() const
Return true if this entry is a stream.
static bool overwrite()
Return true if the inputMode is overwrite.
static bool protect()
Return true if the inputMode is protect.
static bool merge()
Return true if the inputMode is merge.
static bool error()
Return true if the inputMode is error.
static autoPtr< functionEntry > New(const keyType &functionName, const dictionary &parentDict, Istream &is)
Construct from Istream and insert into dictionary.
A class for handling keywords in dictionaries.
bool isVariable() const
Return true if the keyword is a variable.
bool isFunctionName() const
Return true if the keyword is a functionName.
bool isUndefined() const
Return true if the type has not been defined.
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read,...
A token holds items read from Istream.
bool isPunctuation() const
punctuationToken pToken() const
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool valid(const PtrList< ModelType > &l)
string & inplaceExpandEntry(string &s, const dictionary &dict, const bool allowEnvVars, const bool allowEmpty, const char sigil='$')
Inplace expand occurrences of variables according to the dictionary.
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 & operator<<(Ostream &os, const fvConstraints &constraints)