Go to the documentation of this file.
34 inline void Foam::argList::readList(ITstream& is, List<T>& list)
83 return rootPath()/caseName();
89 return rootPath()/globalCaseName();
99 return input.relative(globalPath(), caseTag);
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_.found(optName);
194 template<>
inline int32_t argList::get<int32_t>(
const label index)
const
199 template<>
inline int64_t argList::get<int64_t>(
const label index)
const
204 template<>
inline float argList::get<float>(
const label index)
const
206 return Foam::readFloat(args_[index]);
209 template<>
inline double argList::get<double>(
const label index)
const
211 return Foam::readDouble(args_[index]);
215 template<>
inline int32_t argList::get<int32_t>(
const word& optName)
const
220 template<>
inline int64_t argList::get<int64_t>(
const word& optName)
const
225 template<>
inline float argList::get<float>(
const word& optName)
const
227 return Foam::readFloat(options_[optName]);
230 template<>
inline double argList::get<double>(
const word& optName)
const
232 return Foam::readDouble(options_[optName]);
237 inline string argList::get<Foam::string>(
const label index)
const
243 inline word argList::get<Foam::word>(
const label index)
const
249 inline fileName argList::get<Foam::fileName>(
const label index)
const
256 inline string argList::get<Foam::string>(
const word& optName)
const
258 return options_[optName];
262 inline word argList::get<Foam::word>(
const word& optName)
const
264 return options_[optName];
268 inline fileName argList::get<Foam::fileName>(
const word& optName)
const
285 checkITstream(is, index);
299 checkITstream(is, optName);
314 return get<T>(optName);
330 val = get<T>(optName);
346 if (readIfPresent<T>(optName, val))
364 checkITstream(is, index);
379 if (mandatory ||
found(optName))
385 checkITstream(is, optName);
405 checkITstream(is, optName);
414 template<
class T,
class Predicate>
419 const Predicate& pred,
423 if (readIfPresent<T>(optName, val))
427 raiseBadInput(optName);
435 <<
"Option -" << optName <<
" not specified" <<
nl
443 template<
class T,
class Predicate>
448 const Predicate& pred
451 return readCheck<T>(optName, val, pred,
false);
455 template<
class T,
class Predicate>
459 const Predicate& pred
463 readCheck<T>(optName, val, pred,
true);
468 template<
class T,
class Predicate>
473 const Predicate& pred
479 if (readCheck<T>(optName, val, pred,
false))
498 return options_[optName];
dlLibraryTable & libs() const noexcept
Mutable access to the loaded dynamic libraries.
A table of dynamically loaded libraries.
A class for handling words, derived from Foam::string.
A class for handling file names.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
const fileName & globalCaseName() const noexcept
Return global case name.
bool readListIfPresent(const word &optName, List< T > &list) const
A class for handling character strings derived from std::string.
T get(const label index) const
Get a value from the argument at index.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
bool distributed() const noexcept
bool readCheck(const word &optName, T &val, const Predicate &pred, bool mandatory=true) const
Read the named option and check its validity.
const stringList & args() const noexcept
Return arguments.
ITstream lookup(const word &optName) const
Return an input stream from the named option.
int dryRun() const noexcept
Return the dry-run flag.
const HashTable< string > & options() const noexcept
Return options.
An input stream of tokens.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool readCheckIfPresent(const word &optName, T &val, const Predicate &pred) const
Read the named option if present and check its validity.
fileName path() const
Return the full path to the (processor local) case.
const ParRunControl & runControl() const noexcept
Return the run control (parallel, dry-run etc)
int verbose() const noexcept
Return the verbose flag.
int32_t readInt32(Istream &is)
Read int32_t from stream.
static fileName validate(const std::string &, const bool doClean=true)
T getCheck(const word &optName, const Predicate &pred) const
Get a value from the named option with additional checking.
const string & commandLine() const noexcept
The command line options and arguments concatenated as a string.
errorManipArg< error, int > exit(error &err, const int errNo=1)
label size() const noexcept
The number of arguments.
const word & executable() const noexcept
Name of executable without the path.
fileName globalPath() const
Return the full path to the global case.
static Istream & input(Istream &is, IntRange< T > &range)
List< T > getList(const label index) const
Get a List of values from the argument at index.
Helper class for initializing parallel jobs from the command arguments, storing 'dry-run' state etc....
const string & operator[](const label index) const
The string corresponding to the argument index.
T getCheckOrDefault(const word &optName, const T &deflt, const Predicate &pred) const
fileName relativePath(const fileName &input, const bool caseTag=false) const
const fileName & rootPath() const noexcept
Return root path.
bool found(const word &optName) const
Return true if the named option is found.
int64_t readInt64(Istream &is)
Read int64_t from stream.