ENH: provide operator[] for accessing argList options.

- operator[] with label -> get args at index
- operator[] with word  -> get named option
This commit is contained in:
Mark Olesen
2010-02-17 11:43:42 +01:00
parent b61537bd28
commit 689d4b2860
29 changed files with 155 additions and 149 deletions

View File

@ -232,14 +232,12 @@ void Foam::calcTypes::addSubtract::preCalc
<< exit(FatalError);
}
if (args.optionFound("field"))
if (args.optionReadIfPresent("field", addSubtractFieldName_))
{
addSubtractFieldName_ = args.option("field");
calcType_ = FIELD;
}
else if (args.optionFound("value"))
else if (args.optionReadIfPresent("value", addSubtractValueStr_))
{
addSubtractValueStr_ = args.option("value");
calcType_ = VALUE;
}
else
@ -249,10 +247,7 @@ void Foam::calcTypes::addSubtract::preCalc
<< nl << exit(FatalError);
}
if (args.optionFound("resultName"))
{
resultName_ = args.option("resultName");
}
args.optionReadIfPresent("resultName", resultName_);
}