34 bool Foam::entry::getKeyword(keyType& keyword, token& keywordToken, Istream& is)
41 is.read(keywordToken).bad()
43 || !keywordToken.good()
57 bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
60 bool ok = getKeyword(keyword, keywordToken, is);
78 <<
"entry::getKeyword(keyType&, Istream&)" <<
std::endl
79 <<
" in file " << __FILE__
93 is.
fatalCheck(
"entry::New(const dictionary& parentDict, Istream&)");
99 bool valid = getKeyword(keyword, keyToken, is);
115 return parentDict.
add
124 cerr<<
"--> FOAM Warning : " <<
std::endl
126 <<
"entry::New(dictionary&, Istream&)" <<
std::endl
127 <<
" in file " << __FILE__
142 if (disableFunctionEntries)
164 !disableFunctionEntries
176 string s(keyword(2, keyword.size() - 3));
181 keyword.std::string::replace(1, keyword.size() - 1,
s);
186 word varName = keyword(1, keyword.size() - 1);
201 return parentDict.
add
210 <<
"Attempt to use undefined variable " << varName
229 bool mergeEntry =
false;
232 if (disableFunctionEntries)
255 if (existingPtr->
isDict())
277 <<
"ERROR! duplicate entry: " << keyword
286 return parentDict.
add
294 return parentDict.
add
312 if (!getKeyword(keyword, is))
virtual const fileName & name() const
Return the name of the stream.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
bool eof() const
Return true if end of input seen.
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,...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A keyword and a list of tokens is a 'dictionaryEntry'.
Read/write List of dictionaries.
A list of keyword definitions, which are a keyword followed by any number of values (e....
bool substituteScopedKeyword(const word &keyword)
Substitute the given scoped keyword prepended by '$' with the.
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.
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.
A functionEntry causes entries to be added/manipulated on the specified dictionary given an input str...
static bool execute(const word &functionName, dictionary &parentDict, Istream &)
Execute the functionEntry in a sub-dict context.
A functionName is a word starting with '#'.
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(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), 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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)