Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/option/BoolOption.h>
Public Member Functions | |
BoolOption (Manager &manager, char short_name, CString description, bool value=false) | |
BoolOption (Manager &manager, CString long_name, CString description, bool value=false) | |
BoolOption (Manager &manager, char short_name, CString long_name, CString description, bool value=false) | |
bool | get (void) const |
void | set (bool value) |
virtual usage_t | usage (void) |
virtual CString | argDescription (void) |
virtual void | process (String arg) |
operator bool (void) const | |
bool | operator* (void) const |
BoolOption & | operator= (bool value) |
bool | value (void) const |
Public Member Functions inherited from elm::option::StandardOption | |
StandardOption (Manager &manager, int tag,...) | |
StandardOption (Manager &manager, int tag, VarArg &args) | |
StandardOption (Manager &manager, char short_name, cstring description) | |
StandardOption (Manager &manager, cstring long_name, cstring description) | |
StandardOption (Manager &manager, char short_name, cstring long_name, cstring description) | |
virtual char | shortName (void) |
virtual cstring | longName (void) |
virtual cstring | description (void) |
Public Member Functions inherited from elm::option::Option | |
Option (void) | |
Option (const Make &make) | |
virtual | ~Option (void) |
void | output (io::Output &out) |
Additional Inherited Members | |
Protected Member Functions inherited from elm::option::StandardOption | |
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) |
Protected Attributes inherited from elm::option::Option | |
cstring | desc |
This class is used for getting boolean option usually marked by simple flag.
elm::option::BoolOption::BoolOption | ( | Manager & | manager, |
char | short_name, | ||
CString | description, | ||
bool | value = false |
||
) |
!!TODO!! Very sad side effect not detected by compiler BoolOption(_, _, str, str) is viewed as first cast, last string being converted to boolean. Too bad for user. Perhaps change the order of constructors. Else either the default intialization must be mandatory or onyl one complete form of option building muste exists. Same problem arises with strings and there is no solution. Build a boolean option with a short name.
|
virtual |
If the option requires an argument, get the description of the argument.
Implements elm::option::Option.
bool elm::option::BoolOption::get | ( | void | ) | const |
Get the current value of the option.
elm::option::BoolOption::operator bool | ( | void | ) | const |
Boolean conversion for getting option value.
bool elm::option::BoolOption::operator* | ( | void | ) | const |
Get the current value of the option.
BoolOption& elm::option::BoolOption::operator= | ( | bool | value | ) |
References value().
|
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.
void elm::option::BoolOption::set | ( | bool | value | ) |
|
virtual |
Get the argument usage type of this function.
Implements elm::option::Option.
References elm::option::arg_none.
bool elm::option::BoolOption::value | ( | void | ) | const |