mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: rationalize dictionary access methods
- use keyType::option enum to consolidate searching options.
These enumeration names should be more intuitive to use
and improve code readability.
Eg, lookupEntry(key, keyType::REGEX);
vs lookupEntry(key, false, true);
or
Eg, lookupEntry(key, keyType::LITERAL_RECURSIVE);
vs lookupEntry(key, true, false);
- new findEntry(), findDict(), findScoped() methods with consolidated
search options for shorter naming and access names more closely
aligned with other components. Behave simliarly to the
methods lookupEntryPtr(), subDictPtr(), lookupScopedEntryPtr(),
respectively. Default search parameters consistent with lookupEntry().
Eg, const entry* e = dict.findEntry(key);
vs const entry* e = dict.lookupEntryPtr(key, false, true);
- added '*' and '->' dereference operators to dictionary searchers.
This commit is contained in:
@ -55,14 +55,14 @@ static inline void writeEntryIfPresent
|
||||
)
|
||||
{
|
||||
// non-recursive like dictionary::found, but no pattern-match either
|
||||
const entry* ptr = dict.lookupEntryPtr(key, false, false);
|
||||
const entry* eptr = dict.findEntry(key, keyType::LITERAL);
|
||||
|
||||
if (ptr)
|
||||
if (eptr)
|
||||
{
|
||||
os.writeKeyword(key)
|
||||
<< token::HASH << token::BEGIN_BLOCK;
|
||||
|
||||
os.writeQuoted(string(ptr->stream()), false)
|
||||
os.writeQuoted(string(eptr->stream()), false)
|
||||
<< token::HASH << token::END_BLOCK
|
||||
<< token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user