Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/option/SwitchOption.h>
Public Member Functions | |
SwitchOption (Manager &man, int tag...) | |
SwitchOption (const Make &make) | |
void | set (bool value) |
bool | get (void) const |
operator bool (void) const | |
bool | operator* (void) const |
SwitchOption & | operator= (bool value) |
virtual usage_t | usage (void) |
virtual CString | argDescription (void) |
virtual void | process (string arg) |
Public Member Functions inherited from elm::option::Option | |
Option (void) | |
Option (const Make &make) | |
virtual | ~Option (void) |
void | output (io::Output &out) |
virtual cstring | description (void) |
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 |
An option to handle simple switch option (boolean).
elm::option::SwitchOption::SwitchOption | ( | Manager & | man, |
int | tag... | ||
) |
Completely free constructor. Supported tags includes CMD, SHORT, LONG, DESCRIPTION and DEFAULT (bool).
References elm::option::Option::init().
elm::option::SwitchOption::SwitchOption | ( | const Make & | make | ) |
Build a switch option.
make | Make information. |
|
virtual |
If the option requires an argument, get the description of the argument.
Implements elm::option::Option.
|
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::Option.
References elm::option::Option::configure(), elm::option::def, elm::option::Option::desc, elm::option::description, and elm::VarArg::next().
bool elm::option::SwitchOption::get | ( | void | ) | const |
elm::option::SwitchOption::operator bool | ( | void | ) | const |
bool elm::option::SwitchOption::operator* | ( | void | ) | const |
SwitchOption& elm::option::SwitchOption::operator= | ( | bool | value | ) |
References 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.
void elm::option::SwitchOption::set | ( | bool | value | ) |
References elm::value().
Referenced by operator=().
|
virtual |
Get the argument usage type of this function.
Implements elm::option::Option.
References elm::option::arg_none.