ENH: IOobject hasHeaderClassName() method

- simple wrapper for (!headerClassName().empty()) when checking if
  reading was successful.
This commit is contained in:
Mark Olesen
2022-03-08 16:47:35 +01:00
parent 323daeda3c
commit c1eb5413d5
8 changed files with 22 additions and 13 deletions

View File

@ -192,7 +192,7 @@ Foam::label Foam::functionObjects::fvExpressionField::loadFields
const bool ok =
(
io.typeHeaderOk<regIOobject>(false) // Preload header info
&& !io.headerClassName().empty() // Extra safety
&& io.hasHeaderClassName() // Extra safety
&&
(
loadField<scalar>(io)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -104,7 +104,7 @@ bool Foam::functionObjects::readFields::execute()
const bool ok =
(
io.typeHeaderOk<regIOobject>(false) // Preload header info
&& !io.headerClassName().empty() // Extra safety
&& io.hasHeaderClassName() // Extra safety
&&
(
loadField<scalar>(io)