Go to the documentation of this file.
113 #define Foam_argList_1712
129 static bool argsMandatory_;
132 static bool checkProcessorDirectories_;
159 static word optionCompat(
const word& optName);
162 static int optionIgnore(
const word& optName);
167 static void checkITstream(
const ITstream& is,
const label index);
172 static void checkITstream(
const ITstream& is,
const word& optName);
180 void raiseBadInput(
const word& optName)
const;
196 bool regroupArgv(
int& argc,
char**& argv);
199 void printManCompat()
const;
246 struct initValidTables
266 bool checkOpts =
true,
267 bool initialise =
true
275 bool checkArgs =
true,
276 bool checkOpts =
true,
277 bool initialise =
true
317 const bool caseTag =
false
325 void parse(
bool checkArgs,
bool checkOpts,
bool initialise);
363 const
bool caseTag = false
374 inline
int dryRun() const noexcept;
377 inline
int dryRun(const
int level) noexcept;
380 inline
int verbose() const noexcept;
383 inline
int verbose(const
int level) noexcept;
390 inline label
size() const noexcept;
405 inline
bool found(const
word& optName) const;
411 label
count(std::initializer_list<
word> optionNames) const;
420 inline
T get(const label index) const;
430 template<class
T=
string>
431 inline
T get(const
word& optName) const;
476 template<class
T, class Predicate>
481 const Predicate& pred,
482 bool mandatory = true
493 template<class
T, class Predicate>
498 const Predicate& pred
506 template<class
T, class Predicate>
510 const Predicate& pred
520 template<class
T, class Predicate>
525 const Predicate& pred
534 const
string& argName,
535 const
string& usage = ""
542 const
string& usage = "",
543 bool advanced = false
551 const
string& param = "",
552 const
string& usage = "",
553 bool advanced = false
569 std::pair<const
char*,
int> compat
581 std::pair<const
char*,
int> compat,
594 static
void addNote(const
string& note);
617 bool advanced = false
624 bool advanced = false
651 bool setOption(const
word& optName, const
string& param = "");
689 bool checkOpts = true
701 inline const
string& operator[](const label index) const;
704 inline const
string& operator[](const
word& optName) const;
711 template<class
T=
string>
714 return this->get<T>(optName);
720 T opt(
const word& optName,
const T& deflt)
const
722 return this->getOrDefault<T>(optName, deflt);
728 T get(
const word& optName,
const T& deflt)
const
730 return this->getOrDefault<T>(optName, deflt);
738 return this->getOrDefault<T>(optName, deflt);
747 #ifdef Foam_argList_1712
754 T read(const label index)
const
756 return this->get<T>(index);
766 return this->get<T>(index);
774 return found(optName);
791 return get<T>(optName);
805 return readIfPresent<T>(optName, val);
821 return readIfPresent<T>(optName, val, deflt);
835 return getOrDefault<T>(optName, deflt);
844 return this->getList<T>(optName);
static SLList< string > validArgs
label count(const UList< word > &optionNames) const
dlLibraryTable & libs() const noexcept
static std::string::size_type usageMin
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A table of dynamically loaded libraries.
const ParRunControl & parRunControl() const
static void addUsage(const word &optName, const string &usage)
A class for handling words, derived from Foam::string.
static std::string::size_type usageMax
A class for handling file names.
static HashTable< std::pair< word, int > > validOptionsCompat
static fileName envGlobalPath()
T getOrDefault(const word &optName, const T &deflt) const
static HashTable< string > optionUsage
T optionRead(const word &optName) const
const fileName & caseName() const noexcept
static void addNote(const string ¬e)
bool optionFound(const word &optName) const
const fileName & globalCaseName() const noexcept
ITstream optionLookup(const word &optName) const
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Extract command arguments and options from the supplied argc and argv parameters.
bool readListIfPresent(const word &optName, List< T > &list) const
bool optionReadIfPresent(const word &optName, T &val) const
A HashTable with keys but without contents that is similar to std::unordered_set.
T get(const label index) const
bool readIfPresent(const word &optName, T &val) const
static void noMandatoryArgs()
T read(const label index) const
T opt(const word &optName) const
List< T > optionReadList(const word &optName) const
T optionLookupOrDefault(const word &optName, const T &deflt) const
argList(int &argc, char **&argv, bool checkArgs=argList::argsMandatory(), bool checkOpts=true, bool initialise=true)
bool distributed() const noexcept
static void ignoreOptionCompat(std::pair< const char *, int > compat, bool expectArg)
bool readCheck(const word &optName, T &val, const Predicate &pred, bool mandatory=true) const
static void addArgument(const string &argName, const string &usage="")
Template class for non-intrusive linked lists.
static HashTable< string > validParOptions
void parse(bool checkArgs, bool checkOpts, bool initialise)
static void noFunctionObjects(bool addWithOption=false)
ITstream lookup(const word &optName) const
int dryRun() const noexcept
An input stream of tokens.
bool setOption(const word &optName, const string ¶m="")
T get(const word &optName, const T &deflt) const
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static fileName envRelativePath(const fileName &input, const bool caseTag=false)
static word postProcessOptionName
graph_traits< Graph >::vertices_size_type size_type
static void setAdvanced(const word &optName, bool advanced=true)
bool readCheckIfPresent(const word &optName, T &val, const Predicate &pred) const
Lookup type of boundary radiation properties.
static void noCheckProcessorDirectories()
const stringList & args() const noexcept
static HashTable< string > validOptions
T lookupOrDefault(const word &optName, const T &deflt) const
const ParRunControl & runControl() const noexcept
int verbose() const noexcept
static bool postProcess(int argc, char *argv[])
T getCheck(const word &optName, const Predicate &pred) const
const string & commandLine() const noexcept
const HashTable< string > & options() const noexcept
static void addDryRunOption(const string &usage, bool advanced=false)
bool unsetOption(const word &optName)
A HashTable similar to std::unordered_map.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
static word envExecutable()
static HashSet< string > advancedOptions
label size() const noexcept
T opt(const word &optName, const T &deflt) const
static bool argsMandatory()
const word & executable() const noexcept
Non-intrusive singly-linked list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
fileName globalPath() const
static SLList< string > notes
static Istream & input(Istream &is, IntRange< T > &range)
bool checkRootCase() const
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
List< T > getList(const label index) const
Helper class for initializing parallel jobs from the command arguments, storing 'dry-run' state etc....
T argRead(const label index) const
static HashTable< std::pair< bool, int > > ignoreOptionsCompat
static HashTable< string, label, Hash< label > > argUsage
bool check(bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const
static bool bannerEnabled()
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
void printUsage(bool full=true) const
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
void displayDoc(bool source=false) const
static void addVerboseOption(const string &usage, bool advanced=false)
static void removeOption(const word &optName)
bool found(const word &optName) const