54 const string&
lookup = entries_[key];
64 const entry* ePtr =
dict.findScoped(lookup);
69 <<
"Unable to find entry " << lookup
79 oss << de.dictName() << de;
83 for (
const auto& t : ePtr->stream())
85 if (oss.
count()) oss << separator_;
99Foam::substitutionModels::dictionaryValue::dictionaryValue
109 separator_(
dict.getOrDefault<
word>(
"separator",
" ")),
112 const auto* oPtr =
dict.findEntry(
"object");
113 const auto* pPtr =
dict.findEntry(
"path");
118 <<
"Specify either 'object' or 'path' but not both"
125 dict.readIfPresent<
word>(
"region", region_);
133 path_ =
dict.get<fileName>(
"path").expand();
138 for (
const auto&
e : entriesDict)
149 return entries_.found(keyName);
159 if (!valid(key))
return false;
164 if (replaceBuiltin(
path))
174 <<
"Unable to find dictionary at " <<
path
175 <<
". Deactivating." <<
endl;
180 return processDict(
dictionary(is), key, buffer);
184 const auto* obrPtr = time_.cfindObject<objectRegistry>(region_);
189 <<
"Unable to find region " << region_
190 <<
". Deactivating." <<
endl;
196 const auto* dictPtr = obrPtr->cfindObject<IOdictionary>(object_,
true);
201 <<
"Unable find dictionary " << object_
202 <<
" on region " << region_
203 <<
". Deactivating." <<
endl;
208 return processDict(*dictPtr, key, buffer);
215 return entries_.sortedToc();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
bool good() const noexcept
True if next operation might succeed.
An OSstream with internal List storage.
auto str() const
For OStringStream compatibility, return the buffer as string copy.
std::streamsize count() const
The number of bytes outputted.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
word dictName() const
The local dictionary name (final part of scoped name).
A keyword and a list of tokens is an 'entry'.
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
virtual bool isDict() const noexcept
True if this entry is a dictionary.
virtual const dictionary & dict() const =0
Return dictionary, if entry is a dictionary, otherwise Fatal.
A class for handling file names.
Registry of regIOobjects.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Mesh consisting of general polyhedral cells.
Lookup type of boundary radiation properties.
string & replaceAll(const std::string &s1, const std::string &s2, size_type pos=0)
Replace all occurrences of sub-string s1 with s2, beginning at pos in the string.
Base class for substitution models.
const Time & time_
Reference to the time database.
static word cleanKey(const string &str)
Clean the key text.
static string keyify(const word &w)
Return a key representation from a word.
static bool replaceBuiltin(const word &key, string &str)
Replace key in string.
The dictionaryValue substitution model. Dictionaries can be retrieved from an object registry,...
virtual bool apply(const word &key, string &buffer) const
Apply substitutions to this string buffer.
virtual bool valid(const word &keyName) const
Return true of model applies to this keyName.
bool processDict(const dictionary &dict, const word &key, string &buffer) const
Main function to process the dictionary.
virtual wordList keys() const
Return a word list of the keys.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define WarningInFunction
Report a warning using Foam::Warning.
List< word > wordList
List of word.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)