Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::option::Option Class Referenceabstract

#include <elm/option/Option.h>

+ Inheritance diagram for elm::option::Option:

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
 

Detailed Description

Base class of classes used for representing options with the OptionManager class.

Constructor & Destructor Documentation

elm::option::Option::Option ( void  )
virtual elm::option::Option::~Option ( void  )
virtual

Member Function Documentation

CString elm::option::Option::argDescription ( void  )
pure virtual

If the option requires an argument, get the description of the argument.

Returns
Argument description.

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().

void elm::option::Option::configure ( Manager manager,
int  tag,
VarArg args 
)
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.

Parameters
managerOwner manager.
tagCurrent tag.
argsList 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().

cstring elm::option::Option::description ( void  )
virtual

Get the description of the option.

Returns
Option description.

Reimplemented in elm::option::AbstractValueOption, and elm::option::StandardOption.

References desc.

Referenced by elm::option::Manager::displayHelp().

void elm::option::Option::init ( Manager manager,
int  tag,
VarArg args 
)
protected
cstring elm::option::Option::longName ( void  )
virtual

Get the multi-character long name of the option.

Returns
Multi-character or an empty string if there is no long name.
Deprecated:

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.

Parameters
outStream to output to.

References longName(), and shortName().

Referenced by elm::option::operator<<().

void elm::option::Option::process ( String  arg)
pure virtual

This method is called by the option manager when the option is encountered.

Parameters
argIf 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.

char elm::option::Option::shortName ( void  )
virtual

Get the single-character short name of the option.

Returns
Single character or '\0' if there is no short name.
Deprecated:

Reimplemented in elm::option::StandardOption.

Referenced by output().

usage_t elm::option::Option::usage ( void  )
pure virtual

Member Data Documentation


The documentation for this class was generated from the following files: