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

#include <elm/option/SwitchOption.h>

+ Inheritance diagram for SwitchOption:

Public Member Functions

 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 Option
 Option ()
 
 Option (const Make &make)
 
virtual ~Option ()
 
virtual cstring description ()
 

Additional Inherited Members

- Protected Attributes inherited from Option
cstring desc
 

Detailed Description

An option to handle simple switch option (boolean).

Constructor & Destructor Documentation

◆ SwitchOption()

SwitchOption ( const Make make)

Build a switch option.

Parameters
makeMake information.

Member Function Documentation

◆ argDescription()

cstring argDescription ( void  )
virtual

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

Returns
Argument description.

Implements Option.

◆ get()

bool get ( void  ) const
inline

◆ operator bool()

operator bool ( void  ) const
inline

References SwitchOption::get().

◆ operator*()

bool operator* ( void  ) const
inline

References SwitchOption::get().

◆ operator=()

SwitchOption& operator= ( bool  value)
inline

References SwitchOption::set().

◆ process()

void 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 Option.

◆ set()

void set ( bool  value)
inline

Referenced by SwitchOption::operator=().

◆ usage()

usage_t usage ( void  )
virtual

Get the argument usage type of this function.

Returns
Argument usage type.

Implements Option.

References elm::option::arg_none.


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