Go to the documentation of this file.
122 const label location,
165 class initValidTables
182 bool checkArgs =
true,
183 bool checkOpts =
true,
184 bool initialise =
true
192 bool checkArgs =
true,
193 bool checkOpts =
true,
194 bool initialise =
true
240 inline const string&
arg(
const label index)
const;
266 inline const string&
option(
const word& opt)
const;
327 const string& usage =
""
335 const string& param =
"",
336 const string& usage =
""
348 static void addNote(
const string&);
389 bool check(
bool checkArgs=
true,
bool checkOpts=
true)
const;
static SLList< string > validArgs
A list of valid (mandatory) arguments.
HashTable< string > options_
static void noBanner()
Disable emitting the banner information.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling words, derived from string.
const stringList & args() const
Return arguments.
A class for handling file names.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
Non-intrusive singly-linked list.
bool regroupArgv(int &argc, char **&argv)
Transcribe argv into internal args_.
static string::size_type usageMin
Min offset for displaying usage (default: 20)
label size() const
Return the number of arguments.
static HashTable< string > optionUsage
Short usage information for validOptions.
A List obtained as a section of another List.
const string & arg(const label index) const
Return the argument corresponding to index.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static bool bannerEnabled
Extract command arguments and options from the supplied argc and argv parameters.
const fileName & rootPath() const
Return root path.
const ParRunControl & parRunControl() const
Return parRunControl.
static void addUsage(const word &opt, const string &usage)
Add option usage information to optionUsage.
static HashTable< string > validParOptions
A list of valid parallel options.
List< T > optionReadList(const word &opt) const
Read a List of values from the named option.
void printNotes() const
Print notes (if any)
void parse(bool checkArgs, bool checkOpts, bool initialise)
Parse.
const Foam::HashTable< string > & options() const
Return options.
const word & executable() const
Name of executable without the path.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool setOption(const word &opt, const string ¶m="")
Set option directly (use with caution)
void getRootCase()
Get rootPath_ / globalCase_ from one of the following forms.
void printUsage() const
Print usage.
graph_traits< Graph >::vertices_size_type size_type
static void printOptionUsage(const label location, const string &str)
Helper function for printUsage.
const string & option(const word &opt) const
Return the argument string associated with the named option.
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
fileName path() const
Return the path to the caseName.
SubList< T > subList
Declare type of subList.
static HashTable< string > validOptions
A list of valid options.
Input from memory buffer stream.
An STL-conforming hash table.
bool unsetOption(const word &opt)
Unset option directly (use with caution)
ParRunControl parRunControl_
Switch on/off parallel mode. Has to be first to be constructed.
static string::size_type usageMax
Max screen width for displaying usage (default: 80)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T optionRead(const word &opt) const
Read a value from the named option.
static SLList< string > notes
Additional notes for usage.
bool checkRootCase() const
Check root path and case path.
static void removeOption(const word &opt)
Remove option from validOptions and from optionUsage.
bool optionFound(const word &opt) const
Return true if the named option is found.
Helper class for initializing parallel jobs from the command arguments.
stringList::subList additionalArgs() const
Return arguments that are additional to the executable.
T argRead(const label index) const
Read a value from the argument at index.
const fileName & caseName() const
Return case name (parallel run) or global case (serial run)
void size(const label)
Override size to be inconsistent with allocated storage.
static void noParallel()
Remove the parallel options.
const string & operator[](const label index) const
Return the argument corresponding to index.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
const fileName & globalCaseName() const
Return case name.
virtual ~argList()
Destructor.
bool check(bool checkArgs=true, bool checkOpts=true) const
Check argument list.
void displayDoc(bool source=false) const
Display documentation in browser.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
argList(int &argc, char **&argv, bool checkArgs=true, bool checkOpts=true, bool initialise=true)
Construct from argc and argv.