34inline void Foam::argList::readList(ITstream& is, List<T>& list)
112 return runControl_.distributed();
118 return runControl_.dryRun();
124 return runControl_.dryRun(level);
130 return runControl_.verbose();
136 return runControl_.verbose(level);
180 return options_.contains(optName);
206 return Foam::readFloat(args_[index]);
211 return Foam::readDouble(args_[index]);
227 return Foam::readFloat(options_[optName]);
232 return Foam::readDouble(options_[optName]);
258 return options_[optName];
264 return options_[optName];
268 inline fileName argList::get<Foam::fileName>(
const word& optName)
const
280 ITstream is(args_[index]);
285 checkITstream(is, index);
299 checkITstream(is, optName);
312 if (options_.contains(optName))
314 return get<T>(optName);
328 if (options_.contains(optName))
330 val = get<T>(optName);
364 checkITstream(is, index);
379 if (mandatory || options_.contains(optName))
385 checkITstream(is, optName);
399 if (options_.contains(optName))
401 ITstream is(options_[optName]);
405 checkITstream(is, optName);
414template<
class T,
class Predicate>
419 const Predicate& pred,
427 raiseBadInput(optName);
435 <<
"Option -" << optName <<
" not specified" <<
nl
443template<
class T,
class Predicate>
448 const Predicate& pred
455template<
class T,
class Predicate>
459 const Predicate& pred
468template<
class T,
class Predicate>
473 const Predicate& pred
479 if (readCheck<T>(optName, val, pred,
false))
498 return options_[optName];
propsDict readIfPresent("fields", acceptFields)
A HashTable similar to std::unordered_map.
An input stream of tokens.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Helper class for initializing parallel jobs from the command arguments, storing 'dry-run' state etc....
T get(const label index) const
Get a value from the argument at index.
int dryRun() const noexcept
Return the dry-run flag.
const stringList & args() const noexcept
Return arguments.
bool distributed() const noexcept
Return distributed flag (i.e. are rootPaths different on different machines).
const string & operator[](const label index) const
The string corresponding to the argument index.
const HashTable< string > & options() const noexcept
Return options.
int verbose() const noexcept
Return the verbose flag.
const ParRunControl & runControl() const noexcept
Return the run control (parallel, dry-run etc).
const fileName & rootPath() const noexcept
Return root path.
bool readCheck(const word &optName, T &val, const Predicate &pred, bool mandatory=true) const
Read the named option and check its validity.
fileName relativePath(const fileName &input, const bool caseTag=false) const
Return the input relative to the globalPath by stripping off a leading value of the globalPath.
bool readListIfPresent(const word &optName, List< T > &list) const
If named option is present, get a List of values treating a single entry like a list of size 1.
label size() const noexcept
The number of arguments.
bool found(const word &optName) const
Return true if the named option is found.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
const fileName & globalCaseName() const noexcept
Return global case name.
fileName path() const
Return the full path to the (processor local) case.
T getCheck(const word &optName, const Predicate &pred) const
Get a value from the named option with additional checking.
ITstream lookup(const word &optName) const
Return an input stream from the named option.
List< T > getList(const label index) const
Get a List of values from the argument at index.
bool readCheckIfPresent(const word &optName, T &val, const Predicate &pred) const
Read the named option if present and check its validity.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
const word & executable() const noexcept
Name of executable without the path.
const string & commandLine() const noexcept
The command line options and arguments concatenated as a string.
T getCheckOrDefault(const word &optName, const T &deflt, const Predicate &pred) const
Get a value from the named option with additional checking (if present), or return default.
dlLibraryTable & libs() const noexcept
Mutable access to the loaded dynamic libraries.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run).
fileName globalPath() const
Return the full path to the global case.
A table of dynamically loaded libraries.
A class for handling file names.
fileName relative(const fileName &parent, const bool caseTag=false) const
Return a relative name by stripping off the parent directory where possible.
static fileName validate(const std::string &, const bool doClean=true)
Construct fileName without invalid characters, possibly applying other transformations such as changi...
A class for handling character strings derived from std::string.
A class for handling words, derived from Foam::string.
List< string > stringList
List of string.
int32_t readInt32(Istream &is)
Read int32_t from stream.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
int64_t readInt64(Istream &is)
Read int64_t from stream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).