97 <<
"No dictionary entry " <<
name <<
nl 104 <<
"Found dictionary " <<
name <<
" instead of entry" <<
nl 122 auto* ctorPtr = emptyConstructorTable(
name);
130 *emptyConstructorTablePtr_
147 constexpr
const char sigil =
'$';
156 (varBeg =
s.find(sigil, varBeg)) != std::string::npos
157 && varBeg <
s.size()-1
160 if (varBeg &&
s[varBeg-1] ==
'\\')
167 if (
s[varBeg+1] ==
'[')
174 if (varEnd == std::string::npos)
178 <<
"No correct terminating ']' found in " <<
s <<
nl 184 word castTo, varName;
186 const auto lparen = varBeg+2;
187 if (lparen <
s.size() &&
s[lparen] ==
'(')
189 const auto rparen =
s.find(
')', lparen);
197 if (rparen == std::string::npos)
199 err <<
"No closing ')' found in ";
203 err <<
"Closing ')' found outside of";
207 <<
s.substr(varBeg, varEnd-varBeg) <<
nl 211 castTo.assign(
s.substr(lparen+1, rparen - lparen - 1));
212 varName.assign(
s.substr(rparen+1, varEnd - rparen - 1));
218 s.substr(varBeg + 1 + delim, varEnd - varBeg - 2*delim)
232 const auto replaceLen = (varEnd - varBeg + 1);
237 std::string varValue;
244 if (its.
size() == 1 && its[0].isStringType())
247 varValue = its[0].stringToken();
259 s.std::string::replace(varBeg, replaceLen, varValue);
260 varBeg += varValue.size();
282 const std::string& orig,
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void inplaceExpand(std::string &s, const dictionary &dict)
Inplace expand expression with dictionary variables/entries.
constexpr char nl
The newline '\n' character (0x0a)
void inplaceTrim(std::string &s)
Trim leading and trailing whitespace inplace.
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
std::string toString() const
Concatenate tokens into a space-separated std::string. The resulting string may contain quote charact...
Macros for easy insertion into run-time selection tables.
const entry * findScoped(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for a scoped entry (const access) with the given keyword.
Convert dictionary entry to a stringified expression.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
static autoPtr< expressionEntry > New(const word &name)
Return an entry to expression converter.
static expressions::exprString expand(const std::string &str, const dictionary &dict)
Expand expression with dictionary entries.
A class for handling words, derived from Foam::string.
graph_traits< Graph >::vertices_size_type size_type
void inplaceExpand(std::string &s, const HashTable< string > &mapping, const char sigil='$')
Inplace expand occurrences of variables according to the mapping. Does not use environment values...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual bool isDict() const noexcept
Return true if this entry is a dictionary.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Macros to ease declaration of run-time selection tables.
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))
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
A variant of Foam::string with expansion of dictionary variables into a comma-separated form...
static const entry * getVariableOrDie(const word &name, const dictionary &dict)
An input stream of tokens.
A keyword and a list of tokens is an 'entry'.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...