openfoam/applications/test/List
Mark Olesen 724b034cc7 argList enhancement: added convenience methods for accessing options
Oriented somewhat on dictionary methods.

Return the argument string associated with the named option:
    Info<< "-foo: " << args.option("foo") << nl;

Return true if the named option is found
    if (args.optionFound("foo")) ...

Return an IStringStream to the named option
    old:      value = readScalar(IStringStream(args.options()["foo"])());
    newer:    value = readScalar(args.optionLookup("foo")());
    also:     List<scalar> lst(args.optionLookup("foo")());

Read a value from the named option
    newest:   value = args.optionRead<scalar>("foo");

Read a value from the named option if present.
    old:  if (args.options().found("foo"))
          {
              value = readScalar(IStringStream(args.options()["foo"])());
          }
    new:  args.optionReadIfPresent("foo", value);

Read a List of values from the named option
    patches = args.optionReadList<word>("patches");

Didn't bother adding optionReadListIfPresent<T>(const word&), since it
probably wouldn't be common anyhow.
2009-05-19 18:19:49 +02:00
..
Make Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00
ListLoop.C Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00
ListTest.C argList enhancement: added convenience methods for accessing options 2009-05-19 18:19:49 +02:00