ENH: minor improvements for Enum

- found() method for consistency with other classes

- operator()(name, deflt) for similarity to lookupOrDefault,
  but without a dictionary
This commit is contained in:
Mark Olesen
2017-11-28 09:15:04 +01:00
parent b53e5b7404
commit c0e86940b0
10 changed files with 78 additions and 31 deletions

View File

@ -377,7 +377,7 @@ bool Foam::fileFormats::FIREMeshReader::readGeometry(const scalar scaleFactor)
IOstream::streamFormat fmt = IOstream::ASCII;
const word ext = geometryFile_.ext();
bool supported = FIRECore::file3dExtensions.hasEnum(ext);
bool supported = FIRECore::file3dExtensions.found(ext);
if (supported)
{
FIRECore::fileExt3d fireFileType = FIRECore::file3dExtensions[ext];

View File

@ -278,7 +278,7 @@ bool Foam::fileFormats::FIREMeshWriter::write(const fileName& meshName) const
{
const word ext = baseName.ext();
if (FIRECore::file3dExtensions.hasEnum(ext))
if (FIRECore::file3dExtensions.found(ext))
{
FIRECore::fileExt3d fireFileType = FIRECore::file3dExtensions[ext];
if (fireFileType == FIRECore::fileExt3d::POLY_ASCII)