Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Option Class Referenceabstract

#include <elm/option/Option.h>

+ Inheritance diagram for Option:

Classes

class  Make
 

Public Member Functions

 Option ()
 
 Option (const Make &make)
 
virtual ~Option ()
 
virtual cstring description ()
 
virtual usage_t usage ()=0
 
virtual cstring argDescription ()=0
 
virtual void process (String arg)=0
 

Protected Attributes

cstring desc
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Option() [1/2]

Option ( )
inline

◆ Option() [2/2]

Option ( const Make make)

Build an option.

Parameters
makeOption maker.

References Option::desc, and String::length().

◆ ~Option()

virtual ~Option ( )
inlinevirtual

Member Function Documentation

◆ argDescription()

CString argDescription ( )
pure virtual

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

Returns
Argument description.

Implemented in EnumOption< T >, AbstractValueOption, StringList, and SwitchOption.

Referenced by Manager::displayHelp().

◆ description()

cstring description ( )
virtual

Display the name of the option to the given output stream.

Parameters
outStream to output to. Get the single-character short name of the option.
Returns
Single character or '\0' if there is no short name.
Deprecated:

Get the multi-character long name of the option.

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

Get the description of the option.

Returns
Option description.

Reimplemented in AbstractValueOption.

References Option::desc.

Referenced by Manager::displayHelp().

◆ process()

void 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 EnumOption< T >, StringList, ValueOption< T >, ListOption< T >, and SwitchOption.

◆ usage()

usage_t usage ( )
pure virtual

Get the argument usage type of this function.

Returns
Argument usage type.

Implemented in EnumOption< T >, AbstractValueOption, StringList, and SwitchOption.

Referenced by Manager::displayHelp().

Member Data Documentation

◆ desc


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