|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
22 #ifndef ELM_OPTION_VALUEOPTION_H_
23 #define ELM_OPTION_VALUEOPTION_H_
25 #include <elm/option/Option.h>
26 #include <elm/type_info.h>
28 namespace elm {
namespace option {
65 inline T
read(
string arg) { T val; arg >> val;
return val; }
83 inline Make&
def(
const T& d) { _def = d;
return *
this; }
91 inline const T&
get(
void)
const {
return val; };
95 inline operator const T&(
void)
const {
return get(); };
98 inline operator bool(
void)
const {
return get(); }
104 inline const T&
value(
void)
const {
return val; };
Make & help(cstring d)
Definition: ValueOption.h:43
Make & argDescription(cstring s)
Definition: ValueOption.h:38
Value(const typename ValueOption< T >::Make &make)
Definition: ValueOption.h:115
ValueOption(void)
Definition: ValueOption.h:88
Make & description(cstring d)
Definition: ValueOption.h:81
Make & cmd(string c)
Definition: ValueOption.h:80
Definition: ValueOption.h:31
Make & description(cstring d)
Definition: ValueOption.h:42
Make & argDescription(cstring s)
Definition: ValueOption.h:77
Make & usage(usage_t u)
Definition: ValueOption.h:79
Definition: ValueOption.h:72
Manager & man
Definition: Option.h:61
Make(Manager *man)
Definition: ValueOption.h:75
usage_t usage(void) override
Definition: option_ValueOption.cpp:166
Make(Manager *man)
Definition: ValueOption.h:36
const T & operator*(void) const
Definition: ValueOption.h:97
Make & arg(cstring s)
Definition: ValueOption.h:78
Make & description(cstring desc)
Definition: Option.h:59
usage_t
Definition: Option.h:41
Make & arg(cstring s)
Definition: ValueOption.h:39
Make & help(cstring d)
Definition: ValueOption.h:82
const T & value(void) const
Definition: ValueOption.h:104
string read< string >(string arg)
Definition: option_ValueOption.cpp:180
Make & cmd(string c)
Definition: ValueOption.h:41
cstring read< cstring >(string arg)
Definition: option_ValueOption.cpp:186
void set(const T &value)
Definition: ValueOption.h:92
Definition: ValueOption.h:33
ValueOption(const Make &make)
Definition: ValueOption.h:89
Definition: ValueOption.h:70
cstring description(void) override
Definition: option_ValueOption.cpp:159
AbstractValueOption(const Make &make)
Definition: option_ValueOption.cpp:152
const T & get(void) const
Definition: ValueOption.h:91
Make & cmd(string cmd)
Definition: Option.h:57
T read(string arg)
Definition: ValueOption.h:65
T next(void)
Definition: VarArg.h:42
virtual void process(String arg)
Definition: ValueOption.h:101
Make & usage(usage_t u)
Definition: ValueOption.h:40
Definition: ValueOption.h:113
@ arg_required
Definition: Option.h:44
Make(Manager &man)
Definition: ValueOption.h:76
cstring argDescription(void) override
Definition: option_ValueOption.cpp:173
Make(Manager &man)
Definition: ValueOption.h:37
Make & def(const T &d)
Definition: ValueOption.h:83
ValueOption< T > & operator=(const T &value)
Definition: ValueOption.h:96