mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add dictionary optionalSubDict() method as per .org change (20-Apr)
This commit is contained in:
@ -743,6 +743,24 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::dictionary& Foam::dictionary::optionalSubDict
|
||||||
|
(
|
||||||
|
const word& keyword
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const entry* entryPtr = lookupEntryPtr(keyword, false, true);
|
||||||
|
|
||||||
|
if (entryPtr)
|
||||||
|
{
|
||||||
|
return entryPtr->dict();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::wordList Foam::dictionary::toc() const
|
Foam::wordList Foam::dictionary::toc() const
|
||||||
{
|
{
|
||||||
wordList keys(size());
|
wordList keys(size());
|
||||||
|
|||||||
@ -436,6 +436,10 @@ public:
|
|||||||
const bool mustRead = false
|
const bool mustRead = false
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Find and return a sub-dictionary if found
|
||||||
|
// otherwise return this dictionary
|
||||||
|
const dictionary& optionalSubDict(const word& keyword) const;
|
||||||
|
|
||||||
//- Return the table of contents
|
//- Return the table of contents
|
||||||
wordList toc() const;
|
wordList toc() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user