A keyword and a list of tokens is a 'dictionaryEntry'. More...
#include <OpenFOAM/dictionaryEntry.H>
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.
Definition at line 58 of file dictionaryEntry.H.
Inheritance diagram for dictionaryEntry:
Collaboration diagram for dictionaryEntry:Public Member Functions | |
| dictionaryEntry (const dictionary &parentDict, Istream &) | |
| Construct from the parent dictionary and Istream. | |
| dictionaryEntry (const keyType &, const dictionary &parentDict, Istream &) | |
| Construct from the keyword, parent dictionary and a Istream. | |
| dictionaryEntry (const keyType &, const dictionary &parentDict, const dictionary &dict) | |
| Construct from the keyword, parent dictionary and a dictionary. | |
| dictionaryEntry (const dictionary &parentDict, const dictionaryEntry &) | |
| Construct as copy for the given parentDict. | |
| autoPtr< entry > | clone (const dictionary &parentDict) const |
| Construct on freestore as copy with reference to the. | |
| const fileName & | name () const |
| Return the dictionary name. | |
| fileName & | name () |
| Return the dictionary name. | |
| label | startLineNumber () const |
| Return line number of first token in dictionary. | |
| label | endLineNumber () const |
| Return line number of last token in dictionary. | |
| ITstream & | stream () const |
| This entry is not a primitive,. | |
| bool | isDict () const |
| Return true because this entry is a dictionary. | |
| const dictionary & | dict () const |
| Return dictionary. | |
| dictionary & | dict () |
| Return non-const access to dictionary. | |
| void | write (Ostream &) const |
| Write. | |
| InfoProxy< dictionaryEntry > | info () const |
| Return info proxy. | |
Public Member Functions inherited from entry | |
| entry (const keyType &) | |
| Construct from keyword. | |
| entry (const entry &) | |
| Construct as copy. | |
| virtual autoPtr< entry > | clone () const |
| Construct on freestore as copy. | |
| virtual | ~entry () |
| Destructor. | |
| const keyType & | keyword () const |
| Return keyword. | |
| keyType & | keyword () |
| Return non-const access to keyword. | |
| virtual bool | isStream () const |
| Return true if this entry is a stream. | |
| void | operator= (const entry &) |
| bool | operator== (const entry &) const |
| bool | operator!= (const entry &) const |
Public Member Functions inherited from DLListBase::link | |
| link () | |
| Null construct. | |
| bool | registered () const |
| Check if the link is registered with the DLListBase. | |
| void | deregister () |
| Deregister the link after removal. | |
Public Member Functions inherited from dictionary | |
| ClassName ("dictionary") | |
| dictionary () | |
| Construct top-level dictionary null. | |
| dictionary (const fileName &name) | |
| Construct top-level empty dictionary with given name. | |
| dictionary (const fileName &name, const dictionary &parentDict, Istream &) | |
| Construct given the entry name, parent dictionary and Istream,. | |
| dictionary (Istream &) | |
| Construct top-level dictionary from Istream, reading entries. | |
| dictionary (const dictionary &parentDict, const dictionary &) | |
| Construct as copy given the parent dictionary. | |
| dictionary (const dictionary &) | |
| Construct top-level dictionary as copy. | |
| dictionary (const dictionary *) | |
| Construct top-level dictionary as copy from pointer to dictionary. | |
| dictionary (const dictionary &parentDict, const Xfer< dictionary > &) | |
| Construct by transferring parameter contents given parent dictionary. | |
| dictionary (const Xfer< dictionary > &) | |
| Construct top-level dictionary by transferring parameter contents. | |
| autoPtr< dictionary > | clone () const |
| Construct and return clone. | |
| ~dictionary () | |
| const dictionary & | parent () const |
| Return the parent dictionary. | |
| SHA1Digest | digest () const |
| Return the SHA1 digest of the dictionary contents. | |
| bool | found (const word &, bool recursive=false) const |
| Search dictionary for given keyword. | |
| const entry * | lookupEntryPtr (const word &, bool recursive, bool patternMatch) const |
| Find and return an entry data stream pointer if present. | |
| entry * | lookupEntryPtr (const word &, bool recursive, bool patternMatch) |
| Find and return an entry data stream pointer for manipulation. | |
| const entry & | lookupEntry (const word &, bool recursive, bool patternMatch) const |
| Find and return an entry data stream if present otherwise error. | |
| ITstream & | lookup (const word &, bool recursive=false, bool patternMatch=true) const |
| Find and return an entry data stream. | |
| template<class T > | |
| T | lookupOrDefault (const word &, const T &, bool recursive=false, bool patternMatch=true) const |
| Find and return a T,. | |
| template<class T > | |
| T | lookupOrAddDefault (const word &, const T &, bool recursive=false, bool patternMatch=true) |
| Find and return a T, if not found return the given. | |
| template<class T > | |
| bool | readIfPresent (const word &, T &, bool recursive=false, bool patternMatch=true) const |
| Find an entry if present, and assign to T. | |
| bool | isDict (const word &) const |
| Check if entry is a sub-dictionary. | |
| const dictionary * | subDictPtr (const word &) const |
| Find and return a sub-dictionary pointer if present. | |
| const dictionary & | subDict (const word &) const |
| Find and return a sub-dictionary. | |
| dictionary & | subDict (const word &) |
| Find and return a sub-dictionary for manipulation. | |
| dictionary | subOrEmptyDict (const word &) const |
| Find and return a sub-dictionary as a copy, or. | |
| wordList | toc () const |
| Return the table of contents. | |
| List< keyType > | keys (bool patterns=false) const |
| Return the list of available keys or patterns. | |
| bool | substituteKeyword (const word &keyword) |
| Substitute the given keyword prepended by '$' with the. | |
| bool | add (entry *, bool mergeEntry=false) |
| Add a new entry. | |
| void | add (const entry &, bool mergeEntry=false) |
| Add an entry. | |
| void | add (const keyType &, const word &, bool overwrite=false) |
| Add a word entry. | |
| void | add (const keyType &, const string &, bool overwrite=false) |
| Add a string entry. | |
| void | add (const keyType &, const label, bool overwrite=false) |
| Add a label entry. | |
| void | add (const keyType &, const scalar, bool overwrite=false) |
| Add a scalar entry. | |
| void | add (const keyType &, const dictionary &, bool mergeEntry=false) |
| Add a dictionary entry. | |
| template<class T > | |
| void | add (const keyType &, const T &, bool overwrite=false) |
| Add a T entry. | |
| void | set (entry *) |
| Assign a new entry, overwrite any existing entry. | |
| void | set (const entry &) |
| Assign a new entry, overwrite any existing entry. | |
| void | set (const keyType &, const dictionary &) |
| Assign a dictionary entry, overwrite any existing entry. | |
| template<class T > | |
| void | set (const keyType &, const T &) |
| Assign a T entry, overwrite any existing entry. | |
| bool | remove (const word &) |
| Remove an entry specified by keyword. | |
| bool | changeKeyword (const keyType &oldKeyword, const keyType &newKeyword, bool forceOverwrite=false) |
| Change the keyword for an entry,. | |
| bool | merge (const dictionary &) |
| Merge entries from the given dictionary. | |
| void | clear () |
| Clear the dictionary. | |
| void | transfer (dictionary &) |
| Transfer the contents of the argument and annul the argument. | |
| Xfer< dictionary > | xfer () |
| Transfer contents to the Xfer container. | |
| bool | read (Istream &) |
| Read dictionary from Istream. | |
| void | write (Ostream &, bool subDict=true) const |
| ITstream & | operator[] (const word &) const |
| Find and return entry. | |
| void | operator= (const dictionary &) |
| void | operator+= (const dictionary &) |
| Include entries from the given dictionary. | |
| void | operator|= (const dictionary &) |
| Conditionally include entries from the given dictionary. | |
| void | operator<<= (const dictionary &) |
| Unconditionally include entries from the given dictionary. | |
Public Member Functions inherited from dictionaryName | |
| dictionaryName () | |
| Construct dictionaryName null. | |
| dictionaryName (const fileName &name) | |
| Construct dictionaryName as copy of the given fileName. | |
Public Member Functions inherited from IDLList< entry > | |
| IDLList () | |
| Null construct. | |
| IDLList (const entry &a) | |
| Construct given initial T. | |
| IDLList (Istream &is, const INew &inewt) | |
| Construct from Istream using given Istream constructor class. | |
| IDLList (Istream &is) | |
| Construct from Istream. | |
| IDLList (const IDLList< entry > &idll, const CloneArg &cloneArg) | |
| Copy constructor with additional argument for clone. | |
Public Member Functions inherited from ILList< DLListBase, entry > | |
| ILList () | |
| Null construct. | |
| ILList (entry *a) | |
| Construct given initial T. | |
| ILList (Istream &) | |
| Construct from Istream. | |
| ILList (const ILList< DLListBase, entry > &) | |
| Construct as copy. | |
| ILList (const ILList< DLListBase, entry > &lst, const CloneArg &cloneArg) | |
| Copy constructor with additional argument for clone. | |
| ILList (Istream &, const INew &) | |
| Construct from Istream using given Istream constructor class. | |
| ~ILList () | |
| bool | eraseHead () |
| Remove the head element specified from the list and delete it. | |
| bool | erase (entry *p) |
| Remove the specified element from the list and delete it. | |
| void | transfer (ILList< DLListBase, entry > &) |
| Transfer the contents of the argument into this List. | |
| void | operator= (const ILList< DLListBase, entry > &) |
Public Member Functions inherited from UILList< DLListBase, entry > | |
| UILList () | |
| Null construct. | |
| UILList (entry *a) | |
| Construct given initial T. | |
| UILList (const UILList< DLListBase, entry > &) | |
| Construct as copy. | |
| entry * | first () |
| Return the first entry. | |
| const entry * | first () const |
| Return the first entry. | |
| entry * | last () |
| Return the last entry. | |
| const entry * | last () const |
| Return the last entry. | |
| entry * | removeHead () |
| Remove and return head. | |
| entry * | remove (entry *p) |
| Remove and return element. | |
| entry * | remove (iterator &it) |
| Remove and return specified by iterator. | |
| void | operator= (const UILList< DLListBase, entry > &) |
| bool | operator== (const UILList< DLListBase, entry > &) const |
| Equality operation on ULists of the same type. | |
| bool | operator!= (const UILList< DLListBase, entry > &) const |
| The opposite of the equality operation. Takes linear time. | |
Public Member Functions inherited from DLListBase | |
| DLListBase () | |
| Null construct. | |
| DLListBase (link *) | |
| Construct given initial entry. | |
| ~DLListBase () | |
| label | size () const |
| Return number of elements in list. | |
| bool | empty () const |
| Return true if the list is empty. | |
| void | insert (link *) |
| Add at head of list. | |
| void | append (link *) |
| Add at tail of list. | |
| bool | swapUp (link *) |
| Swap this element with the one above unless it is at the top. | |
| bool | swapDown (link *) |
| Swap this element with the one below unless it is at the bottom. | |
| link * | remove (link *) |
| Remove and return element. | |
| link * | replace (link *oldLink, link *newLink) |
| Replace oldLink with newLink and return element. | |
| link * | replace (iterator &oldIter, link *newLink) |
| Replace oldIter with newLink and return element. | |
| void | transfer (DLListBase &) |
| Transfer the contents of the argument into this List. | |
| iterator | begin () |
| const iterator & | end () |
| const_iterator | cbegin () const |
| const const_iterator & | cend () const |
| const_iterator | begin () const |
| const const_iterator & | end () const |
Friends | |
| Ostream & | operator<< (Ostream &, const dictionaryEntry &) |
Additional Inherited Members | |
Static Public Member Functions inherited from entry | |
| static bool | New (dictionary &parentDict, Istream &) |
| Construct from Istream and insert into dictionary. | |
| static autoPtr< entry > | New (Istream &is) |
| Construct on freestore from Istream and return. | |
Static Public Member Functions inherited from dictionary | |
| static autoPtr< dictionary > | New (Istream &) |
| Construct top-level dictionary on freestore from Istream. | |
Static Public Attributes inherited from dictionary | |
| static const dictionary | null |
| Null dictionary. | |
| dictionaryEntry | ( | const dictionary & | parentDict, |
| Istream & | is | ||
| ) |
Construct from the parent dictionary and Istream.
Definition at line 36 of file dictionaryEntryIO.C.
References IOstream::fatalCheck().
| dictionaryEntry | ( | const keyType & | key, |
| const dictionary & | parentDict, | ||
| Istream & | is | ||
| ) |
Construct from the keyword, parent dictionary and a Istream.
Definition at line 53 of file dictionaryEntryIO.C.
References IOstream::fatalCheck().
| dictionaryEntry | ( | const keyType & | key, |
| const dictionary & | parentDict, | ||
| const dictionary & | dict | ||
| ) |
Construct from the keyword, parent dictionary and a dictionary.
Definition at line 31 of file dictionaryEntry.C.
| dictionaryEntry | ( | const dictionary & | parentDict, |
| const dictionaryEntry & | dictEnt | ||
| ) |
Construct as copy for the given parentDict.
Definition at line 43 of file dictionaryEntry.C.
|
inlinevirtual |
Construct on freestore as copy with reference to the.
dictionary the copy belongs to
Implements entry.
Definition at line 101 of file dictionaryEntry.H.
|
inlinevirtual |
Return the dictionary name.
Implements entry.
Definition at line 110 of file dictionaryEntry.H.
Referenced by dictionaryEntry::name().
|
inlinevirtual |
Return the dictionary name.
Implements entry.
Definition at line 116 of file dictionaryEntry.H.
References dictionaryEntry::name().
| Foam::label startLineNumber | ( | ) | const |
Return line number of first token in dictionary.
Reimplemented from dictionary.
Definition at line 55 of file dictionaryEntry.C.
References UILList< DLListBase, entry >::first(), DLListBase::size(), and entry::startLineNumber().
| Foam::label endLineNumber | ( | ) | const |
Return line number of last token in dictionary.
Reimplemented from dictionary.
Definition at line 67 of file dictionaryEntry.C.
|
virtual |
This entry is not a primitive,.
calling this function generates a FatalError
Implements entry.
Definition at line 80 of file dictionaryEntry.C.
References Foam::abort(), Foam::FatalIOError, and FatalIOErrorIn.
|
inlinevirtual |
Return true because this entry is a dictionary.
Reimplemented from entry.
Definition at line 132 of file dictionaryEntry.H.
|
virtual |
|
virtual |
Return non-const access to dictionary.
Implements entry.
Definition at line 96 of file dictionaryEntry.C.
|
virtual |
Write.
Implements entry.
Definition at line 72 of file dictionaryEntryIO.C.
References Ostream::indent(), entry::keyword(), and Ostream::write().
|
inline |
Return info proxy.
Used to print token information to a stream
Definition at line 148 of file dictionaryEntry.H.
|
friend |