Go to the documentation of this file.
51 string s(
w(2,
w.size()-3));
56 newW.std::string::replace(1, newW.size()-1,
s);
58 return expandVariable(newW,
dict);
62 string varName =
w(1,
w.size()-1);
87 string envStr =
getEnv(varName);
94 ) <<
"Illegal dictionary entry or environment variable name "
95 << varName <<
endl <<
"Valid dictionary entries are "
159 return tokens.first().lineNumber();
174 return tokens.last().lineNumber();
190 <<
"Attempt to return primitive entry " << info()
191 <<
" as a sub-dictionary"
201 <<
"Attempt to return primitive entry " << info()
202 <<
" as a sub-dictionary"
A keyword and a list of tokens is an 'entry'.
label tokenIndex() const
Return the current token index.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read,...
virtual ITstream & stream() const =0
Return token stream if this entry is a primitive entry.
void append(const UList< token > &)
Append the given tokens starting at the current tokenIndex.
const fileName & name() const
Return the dictionary name.
const keyType & keyword() const
Return keyword.
#define forAll(list, i)
Loop across all elements in list.
T & newElmt(const label)
Return subscript-checked element of UList.
ITstream & stream() const
Return token stream if this entry is a primitive entry.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds items read from Istream.
A simple container for copying or transferring objects of type <T>.
A class for handling keywords in dictionaries.
string getEnv(const word &)
Return environment variable of given name.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool isDict() const
Return true if this entry is a dictionary.
label endLineNumber() const
Return line number of last token in dictionary.
primitiveEntry(const keyType &, Istream &)
Construct from keyword and a Istream.
label startLineNumber() const
Return line number of first token in dictionary.
const entry * lookupScopedEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Input from memory buffer stream.
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
errorManip< error > abort(error &err)
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
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))
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< token > tokenList
List of tokens, used for a IOdictionary entry.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const dictionary & dict() const
This entry is not a dictionary,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
tokenList tokens() const
Return the dictionary as a list of tokens.
wordList toc() const
Return the table of contents.
bool expandVariable(const string &, const dictionary &)
Expand the given variable (keyword starts with $)
string & inplaceExpand(string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Inplace expand occurences of variables according to the mapping.
static const dictionary null
Null dictionary.