Go to the documentation of this file.
45 while (
pos != std::string::npos)
48 if (
pos != std::string::npos)
53 const int altType =
s[
pos+1];
54 if (altType ==
'+' || altType ==
'-')
64 pos = std::string::npos;
75 bool Foam::primitiveEntry::expandVariable
77 const string& varName,
78 const dictionary&
dict
91 expanded.assign(varName, 1, varName.size()-2);
108 altValue = expanded.substr(altPos + 2);
109 expanded.erase(altPos);
114 if (expanded.empty())
134 const word& lookupName = (expanded.empty() ? varName : expanded);
152 if (str.empty() ? (altType ==
'-') : (altType ==
'+'))
156 str = std::move(altValue);
158 else if (str.empty())
161 <<
"Illegal dictionary entry or environment variable name "
163 <<
"Known dictionary entries: " <<
dict.
toc() <<
nl
175 else if (eptr->isDict())
181 if (toks.empty() ? (altType ==
'-') : (altType ==
'+'))
195 if (eptr->stream().empty() ? (altType ==
'-') : (altType ==
'+'))
269 return tokens.first().lineNumber();
282 return tokens.last().lineNumber();
300 <<
"Attempt to return primitive entry " << info()
301 <<
" as a sub-dictionary"
311 <<
"Attempt to return primitive entry " << info()
312 <<
" as a sub-dictionary"
entry(const keyType &keyword)
Construct from keyword.
A keyword and a list of tokens is an 'entry'.
void append(const token &t, const bool lazy)
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
virtual void rewind()
Rewind the stream so that it may be read again.
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
primitiveEntry(const keyType &key)
Construct from keyword and no tokens.
virtual ITstream & stream() const
Return token stream for this primitive entry.
A token holds an item read from Istream.
virtual const dictionary & dict() const
This entry is not a dictionary,.
string getEnv(const std::string &envName)
Get environment value for given envName.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
A class for handling keywords in dictionaries.
An input stream of tokens.
virtual label endLineNumber() const
Return line number of last token in dictionary.
virtual label startLineNumber() const
Return line number of first token in dictionary.
void inplaceExpand(std::string &s, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
graph_traits< Graph >::vertices_size_type size_type
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static tokenList parse(const UList< char > &input, streamFormat format=ASCII)
errorManip< error > abort(error &err)
Begin block [isseparator].
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.
const entry * findScoped(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for a scoped entry (const access) with the given keyword.
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...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
wordList toc() const
Return the table of contents.
virtual const fileName & name() const
Return the dictionary name.
static int findParameterAlternative(const std::string &s, std::string::size_type &pos, std::string::size_type endPos=std::string::npos)
dimensionedScalar pos(const dimensionedScalar &ds)