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::SwitchOption Class Reference

#include <elm/option/SwitchOption.h>

+ Inheritance diagram for elm::option::SwitchOption:

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
 
SwitchOptionoperator= (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
 

Detailed Description

An option to handle simple switch option (boolean).

Constructor & Destructor Documentation

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.

Parameters
makeMake information.

Member Function Documentation

cstring elm::option::SwitchOption::argDescription ( void  )
virtual

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

Returns
Argument description.

Implements elm::option::Option.

void elm::option::SwitchOption::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 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().

void elm::option::SwitchOption::process ( string  arg)
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.

Implements elm::option::Option.

void elm::option::SwitchOption::set ( bool  value)

References elm::value().

Referenced by operator=().

usage_t elm::option::SwitchOption::usage ( void  )
virtual

Get the argument usage type of this function.

Returns
Argument usage type.

Implements elm::option::Option.

References elm::option::arg_none.


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