Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/option/ValueOption.h>
Classes | |
class | Make |
Public Member Functions | |
ValueOption (void) | |
ValueOption (const Make &make) | |
ValueOption (Manager &man, int tag...) | |
ValueOption (Manager &man, int tag, VarArg &args) | |
ValueOption (Manager &man, char s, cstring desc, cstring adesc, const T &val=type_info< T >::null) | |
ValueOption (Manager &man, cstring l, cstring desc, cstring adesc, const T &_val=type_info< T >::null) | |
ValueOption (Manager &man, char s, cstring l, cstring desc, cstring adesc, const T &_val=type_info< T >::null) | |
const T & | get (void) const |
void | set (const T &value) |
operator const T & (void) const | |
ValueOption< T > & | operator= (const T &value) |
const T & | operator* (void) const |
operator bool (void) const | |
virtual void | process (String arg) |
const T & | value (void) const |
template<> | |
ValueOption (Manager &man, char s, cstring desc, cstring adesc, const string &value) | |
template<> | |
ValueOption (Manager &man, cstring l, cstring desc, cstring adesc, const string &val) | |
template<> | |
ValueOption (Manager &man, char s, cstring l, cstring desc, cstring adesc, const string &val) | |
template<> | |
string | get (VarArg &args) |
Public Member Functions inherited from elm::option::AbstractValueOption | |
AbstractValueOption (const Make &make) | |
AbstractValueOption (Manager &man) | |
AbstractValueOption (Manager &man, int tag,...) | |
AbstractValueOption (Manager &man, int tag, VarArg &args) | |
virtual cstring | description (void) |
virtual usage_t | usage (void) |
virtual cstring | argDescription (void) |
Public Member Functions inherited from elm::option::Option | |
Option (void) | |
Option (const Make &make) | |
virtual | ~Option (void) |
void | output (io::Output &out) |
virtual char | shortName (void) |
virtual CString | longName (void) |
Protected Member Functions | |
virtual void | configure (Manager &manager, int tag, VarArg &args) |
Protected Member Functions inherited from elm::option::Option | |
void | init (Manager &manager, int tag,...) |
void | init (Manager &manager, int tag, VarArg &args) |
Additional Inherited Members | |
Protected Attributes inherited from elm::option::Option | |
cstring | desc |
A generic option template for option receiving an argument. It only requires to implement the process() virtual function.
T | Type of value of the argument. |
elm::option::ValueOption< T >::ValueOption | ( | void | ) |
elm::option::ValueOption< T >::ValueOption | ( | const Make & | make | ) |
elm::option::ValueOption< T >::ValueOption | ( | Manager & | man, |
int | tag... | ||
) |
elm::option::ValueOption< T >::ValueOption | ( | Manager & | man, |
int | tag, | ||
VarArg & | args | ||
) |
elm::option::ValueOption< T >::ValueOption | ( | Manager & | manager, |
char | short_name, | ||
cstring | description, | ||
cstring | arg_description, | ||
const T & | value = type_info<T>::null |
||
) |
Build a function with only a short name.
manager | Owner option manager |
short_name | Single letter name accessible with simple '-'. |
description | Description of the option. |
arg_description | Argument description in option display. |
value | Default value of the option. |
elm::option::ValueOption< T >::ValueOption | ( | Manager & | manager, |
cstring | l, | ||
cstring | desc, | ||
cstring | adesc, | ||
const T & | value = type_info<T>::null |
||
) |
Build a function with only a long name.
manager | Owner option manager |
long_name | Multiple letter name accessible with '–'. |
description | Description of the option. |
arg_description | Argument description in option display. |
value | Default value of the option. |
elm::option::ValueOption< T >::ValueOption | ( | Manager & | manager, |
char | short_name, | ||
cstring | l, | ||
cstring | desc, | ||
cstring | adesc, | ||
const T & | value = type_info<T>::null |
||
) |
Build a function with a short name and a long name.
manager | Owner option manager |
short_name | Single letter name accessible with simple '-'. |
long_name | Multiple letter name accessible with '–'. |
description | Description of the option. |
arg_description | Argument description in option display. |
value | Default value of the option. |
elm::option::ValueOption< string >::ValueOption | ( | Manager & | man, |
char | s, | ||
cstring | desc, | ||
cstring | adesc, | ||
const string & | value | ||
) |
elm::option::ValueOption< string >::ValueOption | ( | Manager & | man, |
cstring | l, | ||
cstring | desc, | ||
cstring | adesc, | ||
const string & | val | ||
) |
elm::option::ValueOption< string >::ValueOption | ( | Manager & | man, |
char | s, | ||
cstring | l, | ||
cstring | desc, | ||
cstring | adesc, | ||
const string & | val | ||
) |
|
protectedvirtual |
Handle a configuration tag and its value. May be override for extending the Option class but do no forget to call back the original configure() method.
manager | Owner manager. |
tag | Current tag. |
args | List of arguments. |
Reimplemented from elm::option::AbstractValueOption.
const T & elm::option::ValueOption< T >::get | ( | void | ) | const |
Get the argument value of the option.
string elm::option::ValueOption< string >::get | ( | VarArg & | args | ) |
References elm::VarArg::next().
elm::option::ValueOption< T >::operator bool | ( | void | ) | const |
elm::option::ValueOption< T >::operator const T & | ( | void | ) | const |
const T & elm::option::ValueOption< T >::operator* | ( | void | ) | const |
Same as get().
ValueOption< T > & elm::option::ValueOption< T >::operator= | ( | const T & | value | ) |
Same as set().
|
virtual |
This method is called by the option manager when the option is encountered.
arg | If the option requires an argument, the value of the argument. |
Implements elm::option::Option.
Reimplemented in elm::option::IntOption.
void elm::option::ValueOption< T >::set | ( | const T & | value | ) |
Set the value of the option argument.
value | Value to set. |
Referenced by elm::option::ValueOption< string >::operator=().
const T& elm::option::ValueOption< T >::value | ( | void | ) | const |
Referenced by elm::option::ValueOption< string >::set().