Go to the documentation of this file.
45 while (
pos != std::string::npos)
48 if (
pos != std::string::npos)
53 const char 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
93 expanded.assign(varName, 1, varName.size()-2);
110 altValue = expanded.substr(altPos + 2);
111 expanded.erase(altPos);
116 if (expanded.empty())
136 const word& lookupName = (expanded.empty() ? varName : expanded);
154 if (str.empty() ? (altType ==
'-') : (altType ==
'+'))
158 str = std::move(altValue);
160 else if (str.empty())
163 <<
"Illegal dictionary entry or environment variable name "
165 <<
"Known dictionary entries: " <<
dict.
toc() <<
nl
177 else if (eptr->isDict())
183 if (toks.empty() ? (altType ==
'-') : (altType ==
'+'))
197 if (eptr->stream().empty() ? (altType ==
'-') : (altType ==
'+'))
271 return tokens.first().lineNumber();
284 return tokens.last().lineNumber();
302 <<
"Attempt to return primitive entry " << info()
303 <<
" as a sub-dictionary"
313 <<
"Attempt to return primitive entry " << info()
314 <<
" 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.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
virtual ITstream & stream() const
Return token stream for this primitive entry.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A token holds an item read from Istream.
virtual const dictionary & dict() const
This entry is not a dictionary,.
virtual const fileName & name() const
Get the name of the stream.
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.
static char findParameterAlternative(const std::string &s, std::string::size_type &pos, std::string::size_type endPos=std::string::npos)
A class for handling keywords in dictionaries.
void inplaceExpand(std::string &s, const HashTable< string > &mapping, const char sigil='$')
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.
graph_traits< Graph >::vertices_size_type size_type
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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.
static tokenList parse(const UList< char > &input, IOstreamOption streamOpt=IOstreamOption())
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
dimensionedScalar pos(const dimensionedScalar &ds)