- instead of dict.lookup(name) >> val;
can use dict.readEntry(name, val);
for checking of input token sizes.
This helps catch certain types of input errors:
{
key1 ; // <- Missing value
key2 1234 // <- Missing ';' terminator
key3 val;
}
STYLE: readIfPresent() instead of 'if found ...' in a few more places.
This commit is contained in:
@ -50,7 +50,7 @@ Foam::functionObjects::fieldSelection::~fieldSelection()
|
||||
|
||||
bool Foam::functionObjects::fieldSelection::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("fields") >> *this;
|
||||
dict.readEntry("fields", *this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ bool Foam::functionObjects::volRegion::read
|
||||
{
|
||||
case vrtCellZone:
|
||||
{
|
||||
dict.lookup("name") >> regionName_;
|
||||
dict.readEntry("name", regionName_);
|
||||
|
||||
regionID_ = mesh_.cellZones().findZoneID(regionName_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user