Public Member Functions | Friends | List of all members
dictionaryEntry Class Reference

A keyword and a list of tokens is a 'dictionaryEntry'. More...

Inheritance diagram for dictionaryEntry:
Inheritance graph
[legend]
Collaboration diagram for dictionaryEntry:
Collaboration graph
[legend]

Public Member Functions

 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)
 
autoPtr< entryclone (const dictionary &parentDict) const
 
virtual const fileNamename () const
 
virtual fileNamename ()
 
virtual fileName relativeName () const
 
virtual label startLineNumber () const
 
virtual label endLineNumber () const
 
virtual ITstreamstream () const
 
virtual const dictionarydictPtr () const noexcept
 
virtual dictionarydictPtr () noexcept
 
virtual const dictionarydict () const noexcept
 
virtual dictionarydict () noexcept
 
virtual void write (Ostream &os) const
 
InfoProxy< dictionaryEntryinfo () const
 
- Public Member Functions inherited from entry
 entry (const keyType &keyword)
 
 entry (const entry &e)
 
virtual autoPtr< entryclone () const
 
virtual ~entry ()=default
 
const keyTypekeyword () const noexcept
 
keyTypekeyword () 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
 
- Public Member Functions inherited from dictionary
 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< dictionaryclone () const
 
virtual ~dictionary ()
 
const fileNamename () const noexcept
 
fileNamename () noexcept
 
word dictName () const
 
fileName relativeName (const bool caseTag=false) const
 
bool isNullDict () const noexcept
 
const dictionaryparent () const noexcept
 
const dictionarytopDict () 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
 
entryfindEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 
const entryfindEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 
const entryfindScoped (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 
dictionaryfindDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 
const dictionaryfindDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 
const entrylookupEntry (const word &keyword, enum keyType::option matchOpt) const
 
ITstreamlookup (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 dictionarysubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 
dictionarysubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 
dictionarysubDictOrAdd (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 dictionaryoptionalSubDict (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< keyTypekeys (bool patterns=false) const
 
bool substituteKeyword (const word &keyword, bool mergeEntry=false)
 
bool substituteScopedKeyword (const word &keyword, bool mergeEntry=false)
 
entryadd (entry *entryPtr, bool mergeEntry=false)
 
entryadd (const entry &e, bool mergeEntry=false)
 
entryadd (const keyType &k, const word &v, bool overwrite=false)
 
entryadd (const keyType &k, const string &v, bool overwrite=false)
 
entryadd (const keyType &k, const label v, bool overwrite=false)
 
entryadd (const keyType &k, const scalar v, bool overwrite=false)
 
entryadd (const keyType &k, const dictionary &d, bool mergeEntry=false)
 
template<class T >
entryadd (const keyType &k, const T &v, bool overwrite=false)
 
entryset (entry *entryPtr)
 
entryset (const entry &e)
 
entryset (const keyType &k, const dictionary &v)
 
template<class T >
entryset (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 dictionarycfindScopedDict (const fileName &dictPath) const
 
const dictionaryfindScopedDict (const fileName &dictPath) const
 
dictionaryfindScopedDict (const fileName &dictPath)
 
dictionarymakeScopedDict (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 entryfindCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option) const
 
const entrylookupEntryCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option) const
 
ITstreamlookupCompat (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
 
ITstreamoperator[] (const word &keyword) const
 
bool found (const word &keyword, bool recursive, bool patternMatch=true) const
 
entrylookupEntryPtr (const word &keyword, bool recursive, bool patternMatch)
 
const entrylookupEntryPtr (const word &keyword, bool recursive, bool patternMatch) const
 
const entrylookupScopedEntryPtr (const word &keyword, bool recursive, bool patternMatch) const
 
const dictionarysubDictPtr (const word &keyword) const
 
dictionarysubDictPtr (const word &keyword)
 
const entrylookupEntry (const word &keyword, bool recursive, bool patternMatch) const
 
ITstreamlookup (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::entryadd (const keyType &k, const T &v, bool overwrite)
 
template<class T >
Foam::entryset (const keyType &k, const T &v)
 
- Public Member Functions inherited from ILList
 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

Ostreamoperator<< (Ostream &os, const dictionaryEntry &e)
 

Additional Inherited Members

- Public Types inherited from entry
enum  inputMode {
  MERGE, OVERWRITE, PROTECT, WARN,
  ERROR, GLOBAL
}
 
- Public Types inherited from dictionary
typedef Searcher< true > const_searcher
 
typedef Searcher< false > searcher
 
- Static Public Member Functions inherited from entry
static bool New (dictionary &parentDict, Istream &is, const inputMode inpMode=inputMode::GLOBAL, const int endChar=0)
 
static autoPtr< entryNew (Istream &is)
 
static void resetInputMode ()
 
- Static Public Member Functions inherited from dictionary
static int reportOptional () noexcept
 
static int reportOptional (const int level) noexcept
 
static autoPtr< dictionaryNew (Istream &is)
 
- Public Attributes inherited from dictionary
friend const_searcher
 
friend searcher
 
- Static Public Attributes inherited from entry
static int disableFunctionEntries
 
static inputMode globalInputMode = inputMode::MERGE
 
- Static Public Attributes inherited from dictionary
static int writeOptionalEntries
 
static const dictionary null
 
static refPtr< OSstreamreportingOutput
 
- Static Protected Member Functions inherited from entry
static void reportReadWarning (const IOstream &, const std::string &)
 

Detailed Description

A keyword and a list of tokens is a 'dictionaryEntry'.

An dictionaryEntry can be read, written and printed, and the types and values of its tokens analysed. A dictionaryEntry is a high-level building block for data description. It is a front-end for the token parser. A list of entries can be used as a set of keyword syntax elements, for example.

Source files

Definition at line 61 of file dictionaryEntry.H.

Constructor & Destructor Documentation

◆ dictionaryEntry() [1/4]

dictionaryEntry ( const dictionary parentDict,
Istream is 
)

Definition at line 28 of file dictionaryEntryIO.C.

References IOstream::fatalCheck(), and FUNCTION_NAME.

Here is the call graph for this function:

◆ dictionaryEntry() [2/4]

dictionaryEntry ( const keyType key,
const dictionary parentDict,
Istream is 
)

Definition at line 41 of file dictionaryEntryIO.C.

References IOstream::fatalCheck(), and FUNCTION_NAME.

Here is the call graph for this function:

◆ dictionaryEntry() [3/4]

dictionaryEntry ( const keyType key,
const dictionary parentDict,
const dictionary dict 
)

Definition at line 27 of file dictionaryEntry.C.

◆ dictionaryEntry() [4/4]

dictionaryEntry ( const dictionary parentDict,
const dictionaryEntry dictEnt 
)

Definition at line 39 of file dictionaryEntry.C.

Member Function Documentation

◆ clone()

autoPtr<entry> clone ( const dictionary parentDict) const
inlinevirtual

Implements entry.

Reimplemented in dictionaryListEntry.

Definition at line 103 of file dictionaryEntry.H.

◆ name() [1/2]

virtual const fileName& name ( ) const
inlinevirtual

Implements entry.

Definition at line 112 of file dictionaryEntry.H.

References dictionary::name().

Referenced by motionSolver::iNew::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name() [2/2]

virtual fileName& name ( )
inlinevirtual

Implements entry.

Definition at line 118 of file dictionaryEntry.H.

References dictionary::name().

Here is the call graph for this function:

◆ relativeName()

virtual fileName relativeName ( ) const
inlinevirtual

Implements entry.

Definition at line 124 of file dictionaryEntry.H.

References dictionary::relativeName().

Here is the call graph for this function:

◆ startLineNumber()

Foam::label startLineNumber ( ) const
virtual

Implements entry.

Definition at line 51 of file dictionaryEntry.C.

◆ endLineNumber()

Foam::label endLineNumber ( ) const
virtual

Implements entry.

Definition at line 62 of file dictionaryEntry.C.

◆ stream()

Foam::ITstream & stream ( ) const
virtual

Implements entry.

Definition at line 73 of file dictionaryEntry.C.

References Foam::abort(), Foam::FatalIOError, and FatalIOErrorInFunction.

Here is the call graph for this function:

◆ dictPtr() [1/2]

Foam::dictionary * dictPtr ( ) const
virtualnoexcept

Reimplemented from entry.

Definition at line 83 of file dictionaryEntry.C.

◆ dictPtr() [2/2]

virtual dictionary* dictPtr ( )
virtualnoexcept

Reimplemented from entry.

◆ dict() [1/2]

Foam::dictionary & dict ( ) const
virtualnoexcept

Implements entry.

Definition at line 95 of file dictionaryEntry.C.

Referenced by cellModel::cellModel(), Foam::operator>>(), and Foam::functionObjects::operator>>().

Here is the caller graph for this function:

◆ dict() [2/2]

virtual dictionary& dict ( )
virtualnoexcept

Implements entry.

◆ write()

void write ( Ostream os) const
virtual

Implements entry.

Reimplemented in dictionaryListEntry.

Definition at line 56 of file dictionaryEntryIO.C.

References entry::keyword(), os(), and dictionary::writeEntry().

Here is the call graph for this function:

◆ info()

InfoProxy<dictionaryEntry> info ( ) const
inline

Definition at line 158 of file dictionaryEntry.H.

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream os,
const dictionaryEntry e 
)
friend

The documentation for this class was generated from the following files: