Go to the documentation of this file.
35 void Foam::dictionary::reportDefault
43 <<
"Dictionary: " << relativeName(
true).c_str()
44 <<
" Entry: " << keyword;
52 <<
" Default: " << deflt <<
nl;
58 template<
class Compare>
61 return hashedEntries_.sortedToc(comp);
87 readEntry<T>(keyword,
val, matchOpt);
92 template<
class T,
class Predicate>
96 const Predicate& pred,
101 readCheck<T, Predicate>(keyword,
val, pred, matchOpt);
110 std::initializer_list<std::pair<const char*,int>> compat,
115 readCompat<T>(keyword, compat,
val, matchOpt);
137 checkITstream(is, keyword);
141 else if (writeOptionalEntries)
143 if (writeOptionalEntries > 1)
146 <<
"No optional entry: " << keyword
147 <<
" Default: " << deflt <<
nl
152 reportDefault(keyword, deflt);
177 checkITstream(is, keyword);
181 else if (writeOptionalEntries)
183 if (writeOptionalEntries > 1)
186 <<
"No optional entry: " << keyword
187 <<
" Default: " << deflt <<
nl
192 reportDefault(keyword, deflt,
true);
201 template<
class T,
class Predicate>
206 const Predicate& pred,
214 <<
"Entry '" << keyword <<
"' with invalid default in dictionary "
228 checkITstream(is, keyword);
232 raiseBadInput(keyword);
237 else if (writeOptionalEntries)
239 if (writeOptionalEntries > 1)
242 <<
"No optional entry: " << keyword
243 <<
" Default: " << deflt <<
nl
248 reportDefault(keyword, deflt);
256 template<
class T,
class Predicate>
261 const Predicate& pred,
269 <<
"Entry '" << keyword <<
"' with invalid default in dictionary "
283 checkITstream(is, keyword);
287 raiseBadInput(keyword);
292 else if (writeOptionalEntries)
294 if (writeOptionalEntries > 1)
297 <<
"No optional entry: " << keyword
298 <<
" Default: " << deflt <<
nl
303 reportDefault(keyword, deflt,
true);
328 checkITstream(is, keyword);
335 <<
"Entry '" << keyword <<
"' not found in dictionary "
344 template<
class T,
class Predicate>
349 const Predicate& pred,
361 checkITstream(is, keyword);
365 raiseBadInput(keyword);
373 <<
"Entry '" << keyword <<
"' not found in dictionary "
386 std::initializer_list<std::pair<const char*,int>> compat,
392 const const_searcher finder(csearchCompat(keyword, compat, matchOpt));
399 checkITstream(is, keyword);
406 <<
"Entry '" << keyword <<
"' not found in dictionary "
424 return readEntry<T>(keyword,
val, matchOpt,
false);
428 template<
class T,
class Predicate>
433 const Predicate& pred,
438 return readCheck<T, Predicate>(keyword,
val, pred, matchOpt,
false);
446 std::initializer_list<std::pair<const char*,int>> compat,
451 const const_searcher finder(csearchCompat(keyword, compat, matchOpt));
460 checkITstream(is, keyword);
464 else if (writeOptionalEntries)
466 if (writeOptionalEntries > 1)
469 <<
"No optional entry: " << keyword
470 <<
" Default: " << deflt <<
nl
475 reportDefault(keyword, deflt);
487 std::initializer_list<std::pair<const char*,int>> compat,
493 return readCompat<T>(keyword, compat,
val, matchOpt,
false);
A keyword and a list of tokens is an 'entry'.
label ListType::const_reference val
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
A class for handling words, derived from Foam::string.
T getOrAdd(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX)
T getCheckOrAdd(const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX)
T getOrDefaultCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, const T &deflt, enum keyType::option=keyType::REGEX) const
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
T getCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option=keyType::REGEX) const
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
messageStream InfoErr
Information stream (uses stderr - output is on the master only)
Generic const/non-const dictionary entry searcher.
A class for handling keywords in dictionaries.
bool readIfPresentCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option=keyType::REGEX) const
An input stream of tokens.
word name(const complex &c)
Return string representation of complex.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
bool good() const
True if entry was found.
T getCheckOrDefault(const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
pointer ptr() const
A pointer to the entry (nullptr if not found)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool readCheck(const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
bool readCheckIfPresent(const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
label k
Boltzmann constant.
bool readCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option=keyType::REGEX, bool mandatory=true) const
T getCheck(const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
wordList sortedToc() const
Return the sorted table of contents.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
option
Enumeration for the data type and search/match modes (bitmask)