35 bool Foam::entry::getKeyword(keyType& keyword, token& keywordToken, Istream& is)
42 is.read(keywordToken).bad()
44 || !keywordToken.good()
52 keyword = keywordToken;
54 return !keyword.isUndefined();
58 bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
61 bool ok = getKeyword(keyword, keywordToken, is);
79 <<
"entry::getKeyword(keyType&, Istream&)" <<
std::endl 80 <<
" in file " << __FILE__
94 is.
fatalCheck(
"entry::New(const dictionary& parentDict, Istream&)");
100 bool valid = getKeyword(keyword, keyToken, is);
116 return parentDict.
add 125 cerr<<
"--> FOAM Warning : " <<
std::endl 127 <<
"entry::New(dictionary&, Istream&)" <<
std::endl 128 <<
" in file " << __FILE__
159 && functionName == functionEntries::inputSyntaxEntry::typeName
166 parentDict.
lookup(keyword)
191 string s(
keyword(2, keyword.size() - 3));
196 keyword.std::string::replace(1, keyword.size() - 1,
s);
214 const keyType newKeyword(ePtr->stream());
216 return parentDict.
add 225 <<
"Attempt to use undefined variable " << varName
244 bool mergeEntry =
false;
270 if (existingPtr->
isDict())
292 <<
"ERROR! duplicate entry: " << keyword
301 return parentDict.
add 309 return parentDict.
add 327 if (!getKeyword(keyword, is))
A class for handling keywords in dictionaries.
punctuationToken pToken() const
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
const keyType & keyword() const
Return keyword.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
virtual void write(Ostream &) const =0
Write.
A token holds items read from Istream.
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
void putBack(const token &)
Put back token.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool isFunctionName() const
Return true if the keyword is a functionName.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
bool isVariable() const
Return true if the keyword is a variable.
A keyword and a list of tokens is a 'dictionaryEntry'.
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.
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.
static bool protect()
Return true if the inputMode is protect.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
static int disableFunctionEntries
A functionName is a word starting with '#'.
A class for handling words, derived from string.
virtual const fileName & name() const
Return the name of the stream.
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.
static const dictionary null
Null dictionary.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
bool eof() const
Return true if end of input seen.
Read/write List of dictionaries.
virtual bool isDict() const
Return true if this entry is a dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static bool merge()
Return true if the inputMode is merge.
string & inplaceExpand(string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Inplace expand occurrences of variables according to the mapping.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Ostream & operator<<(Ostream &, const ensightPart &)
bool substituteScopedKeyword(const word &keyword)
Substitute the given scoped keyword prepended by '$' with the.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const doubleScalar e
Elementary charge.
static bool overwrite()
Return true if the inputMode is overwrite.
void clear()
Clear the dictionary.
static bool error()
Return true if the inputMode is error.
bool isPunctuation() const
A keyword and a list of tokens is an 'entry'.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.