Command Line Arguments. More...
Classes | |
| class | Impl |
Public Member Functions | |
| CommandLineArguments (int *argc, char ***argv) | |
| Create an instance from the arguments (argc,argv). | |
| CommandLineArguments (const StringList &args) | |
| CommandLineArguments (const CommandLineArguments &rhs) | |
| CommandLineArguments & | operator= (const CommandLineArguments &rhs) |
| int * | commandLineArgc () const |
| char *** | commandLineArgv () const |
| void | fillArgs (StringList &args) const |
| Fills args with command line arguments. | |
| String | getParameter (const String ¶m_name) const |
| Retrieves the parameter with name param_name. | |
| void | addParameterLine (const String &line) |
| Adds a parameter. | |
| void | fillParameters (StringList ¶m_names, StringList &values) const |
| Retrieves the list of parameters and their values. | |
| const ParameterList & | parameters () const |
| List of parameters. | |
| ParameterList & | parameters () |
| List of parameters. | |
| bool | needHelp () const |
| Method to determine if the user requested help on the command line. | |
Private Attributes | |
| Arccore::ReferenceCounter< Impl > | m_p |
Command Line Arguments.
This class uses a reference semantics. The commandLineArgc() and commandLineArgv() methods return pointers to internal structures of this class which are allocated only as long as the instance is valid. They can be used for classic C methods that expect pointers to the command line arguments (i.e., the equivalent of the (argc,argv pair of the main() function).
Arguments starting with '-A' are considered as (key,value) parameters type and must be in the form -A,x=y where x is the key and y is the value. It is then possible to retrieve the value of a parameter through its key using the getParameter() method; If a parameter is present multiple times on the command line, the last value is retained.
Definition at line 49 of file arccore/src/common/arccore/common/CommandLineArguments.h.
| Arcane::CommandLineArguments::CommandLineArguments | ( | int * | argc, |
| char *** | argv ) |
Create an instance from the arguments (argc,argv).
Definition at line 195 of file CommandLineArguments.cc.
| Arcane::CommandLineArguments::CommandLineArguments | ( | ) |
Definition at line 205 of file CommandLineArguments.cc.
|
explicit |
Definition at line 215 of file CommandLineArguments.cc.
| Arcane::CommandLineArguments::CommandLineArguments | ( | const CommandLineArguments & | rhs | ) |
Definition at line 225 of file CommandLineArguments.cc.
| Arcane::CommandLineArguments::~CommandLineArguments | ( | ) |
Definition at line 244 of file CommandLineArguments.cc.
| void Arcane::CommandLineArguments::addParameterLine | ( | const String & | line | ) |
Adds a parameter.
Definition at line 292 of file CommandLineArguments.cc.
| int * Arcane::CommandLineArguments::commandLineArgc | ( | ) | const |
Definition at line 252 of file CommandLineArguments.cc.
| char *** Arcane::CommandLineArguments::commandLineArgv | ( | ) | const |
Definition at line 261 of file CommandLineArguments.cc.
| void Arcane::CommandLineArguments::fillArgs | ( | StringList & | args | ) | const |
Fills args with command line arguments.
Definition at line 270 of file CommandLineArguments.cc.
| void Arcane::CommandLineArguments::fillParameters | ( | StringList & | param_names, |
| StringList & | values ) const |
Retrieves the list of parameters and their values.
Returns the list of parameter names in param_names and the associated value in values.
Definition at line 301 of file CommandLineArguments.cc.
Referenced by Arcane::ArccoreApplicationBuildInfo::parseArgumentsAndSetDefaultsValues().
Retrieves the parameter with name param_name.
Returns a null string if there is no parameter with this name.
Definition at line 283 of file CommandLineArguments.cc.
Referenced by Arcane::ArcaneLauncher::init().
| bool Arcane::CommandLineArguments::needHelp | ( | ) | const |
Method to determine if the user requested help on the command line.
Definition at line 319 of file CommandLineArguments.cc.
Referenced by Arcane::ArcaneLauncher::needHelp(), and parameters().
| CommandLineArguments & Arcane::CommandLineArguments::operator= | ( | const CommandLineArguments & | rhs | ) |
Definition at line 234 of file CommandLineArguments.cc.
| const ParameterList & Arcane::CommandLineArguments::parameters | ( | ) | const |
List of parameters.
Definition at line 310 of file CommandLineArguments.cc.
Referenced by Arcane::ArcaneLauncher::init().
|
private |
Definition at line 106 of file arccore/src/common/arccore/common/CommandLineArguments.h.