Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/option/Option.h>
Classes | |
class | Make |
Public Member Functions | |
Option (void) | |
Option (const Make &make) | |
virtual | ~Option (void) |
void | output (io::Output &out) |
virtual cstring | description (void) |
virtual usage_t | usage (void)=0 |
virtual cstring | argDescription (void)=0 |
virtual void | process (String arg)=0 |
virtual char | shortName (void) |
virtual CString | longName (void) |
Protected Member Functions | |
virtual void | configure (Manager &manager, int tag, VarArg &args) |
void | init (Manager &manager, int tag,...) |
void | init (Manager &manager, int tag, VarArg &args) |
Protected Attributes | |
cstring | desc |
Base class of classes used for representing options with the OptionManager class.
elm::option::Option::Option | ( | void | ) |
elm::option::Option::Option | ( | const Make & | make | ) |
Build an option.
make | Option maker. |
References elm::option::Option::Make::_desc, elm::option::Manager::addOption(), elm::option::cmd, elm::option::Option::Make::cmds, desc, elm::String::length(), and elm::option::Option::Make::man.
|
virtual |
|
pure virtual |
If the option requires an argument, get the description of the argument.
Implemented in elm::option::AbstractValueOption, elm::option::EnumOption< T >, elm::option::StringList, elm::option::SwitchOption, elm::option::BoolOption, and elm::option::ActionOption.
Referenced by elm::option::Manager::displayHelp().
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 in elm::option::ValueOption< T >, elm::option::ValueOption< int >, elm::option::ValueOption< string >, elm::option::AbstractValueOption, elm::option::SwitchOption, and elm::option::StandardOption.
References elm::option::cmd, desc, elm::option::description, elm::option::long_cmd, elm::VarArg::next(), and elm::option::short_cmd.
Referenced by elm::option::StandardOption::configure(), elm::option::SwitchOption::configure(), elm::option::AbstractValueOption::configure(), and init().
|
virtual |
Get the description of the option.
Reimplemented in elm::option::AbstractValueOption, and elm::option::StandardOption.
References desc.
Referenced by elm::option::Manager::displayHelp().
|
protected |
Common initialization.
Referenced by elm::option::AbstractValueOption::AbstractValueOption(), elm::option::ListOption< T >::ListOption(), elm::option::StandardOption::StandardOption(), elm::option::SwitchOption::SwitchOption(), elm::option::ValueOption< string >::ValueOption(), and elm::option::ValueOption< T >::ValueOption().
Common initialization.
References elm::option::Manager::addOption(), configure(), elm::option::end, and elm::VarArg::next().
|
virtual |
Get the multi-character long name of the option.
Reimplemented in elm::option::StandardOption.
Referenced by output().
void elm::option::Option::output | ( | io::Output & | out | ) |
Display the name of the option to the given output stream.
out | Stream to output to. |
References longName(), and shortName().
Referenced by elm::option::operator<<().
|
pure 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. |
Implemented in elm::option::ValueOption< T >, elm::option::ValueOption< int >, elm::option::ValueOption< string >, elm::option::ListOption< T >, elm::option::EnumOption< T >, elm::option::IntOption, elm::option::StringList, elm::option::SwitchOption, elm::option::BoolOption, and elm::option::ActionOption.
|
virtual |
Get the single-character short name of the option.
Reimplemented in elm::option::StandardOption.
Referenced by output().
|
pure virtual |
Get the argument usage type of this function.
Implemented in elm::option::AbstractValueOption, elm::option::EnumOption< T >, elm::option::StringList, elm::option::SwitchOption, elm::option::BoolOption, and elm::option::ActionOption.
Referenced by elm::option::Manager::displayHelp().
|
protected |