class used to parser command line arguments
More...
#include </home/runner/work/tfel/tfel/include/TFEL/Utilities/ArgumentParser.hxx>
|
| struct | CallBack |
| | structure describing an action to be performed when a argument is treated More...
|
|
|
using | CallBacksContainer = std::map<std::string, CallBack> |
| | a simple alias
|
|
|
using | AliasContainer = std::map<std::string, std::string> |
| | a simple alias
|
|
using | ArgsContainer = std::vector<Argument> |
| | a simple alias
|
|
|
CallBacksContainer | callBacksContainer |
| | container of all the call-backs
|
|
AliasContainer | alias |
| | container of all the alias
|
|
ArgsContainer | args |
| | container of all the command line arguments
|
|
ArgsContainer::iterator | currentArgument |
| | an iterator to the argument being treated
|
|
std::string | programName |
| | program name
|
class used to parser command line arguments
◆ ArgumentParser()
| tfel::utilities::ArgumentParser::ArgumentParser |
( |
const int | , |
|
|
const char *const * const | ) |
constructor
- Parameters
-
| argc | : number of arguments given at command line |
| argv | : arguments list |
◆ getRegistredCallBacks()
| const CallBacksContainer & tfel::utilities::ArgumentParser::getRegistredCallBacks |
( |
| ) |
const |
|
nodiscard |
- Returns
- the list of registred callbacks
◆ getUsageDescription()
| virtual std::string tfel::utilities::ArgumentParser::getUsageDescription |
( |
| ) |
const |
|
nodiscardprotectedpure virtual |
◆ getVersionDescription()
| virtual std::string tfel::utilities::ArgumentParser::getVersionDescription |
( |
| ) |
const |
|
nodiscardprotectedpure virtual |
◆ registerCallBack() [1/2]
| virtual void tfel::utilities::ArgumentParser::registerCallBack |
( |
const std::string & | , |
|
|
const CallBack & | ) |
|
virtual |
register a new callback
- Parameters
-
| key | : command line argument name |
| f | : callback |
◆ registerCallBack() [2/2]
| virtual void tfel::utilities::ArgumentParser::registerCallBack |
( |
const std::string & | , |
|
|
const std::string & | , |
|
|
const CallBack & | ) |
|
virtual |
register a new callback
- Parameters
-
| key | : command line argument name |
| aliasName | : command line argument alias |
| f | : callback |
◆ setArguments()
| virtual void tfel::utilities::ArgumentParser::setArguments |
( |
const int | , |
|
|
const char *const * const | ) |
|
virtual |
set the arguments to be parsed
- Parameters
-
| argc | : number of arguments given at command line |
| argv | : arguments list |
◆ treatHelp()
| virtual void tfel::utilities::ArgumentParser::treatHelp |
( |
| ) |
|
|
protectedvirtual |
method associated with the '–help' command line argument.
This method uses the getUsageDescription() method to get a more helpfull message.
This method stops the execution by calling the exit method.
◆ treatUnknownArgument()
| virtual void tfel::utilities::ArgumentParser::treatUnknownArgument |
( |
| ) |
|
|
protectedvirtual |
The documentation for this struct was generated from the following file: