Command class.
More...
#include <CmdLine.hpp>
List of all members.
Public Member Functions |
|
| Command () |
| | Default constructor.
|
| template<typename T > |
| void | addOptionVar (const z::string &sname, const z::string &lname, const z::string &desc, T &val) |
| | Add command line option variable.
|
| template<typename ObjT , typename T > |
| void | addOptionCall (const z::string &sname, const z::string &lname, const z::string &desc, ObjT &(ObjT::*fn)(const T &val), ObjT &obj) |
| | Add command line option function.
|
| template<typename T > |
| void | addParameterVar (const z::string &desc, T &val) |
| | Add command line parameter variable.
|
| void | addParameterListVar (const z::string &desc, z::stringlist &list) |
| | Add command line option list parameter.
|
| template<typename ObjT > |
| void | addParameterListCall (const z::string &desc, ObjT &(ObjT::*fn)(const z::string &val), ObjT &obj) |
| | Add command line parameter function.
|
Public Attributes |
|
OptList_t | _optList |
| | Options list.
|
|
z::string | _key |
| | command key
|
|
z::string | _desc |
| | command description
|
|
int | _value |
| | command value
|
|
Map_t | _map |
| | Options.
|
|
List_t | _list |
| | Parameters.
|
|
OptionBase * | _posArg |
| | Positional argument (parameters at end of list)
|
Private Member Functions |
| template<typename T > |
| OptionBase & | createVar (const z::string &sname, const z::string &lname, const z::string &desc, T &val) |
| | Add command line variable.
|
| template<typename ObjT , typename T > |
| OptionBase & | createCall (const z::string &sname, const z::string &lname, const z::string &desc, ObjT &(ObjT::*fn)(const T &val), ObjT &obj) |
| | Add command line function.
|
Detailed Description
Member Function Documentation
| void addOptionCall |
( |
const z::string & |
sname, |
|
|
const z::string & |
lname, |
|
|
const z::string & |
desc, |
|
|
ObjT &(ObjT::*)(const T &val) |
fn, |
|
|
ObjT & |
obj |
|
) |
| [inline] |
Add command line option function.
- Parameters:
-
| sname | Short name of option |
| lname | Long name of option |
| desc | Description of option |
| fn | Function to call for this option |
| obj | Object on which to call this function |
Add command line option variable.
- Parameters:
-
| sname | Short name of option |
| lname | Long name of option |
| desc | Description of option |
| val | Reference to variable to be set |
| void addParameterListCall |
( |
const z::string & |
desc, |
|
|
ObjT &(ObjT::*)(const z::string &val) |
fn, |
|
|
ObjT & |
obj |
|
) |
| [inline] |
Add command line parameter function.
- Parameters:
-
| desc | Description of option |
| fn | Function to call for this option |
| obj | Object on which to call this function |
Add command line option list parameter.
- Parameters:
-
| desc | Description of option |
| list | Reference to variable to be set |
| void addParameterVar |
( |
const z::string & |
desc, |
|
|
T & |
val |
|
) |
| [inline] |
Add command line parameter variable.
- Parameters:
-
| desc | Description of option |
| val | Reference to variable to be set |
Add command line function.
- Parameters:
-
| sname | Short name of option |
| lname | Long name of option |
| desc | Description of option |
| fn | Function to call for this option |
| obj | Object on which to call this function |
- Returns:
- Newly added option
Add command line variable.
- Parameters:
-
| sname | Short name of option |
| lname | Long name of option |
| desc | Description of option |
| val | Reference to variable to be set |
- Returns:
- Newly added option
The documentation for this class was generated from the following file:
- /home/renji/Data/projects/zenlang/sources/zbl/CmdLine.hpp