Zen
A cross-platform functional programming language

CmdLine::Command Class Reference

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 >
OptionBasecreateVar (const z::string &sname, const z::string &lname, const z::string &desc, T &val)
 Add command line variable.
template<typename ObjT , typename T >
OptionBasecreateCall (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

Command class.


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:
snameShort name of option
lnameLong name of option
descDescription of option
fnFunction to call for this option
objObject on which to call this function
void addOptionVar ( const z::string sname,
const z::string lname,
const z::string desc,
T &  val 
) [inline]

Add command line option variable.

Parameters:
snameShort name of option
lnameLong name of option
descDescription of option
valReference 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:
descDescription of option
fnFunction to call for this option
objObject on which to call this function
void addParameterListVar ( const z::string desc,
z::stringlist list 
) [inline]

Add command line option list parameter.

Parameters:
descDescription of option
listReference to variable to be set
void addParameterVar ( const z::string desc,
T &  val 
) [inline]

Add command line parameter variable.

Parameters:
descDescription of option
valReference to variable to be set
OptionBase & createCall ( const z::string sname,
const z::string lname,
const z::string desc,
ObjT &(ObjT::*)(const T &val)  fn,
ObjT &  obj 
) [inline, private]

Add command line function.

Parameters:
snameShort name of option
lnameLong name of option
descDescription of option
fnFunction to call for this option
objObject on which to call this function
Returns:
Newly added option
OptionBase & createVar ( const z::string sname,
const z::string lname,
const z::string desc,
T &  val 
) [inline, private]

Add command line variable.

Parameters:
snameShort name of option
lnameLong name of option
descDescription of option
valReference to variable to be set
Returns:
Newly added option

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines