40 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
48 if (writeOptionalEntries)
51 <<
"Optional entry '" << keyword <<
"' is not present," 52 <<
" returning the default value '" << deflt <<
"'" 70 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
78 if (writeOptionalEntries)
81 <<
"Optional entry '" << keyword <<
"' is not present," 82 <<
" adding and returning the default value '" << deflt <<
"'" 101 const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
105 entryPtr->
stream() >> val;
110 if (writeOptionalEntries)
113 <<
"Optional entry '" << keyword <<
"' is not present," 114 <<
" the default value '" << val <<
"' will be used." A class for handling keywords in dictionaries.
T lookupOrAddDefault(const word &, const T &, bool recursive=false, bool patternMatch=true)
Find and return a T, if not found return the given.
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.
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 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.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
A keyword and a list of tokens is an 'entry'.