39 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
41 if (entryPtr ==
nullptr)
46 ) <<
"keyword " << keyword <<
" is undefined in dictionary " 64 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
72 if (writeOptionalEntries)
75 <<
"Optional entry '" << keyword <<
"' is not present," 76 <<
" returning the default value '" << deflt <<
"'" 94 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
102 if (writeOptionalEntries)
105 <<
"Optional entry '" << keyword <<
"' is not present," 106 <<
" adding and returning the default value '" << deflt <<
"'" 125 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
129 entryPtr->
stream() >> val;
134 if (writeOptionalEntries)
137 <<
"Optional entry '" << keyword <<
"' is not present," 138 <<
" the default value '" << val <<
"' will be used." 163 template<
class EntryType>
167 const word& entryName,
168 const EntryType& value
177 template<
class EntryType>
181 const word& entryName,
182 const EntryType& value1,
183 const EntryType& value2
186 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.
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.
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.