33 void Foam::primitiveEntry::append(
const UList<token>& varTokens)
42 bool Foam::primitiveEntry::expandVariable
45 const dictionary&
dict
51 string s(w(2, w.size() - 3));
57 newW.std::string::replace(1, newW.size() - 1,
s);
59 return expandVariable(newW,
dict);
63 string varName = w(1, w.size() - 1);
78 append(ePtr->dict().tokens());
82 append(ePtr->stream());
88 string envStr =
getEnv(varName);
95 ) <<
"Illegal dictionary entry or environment variable name "
96 << varName <<
endl <<
"Valid dictionary entries are "
101 append(
tokenList(IStringStream(
'(' + envStr +
')')()));
160 return tokens.
first().lineNumber();
175 return tokens.
last().lineNumber();
191 <<
"Attempt to return primitive entry " << info()
192 <<
" as a sub-dictionary"
202 <<
"Attempt to return primitive entry " << info()
203 <<
" as a sub-dictionary"
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
label tokenIndex() const
Return the current token index.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T & newElmt(const label)
Return subscript-checked element of UList.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T & first()
Return the first element of the list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
T & last()
Return the last element of the list.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const entry * lookupScopedEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present,.
wordList toc() const
Return the table of contents.
static const dictionary null
Null dictionary.
A keyword and a list of tokens is an 'entry'.
const keyType & keyword() const
Return keyword.
A class for handling keywords in dictionaries.
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read,...
primitiveEntry(const keyType &, Istream &)
Construct from keyword and a Istream.
label endLineNumber() const
Return line number of last token in dictionary.
ITstream & stream() const
Return token stream if this entry is a primitive entry.
const dictionary & dict() const
This entry is not a dictionary,.
const fileName & name() const
Return the dictionary name.
label startLineNumber() const
Return line number of first token in dictionary.
A token holds items read from Istream.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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))
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.
errorManip< error > abort(error &err)
string getEnv(const word &)
Return environment variable of given name.
List< token > tokenList
List of tokens, used for a IOdictionary entry.