|
Public Types |
typedef std::multimap< std::string,
std::string > | ParamsList |
| Multimap type used to store parameters.
|
typedef std::map< std::string,
std::string > | VarsList |
| Map type used to store environment variables.
|
Public Member Functions |
| CmdLineParser () |
| Default constructor.
|
| CmdLineParser (int argc, char const *const *argv, char const *const *envp=NULL) |
| Constructor setting argc, argv and envp.
|
| CmdLineParser (CmdLineParser const &clp) |
| Copy constructor.
|
virtual | ~CmdLineParser () |
| Destructor.
|
virtual bool | parse () |
| Parses the command-line parameters and environment variables.
|
int | argc () const |
| Returns the number of parameters in the argv() array.
|
char const *const * | argv () const |
| Returns the raw parameters list.
|
char const *const * | envp () const |
| Returns the array of environment variables.
|
std::string const & | error () const |
| Returns a description of the error that occured.
|
char const * | c_error () const |
| Same as error() but returns a char const *.
|
std::string const | program () const |
| Returns the program path.
|
char const * | c_program () const |
| Same as program() but returns a char const *.
|
std::string const & | progname () const |
| Returns the program name.
|
char const * | c_progname () const |
| Same as progname() but returns a char const *.
|
ParamsList const & | params () const |
| Returns the multimap of parameters.
|
VarsList const & | vars () const |
| Returns the map of environment variables.
|
Protected Member Functions |
virtual bool | eval () |
| Processes the command line parameters and environment variables.
|
Protected Attributes |
std::string | m_error |
| Last error.
|
std::string | m_progname |
| Program name.
|
ParamsList | m_params |
| Parameters list.
|
VarsList | m_vars |
| Variables list.
|