Read/write List of dictionaries. More...
Public Member Functions | |
dictionaryListEntry (const dictionary &parentDict, Istream &is) | |
dictionaryListEntry (const dictionary &parentDict, const dictionaryListEntry &dictEnt) | |
autoPtr< entry > | clone (const dictionary &parentDict) const |
virtual void | write (Ostream &os) const |
InfoProxy< dictionaryListEntry > | info () const |
![]() | |
dictionaryEntry (const dictionary &parentDict, Istream &is) | |
dictionaryEntry (const keyType &key, const dictionary &parentDict, Istream &is) | |
dictionaryEntry (const keyType &key, const dictionary &parentDict, const dictionary &dict) | |
dictionaryEntry (const dictionary &parentDict, const dictionaryEntry &dictEnt) | |
virtual const fileName & | name () const |
virtual fileName & | name () |
virtual fileName | relativeName () const |
virtual label | startLineNumber () const |
virtual label | endLineNumber () const |
virtual ITstream & | stream () const |
virtual const dictionary * | dictPtr () const noexcept |
virtual dictionary * | dictPtr () noexcept |
virtual const dictionary & | dict () const noexcept |
virtual dictionary & | dict () noexcept |
InfoProxy< dictionaryEntry > | info () const |
![]() | |
entry (const keyType &keyword) | |
entry (const entry &e) | |
virtual autoPtr< entry > | clone () const |
virtual | ~entry ()=default |
const keyType & | keyword () const noexcept |
keyType & | keyword () noexcept |
virtual bool | isStream () const noexcept |
virtual bool | isDict () const noexcept |
void | checkITstream (const ITstream &is) const |
template<class T > | |
T | get () const |
template<class T > | |
void | readEntry (T &val) const |
template<class T , class Predicate > | |
T | getCheck (const Predicate &pred) const |
template<class T , class Predicate > | |
void | readCheck (T &val, const Predicate &pred) const |
void | operator= (const entry &e) |
bool | operator== (const entry &e) const |
bool | operator!= (const entry &e) const |
![]() | |
ClassName ("dictionary") | |
dictionary () | |
dictionary (const fileName &name) | |
dictionary (const fileName &name, const dictionary &parentDict, Istream &is, bool keepHeader=false) | |
dictionary (Istream &is) | |
dictionary (Istream &is, bool keepHeader) | |
dictionary (const dictionary &parentDict, const dictionary &dict) | |
dictionary (const dictionary &dict) | |
dictionary (const dictionary *dict) | |
dictionary (const dictionary &parentDict, dictionary &&dict) | |
dictionary (dictionary &&dict) | |
autoPtr< dictionary > | clone () const |
virtual | ~dictionary () |
const fileName & | name () const noexcept |
fileName & | name () noexcept |
word | dictName () const |
fileName | relativeName (const bool caseTag=false) const |
bool | isNullDict () const noexcept |
const dictionary & | parent () const noexcept |
const dictionary & | topDict () const |
label | startLineNumber () const |
label | endLineNumber () const |
SHA1Digest | digest () const |
tokenList | tokens () const |
bool | found (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
entry * | findEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) |
const entry * | findEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
const entry * | findScoped (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
dictionary * | findDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) |
const dictionary * | findDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
const entry & | lookupEntry (const word &keyword, enum keyType::option matchOpt) const |
ITstream & | lookup (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
template<class T > | |
T | get (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
template<class T > | |
T | getOrDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const |
template<class T > | |
T | getOrAdd (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) |
template<class T > | |
bool | readEntry (const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const |
template<class T > | |
bool | readIfPresent (const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const |
template<class T , class Predicate > | |
T | getCheck (const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const |
template<class T , class Predicate > | |
T | getCheckOrDefault (const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const |
template<class T , class Predicate > | |
T | getCheckOrAdd (const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) |
template<class T , class Predicate > | |
bool | readCheck (const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const |
template<class T , class Predicate > | |
bool | readCheckIfPresent (const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const |
bool | isDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
const dictionary & | subDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
dictionary & | subDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) |
dictionary & | subDictOrAdd (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) |
dictionary | subOrEmptyDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const |
const dictionary & | optionalSubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
wordList | toc () const |
wordList | sortedToc () const |
template<class Compare > | |
wordList | sortedToc (const Compare &comp) const |
List< keyType > | keys (bool patterns=false) const |
bool | substituteKeyword (const word &keyword, bool mergeEntry=false) |
bool | substituteScopedKeyword (const word &keyword, bool mergeEntry=false) |
entry * | add (entry *entryPtr, bool mergeEntry=false) |
entry * | add (const entry &e, bool mergeEntry=false) |
entry * | add (const keyType &k, const word &v, bool overwrite=false) |
entry * | add (const keyType &k, const string &v, bool overwrite=false) |
entry * | add (const keyType &k, const label v, bool overwrite=false) |
entry * | add (const keyType &k, const scalar v, bool overwrite=false) |
entry * | add (const keyType &k, const dictionary &d, bool mergeEntry=false) |
template<class T > | |
entry * | add (const keyType &k, const T &v, bool overwrite=false) |
entry * | set (entry *entryPtr) |
entry * | set (const entry &e) |
entry * | set (const keyType &k, const dictionary &v) |
template<class T > | |
entry * | set (const keyType &k, const T &v) |
bool | remove (const word &keyword) |
bool | changeKeyword (const keyType &oldKeyword, const keyType &newKeyword, bool overwrite=false) |
bool | merge (const dictionary &dict) |
void | clear () |
void | transfer (dictionary &dict) |
void | checkITstream (const ITstream &is, const word &keyword) const |
bool | read (Istream &is) |
bool | read (Istream &is, bool keepHeader) |
void | writeEntry (Ostream &os) const |
void | writeEntry (const keyType &keyword, Ostream &os) const |
void | writeEntries (Ostream &os, const bool extraNewLine=false) const |
void | write (Ostream &os, const bool subDict=true) const |
const_searcher | csearch (const word &keyword, enum keyType::option=keyType::REGEX) const |
const_searcher | search (const word &keyword, enum keyType::option=keyType::REGEX) const |
searcher | search (const word &keyword, enum keyType::option=keyType::REGEX) |
const_searcher | csearchScoped (const word &keyword, enum keyType::option) const |
const_searcher | searchScoped (const word &keyword, enum keyType::option) const |
searcher | searchScoped (const word &keyword, enum keyType::option) |
const dictionary * | cfindScopedDict (const fileName &dictPath) const |
const dictionary * | findScopedDict (const fileName &dictPath) const |
dictionary * | findScopedDict (const fileName &dictPath) |
dictionary * | makeScopedDict (const fileName &dictPath) |
const_searcher | csearchCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option=keyType::REGEX) const |
bool | foundCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option=keyType::REGEX) const |
const entry * | findCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option) const |
const entry & | lookupEntryCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option) const |
ITstream & | lookupCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option=keyType::REGEX) const |
template<class T > | |
T | getCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option=keyType::REGEX) const |
template<class T > | |
T | getOrDefaultCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, const T &deflt, enum keyType::option=keyType::REGEX) const |
template<class T > | |
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 |
template<class T > | |
bool | readIfPresentCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option=keyType::REGEX) const |
void | operator= (const dictionary &rhs) |
void | operator+= (const dictionary &rhs) |
void | operator|= (const dictionary &rhs) |
void | operator<<= (const dictionary &rhs) |
template<class T > | |
T | lookupOrDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const |
template<class T > | |
T | lookupOrAddDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) |
template<class T > | |
T | lookupOrDefaultCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const |
ITstream & | operator[] (const word &keyword) const |
bool | found (const word &keyword, bool recursive, bool patternMatch=true) const |
entry * | lookupEntryPtr (const word &keyword, bool recursive, bool patternMatch) |
const entry * | lookupEntryPtr (const word &keyword, bool recursive, bool patternMatch) const |
const entry * | lookupScopedEntryPtr (const word &keyword, bool recursive, bool patternMatch) const |
const dictionary * | subDictPtr (const word &keyword) const |
dictionary * | subDictPtr (const word &keyword) |
const entry & | lookupEntry (const word &keyword, bool recursive, bool patternMatch) const |
ITstream & | lookup (const word &keyword, bool recursive, bool patternMatch=true) const |
template<class T > | |
T | lookupOrDefault (const word &keyword, const T &deflt, bool recursive, bool patternMatch=true) const |
template<class T > | |
T | lookupOrAddDefault (const word &keyword, const T &deflt, bool recursive, bool patternMatch=true) |
template<class T > | |
bool | readIfPresent (const word &keyword, T &val, bool recursive, bool patternMatch=true) const |
template<class T > | |
T | lookupType (const word &keyword, bool recursive=false, bool patternMatch=true) const |
bool | getBool (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
Same as get< bool >(const word&, keyType::option) More... | |
label | getLabel (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
Same as get< label >(const word&, keyType::option) More... | |
scalar | getScalar (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
Same as get< scalar >(const word&, keyType::option) More... | |
string | getString (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
Same as get< string >(const word&, keyType::option) More... | |
word | getWord (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
Same as get< word >(const word&, keyType::option) More... | |
fileName | getFileName (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const |
Same as get< fileName >(const word&, keyType::option) More... | |
template<class Compare > | |
Foam::wordList | sortedToc (const Compare &comp) const |
template<class T > | |
Foam::entry * | add (const keyType &k, const T &v, bool overwrite) |
template<class T > | |
Foam::entry * | set (const keyType &k, const T &v) |
![]() | |
ILList ()=default | |
ILList (T *item) | |
ILList (Istream &is) | |
ILList (const ILList< LListBase, T > &lst) | |
ILList (ILList< LListBase, T > &&lst) | |
template<class CloneArg > | |
ILList (const ILList< LListBase, T > &lst, const CloneArg &cloneArg) | |
template<class INew > | |
ILList (Istream &is, const INew &inew) | |
~ILList () | |
bool | eraseHead () |
bool | erase (T *item) |
void | clear () |
void | transfer (ILList< LListBase, T > &lst) |
void | operator= (const ILList< LListBase, T > &lst) |
void | operator= (ILList< LListBase, T > &&lst) |
Friends | |
Ostream & | operator<< (Ostream &os, const dictionaryListEntry &e) |
Additional Inherited Members | |
![]() | |
enum | inputMode { MERGE, OVERWRITE, PROTECT, WARN, ERROR, GLOBAL } |
![]() | |
typedef Searcher< true > | const_searcher |
typedef Searcher< false > | searcher |
![]() | |
static bool | New (dictionary &parentDict, Istream &is, const inputMode inpMode=inputMode::GLOBAL, const int endChar=0) |
static autoPtr< entry > | New (Istream &is) |
static void | resetInputMode () |
![]() | |
static int | reportOptional () noexcept |
static int | reportOptional (const int level) noexcept |
static autoPtr< dictionary > | New (Istream &is) |
![]() | |
friend | const_searcher |
friend | searcher |
![]() | |
static int | disableFunctionEntries |
static inputMode | globalInputMode = inputMode::MERGE |
![]() | |
static int | writeOptionalEntries |
static const dictionary | null |
static refPtr< OSstream > | reportingOutput |
![]() | |
static void | reportReadWarning (const IOstream &, const std::string &) |
Read/write List of dictionaries.
The List entries get stored in a dictionary which itself is stored in the parent dictionary with keyword 'entryDDD' where DDD is the position in the parent dictionary. The printing is again in List format - the keyword is only printed as comment. Can be used to e.g. manipulate polyMesh/boundary files.
Definition at line 60 of file dictionaryListEntry.H.
dictionaryListEntry | ( | const dictionary & | parentDict, |
Istream & | is | ||
) |
Definition at line 54 of file dictionaryListEntryIO.C.
References Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, token::info(), token::isLabel(), token::isPunctuation(), token::labelToken(), Foam::New(), Foam::nl, Istream::putBack(), Istream::readBeginList(), and Istream::readEndList().
dictionaryListEntry | ( | const dictionary & | parentDict, |
const dictionaryListEntry & | dictEnt | ||
) |
Definition at line 44 of file dictionaryListEntryIO.C.
|
inlinevirtual |
Reimplemented from dictionaryEntry.
Definition at line 84 of file dictionaryListEntry.H.
|
virtual |
Reimplemented from dictionaryEntry.
Definition at line 110 of file dictionaryListEntryIO.C.
References token::BEGIN_LIST, Foam::decrIndent(), token::END_LIST, FUNCTION_NAME, Foam::incrIndent(), Foam::indent(), entry::keyword(), Foam::nl, os(), token::SPACE, and dictionary::write().
|
inline |
Definition at line 97 of file dictionaryListEntry.H.
|
friend |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.