A keyword and a list of tokens is an 'entry'. More...
Public Member Functions | |
entry (const keyType &) | |
Construct from keyword. More... | |
entry (const entry &) | |
Construct as copy. More... | |
virtual autoPtr< entry > | clone (const dictionary &parentDict) const =0 |
Construct on freestore as copy with reference to the. More... | |
virtual autoPtr< entry > | clone () const |
Construct on freestore as copy. More... | |
virtual | ~entry () |
Destructor. More... | |
const keyType & | keyword () const |
Return keyword. More... | |
keyType & | keyword () |
Return non-const access to keyword. More... | |
virtual const fileName & | name () const =0 |
Return the dictionary name. More... | |
virtual fileName & | name ()=0 |
Return the dictionary name. More... | |
virtual label | startLineNumber () const =0 |
Return line number of first token in dictionary. More... | |
virtual label | endLineNumber () const =0 |
Return line number of last token in dictionary. More... | |
virtual bool | isStream () const |
Return true if this entry is a stream. More... | |
virtual ITstream & | stream () const =0 |
Return token stream if this entry is a primitive entry. More... | |
virtual bool | isDict () const |
Return true if this entry is a dictionary. More... | |
virtual const dictionary & | dict () const =0 |
Return dictionary if this entry is a dictionary. More... | |
virtual dictionary & | dict ()=0 |
Return non-const access to dictionary if this entry is a dictionary. More... | |
virtual void | write (Ostream &) const =0 |
Write. More... | |
void | operator= (const entry &) |
bool | operator== (const entry &) const |
bool | operator!= (const entry &) const |
Static Public Member Functions | |
static bool | New (dictionary &parentDict, Istream &) |
Construct from Istream and insert into dictionary. More... | |
static autoPtr< entry > | New (Istream &is) |
Construct on freestore from Istream and return. More... | |
Static Public Attributes | |
static int | disableFunctionEntries |
Static Private Member Functions | |
static bool | getKeyword (keyType &, Istream &) |
Get the next valid keyword otherwise return false. More... | |
Private Attributes | |
keyType | keyword_ |
Keyword of entry. More... | |
Friends | |
Ostream & | operator<< (Ostream &, const entry &) |
A keyword and a list of tokens is an 'entry'.
An entry can be read, written and printed, and the types and values of its tokens analysed. An entry 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.
Get the next valid keyword otherwise return false.
Definition at line 37 of file entryIO.C.
References IOstream::bad(), token::END_BLOCK, token::END_STATEMENT, Foam::endl(), IOstream::eof(), token::good(), token::isString(), token::isWord(), entry::keyword(), IOstream::name(), Istream::read(), token::stringToken(), and token::wordToken().
|
pure virtual |
Construct on freestore as copy with reference to the.
dictionary the copy belongs to
Implemented in dictionaryEntry, and primitiveEntry.
Referenced by addEntry(), renameBoundaryPatches::calculateNewBoundary(), and main().
|
virtual |
Construct on freestore as copy.
Note: the parent directory is set to dictionary::null
Definition at line 54 of file entry.C.
References dictionary::null.
|
static |
Construct from Istream and insert into dictionary.
Definition at line 91 of file entryIO.C.
References dictionary::add(), token::BEGIN_BLOCK, dictionary::clear(), entry::dict(), inputModeEntry::error(), functionEntry::execute(), includeEntry::execute(), Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::stringOps::inplaceExpand(), entry::isDict(), dictionary::lookupEntryPtr(), dictionary::lookupScopedEntryPtr(), inputModeEntry::merge(), inputModeEntry::overwrite(), inputModeEntry::protect(), Istream::putBack(), s(), entry::stream(), and dictionary::substituteScopedKeyword().
Referenced by dictionary::read().
|
static |
Construct on freestore from Istream and return.
Definition at line 256 of file entryIO.C.
References token::BEGIN_BLOCK, IOstream::fatalCheck(), dictionary::null, and Istream::putBack().
|
inline |
Return keyword.
Definition at line 120 of file entry.H.
References entry::keyword_.
Referenced by dictionary::add(), cellModel::cellModel(), checkMeshDict::checkAnisotropicSources(), checkMeshDict::checkObjectRefinements(), createRefinementSurfaces(), fieldAverageItem::fieldAverageItem(), entry::getKeyword(), merge(), Foam::operator>>(), phaseProperties::phaseProperties(), primitiveEntry::primitiveEntry(), blockMesh::readBoundary(), meshOctreeCreator::refineBoxesContainedInObjects(), refinementSurfaces::refinementSurfaces(), dictionary::set(), shellSurfaces::shellSurfaces(), and dictionaryEntry::write().
|
inline |
Return non-const access to keyword.
Definition at line 126 of file entry.H.
References entry::keyword_.
|
pure virtual |
Return the dictionary name.
Implemented in primitiveEntry, and dictionaryEntry.
Referenced by dictionary::add().
|
pure virtual |
Return the dictionary name.
Implemented in primitiveEntry, and dictionaryEntry.
|
pure virtual |
Return line number of first token in dictionary.
Implemented in primitiveEntry, and dictionaryEntry.
Referenced by dynamicCodeContext::dynamicCodeContext(), and codedFunctionObject::read().
|
pure virtual |
Return line number of last token in dictionary.
Implemented in primitiveEntry, and dictionaryEntry.
|
inlinevirtual |
Return true if this entry is a stream.
Reimplemented in primitiveEntry.
|
pure virtual |
Return token stream if this entry is a primitive entry.
Implemented in primitiveEntry, and dictionaryEntry.
Referenced by coordinateSystem::coordinateSystem(), dynamicCodeContext::dynamicCodeContext(), primitiveEntry::expandVariable(), dictionary::lookupOrAddDefault(), dictionary::lookupOrDefault(), entry::New(), functionObjectList::read(), codedFunctionObject::read(), dictionary::readIfPresent(), and solution::upgradeSolverDict().
|
inlinevirtual |
Return true if this entry is a dictionary.
Reimplemented in dictionaryEntry.
Definition at line 153 of file entry.H.
Referenced by dictionary::add(), addEntry(), checkDictionaryContent(), coordinateSystem::coordinateSystem(), primitiveEntry::expandVariable(), Foam::stringOps::inplaceExpand(), dictionary::isDict(), dictionary::lookupScopedEntryPtr(), entry::New(), functionObjectList::read(), blockMesh::readBoundary(), dictionary::set(), Foam::debug::switchSet(), and solution::upgradeSolverDict().
|
pure virtual |
Return dictionary if this entry is a dictionary.
Implemented in primitiveEntry, and dictionaryEntry.
Referenced by dictionary::add(), addEntry(), checkMeshDict::checkAnisotropicSources(), checkDictionaryContent(), checkMeshDict::checkObjectRefinements(), createRefinementSurfaces(), primitiveEntry::expandVariable(), Foam::stringOps::inplaceExpand(), dictionary::lookupScopedEntryPtr(), entry::New(), derivedFieldWriter::read(), functionObjectList::read(), blockMesh::readBoundary(), meshOctreeCreator::refineBoxesContainedInObjects(), refinementSurfaces::refinementSurfaces(), dictionary::set(), shellSurfaces::shellSurfaces(), dictionary::subDict(), dictionary::subDictPtr(), dictionary::subOrEmptyDict(), dictionary::substituteKeyword(), dictionary::substituteScopedKeyword(), and Foam::debug::switchSet().
|
pure virtual |
Return non-const access to dictionary if this entry is a dictionary.
Implemented in primitiveEntry, and dictionaryEntry.
|
pure virtual |
Write.
Implemented in primitiveEntry, and dictionaryEntry.
void operator= | ( | const entry & | e | ) |
Definition at line 62 of file entry.C.
References Foam::abort(), Foam::e, Foam::FatalError, and FatalErrorInFunction.
bool operator== | ( | const entry & | e | ) | const |
Definition at line 76 of file entry.C.
References Foam::e, and OStringStream::str().
bool operator!= | ( | const entry & | e | ) | const |
Definition at line 95 of file entry.C.
References Foam::e, and Foam::operator==().
|
private |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.