39 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
41 if (entryPtr ==
nullptr)
46 ) <<
"keyword " << keyword <<
" is undefined in dictionary " 63 const entry* entryPtr =
64 lookupEntryPtrBackwardsCompatible(keywords, recursive, patternMatch);
73 return lookup<T>(keywords[0], recursive, patternMatch);
87 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
95 if (writeOptionalEntries)
98 <<
"Optional entry '" << keyword <<
"' is not present," 99 <<
" returning the default value '" << deflt <<
"'" 117 const entry* entryPtr =
118 lookupEntryPtrBackwardsCompatible(keywords, recursive, patternMatch);
127 return lookupOrDefault<T>(keywords[0], deflt, recursive, patternMatch);
141 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
149 if (writeOptionalEntries)
152 <<
"Optional entry '" << keyword <<
"' is not present," 153 <<
" adding and returning the default value '" << deflt <<
"'" 172 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
176 entryPtr->
stream() >> val;
181 if (writeOptionalEntries)
184 <<
"Optional entry '" << keyword <<
"' is not present," 185 <<
" the default value '" << val <<
"' will be used." 210 template<
class EntryType>
214 const word& entryName,
215 const EntryType& value
224 template<
class EntryType>
228 const word& entryName,
229 const EntryType& value1,
230 const EntryType& value2
233 if (value1 != value2)
A class for handling keywords in dictionaries.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
T lookupOrAddDefault(const word &, const T &, bool recursive=false, bool patternMatch=true)
Find and return a T, if not found return the given.
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.
Traits class for primitives.
label k
Boltzmann constant.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read, written and printed, and the types and values of its tokens analysed.
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.
A class for handling words, derived from string.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
word name(const complex &)
Return a string representation of a complex.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void set(entry *)
Assign a new entry, overwrite any existing entry.
#define IOInfoInFunction(ios)
Report an IO information message using Foam::Info.
virtual ITstream & stream() const =0
Return token stream if this entry is a primitive entry.
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'.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.