mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
and HashTable method names. This improves method name consistency
between classes and also requires less typing effort:
args.found(optName) vs. args.optionFound(optName)
args.readIfPresent(..) vs. args.optionReadIfPresent(..)
...
args.opt<scalar>(optName) vs. args.optionRead<scalar>(optName)
args.read<scalar>(index) vs. args.argRead<scalar>(index)
- the older method names forms have been retained for code compatibility,
but are now deprecated
This commit is contained in:
@ -124,7 +124,7 @@ int main(int argc, char *argv[])
|
||||
Time runTime(args.rootPath(), args.caseName());
|
||||
|
||||
const fileName exportName = args[1];
|
||||
const word importName = args.optionLookupOrDefault<word>("name", "default");
|
||||
const word importName = args.lookupOrDefault<word>("name", "default");
|
||||
|
||||
// check that writing is supported
|
||||
if (!MeshedSurface<face>::canWriteType(exportName.ext(), true))
|
||||
@ -137,11 +137,11 @@ int main(int argc, char *argv[])
|
||||
autoPtr<coordinateSystem> fromCsys;
|
||||
autoPtr<coordinateSystem> toCsys;
|
||||
|
||||
if (args.optionFound("from") || args.optionFound("to"))
|
||||
if (args.found("from") || args.found("to"))
|
||||
{
|
||||
autoPtr<IOobject> ioPtr;
|
||||
|
||||
if (args.optionFound("dict"))
|
||||
if (args.found("dict"))
|
||||
{
|
||||
const fileName dictPath = args["dict"];
|
||||
|
||||
@ -187,7 +187,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
coordinateSystems csLst(ioPtr());
|
||||
|
||||
if (args.optionFound("from"))
|
||||
if (args.found("from"))
|
||||
{
|
||||
const word csName = args["from"];
|
||||
|
||||
@ -203,7 +203,7 @@ int main(int argc, char *argv[])
|
||||
fromCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||
}
|
||||
|
||||
if (args.optionFound("to"))
|
||||
if (args.found("to"))
|
||||
{
|
||||
const word csName = args["to"];
|
||||
|
||||
@ -248,13 +248,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
MeshedSurface<face> surf(smesh);
|
||||
|
||||
if (args.optionFound("clean"))
|
||||
if (args.found("clean"))
|
||||
{
|
||||
surf.cleanup(true);
|
||||
}
|
||||
|
||||
scalar scaleIn = 0;
|
||||
if (args.optionReadIfPresent("scaleIn", scaleIn) && scaleIn > 0)
|
||||
if (args.readIfPresent("scaleIn", scaleIn) && scaleIn > 0)
|
||||
{
|
||||
Info<< " -scaleIn " << scaleIn << endl;
|
||||
surf.scalePoints(scaleIn);
|
||||
@ -275,7 +275,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
scalar scaleOut = 0;
|
||||
if (args.optionReadIfPresent("scaleOut", scaleOut) && scaleOut > 0)
|
||||
if (args.readIfPresent("scaleOut", scaleOut) && scaleOut > 0)
|
||||
{
|
||||
Info<< " -scaleOut " << scaleOut << endl;
|
||||
surf.scalePoints(scaleOut);
|
||||
|
||||
Reference in New Issue
Block a user