31 template<
class T,
class ... KeysAndTs>
36 const KeysAndTs& ... keysAndTs
41 set(
k, t, keysAndTs ...);
45 template<
class T,
class ... KeysAndTs>
51 const KeysAndTs& ... keysAndTs
57 set(
k, t, keysAndTs ...);
71 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
73 if (entryPtr ==
nullptr)
78 ) <<
"keyword " << keyword <<
" is undefined in dictionary "
95 const entry* entryPtr =
96 lookupEntryPtrBackwardsCompatible(keywords, recursive, patternMatch);
105 return lookup<T>(keywords[0], recursive, patternMatch);
119 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
127 if (writeOptionalEntries)
130 <<
"Optional entry '" << keyword <<
"' is not present,"
131 <<
" returning the default value '" << deflt <<
"'"
149 const entry* entryPtr =
150 lookupEntryPtrBackwardsCompatible(keywords, recursive, patternMatch);
159 return lookupOrDefault<T>(keywords[0], deflt, recursive, patternMatch);
173 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
181 if (writeOptionalEntries)
184 <<
"Optional entry '" << keyword <<
"' is not present,"
185 <<
" adding and returning the default value '" << deflt <<
"'"
204 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
208 entryPtr->
stream() >> val;
213 if (writeOptionalEntries)
216 <<
"Optional entry '" << keyword <<
"' is not present,"
217 <<
" the default value '" << val <<
"' will be used."
240 template<
class T,
class ... KeysAndTs>
245 const KeysAndTs& ... keysAndTs
255 template<
class EntryType>
259 const word& entryName,
260 const EntryType& value
269 template<
class EntryType>
273 const word& entryName,
274 const EntryType& value1,
275 const EntryType& value2
278 if (value1 != value2)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefaultBackwardsCompatible(const wordList &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, trying a list of keywords in sequence.
dictionary()
Construct top-level dictionary null.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
void set(entry *)
Assign a new entry, overwrite any existing entry.
T lookupOrAddDefault(const word &, const T &, bool recursive=false, bool patternMatch=true)
Find and return a T, if not found return the given.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
ITstream & lookupBackwardsCompatible(const wordList &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream, trying a list of keywords.
A keyword and a list of tokens is an 'entry'.
virtual ITstream & stream() const =0
Return token stream if this entry is a primitive entry.
A class for handling file names.
A class for handling keywords in dictionaries.
Traits class for primitives.
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read,...
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define IOInfoInFunction(ios)
Report an IO information message using Foam::Info.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void writeEntryIfDifferent(Ostream &os, const word &entryName, const EntryType &value1, const EntryType &value2)
Helper function to write the keyword and entry only if the.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
word name(const complex &)
Return a string representation of a complex.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)