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:
@ -78,7 +78,7 @@ void Foam::coordinateSystem::assign(const dictionary& dict)
|
||||
const auto finder = dict.csearchCompat
|
||||
(
|
||||
"rotation", {{"coordinateRotation", -1806}},
|
||||
false, false
|
||||
keyType::LITERAL
|
||||
);
|
||||
|
||||
if (finder.isDict())
|
||||
|
||||
@ -42,7 +42,7 @@ const Foam::dictionary* Foam::coordinateSystem::subDictCompat
|
||||
{
|
||||
// Non-recursive, no pattern matching in the search
|
||||
const auto finder =
|
||||
dictPtr->csearch(coordinateSystem::typeName_(), false, false);
|
||||
dictPtr->csearch(coordinateSystem::typeName_(), keyType::LITERAL);
|
||||
|
||||
if (finder.isDict())
|
||||
{
|
||||
|
||||
@ -100,7 +100,7 @@ Foam::fileName Foam::triSurfaceMesh::checkFile
|
||||
)
|
||||
{
|
||||
fileName fName;
|
||||
if (dict.readIfPresent("file", fName, false, false))
|
||||
if (dict.readIfPresent("file", fName, keyType::LITERAL))
|
||||
{
|
||||
fName = relativeFilePath(io, fName, isGlobal);
|
||||
|
||||
@ -318,7 +318,7 @@ Foam::triSurfaceMesh::triSurfaceMesh
|
||||
outsideVolType_(volumeType::UNKNOWN)
|
||||
{
|
||||
// Reading from supplied file name instead of objectPath/filePath
|
||||
if (dict.readIfPresent("file", fName_, false, false))
|
||||
if (dict.readIfPresent("file", fName_, keyType::LITERAL))
|
||||
{
|
||||
fName_ = relativeFilePath
|
||||
(
|
||||
@ -418,7 +418,7 @@ Foam::triSurfaceMesh::triSurfaceMesh
|
||||
outsideVolType_(volumeType::UNKNOWN)
|
||||
{
|
||||
// Reading from supplied file name instead of objectPath/filePath
|
||||
if (dict.readIfPresent("file", fName_, false, false))
|
||||
if (dict.readIfPresent("file", fName_, keyType::LITERAL))
|
||||
{
|
||||
fName_ = relativeFilePath
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user