|
OptionBase Struct Reference#include <rcudata/Options.h>
Inheritance diagram for OptionBase:
Detailed Description
Base class for options.
Definition at line 65 of file Options.h.
|
Public Member Functions |
| OptionBase (char s, const char *l, const char *h, bool arg) |
virtual | ~OptionBase () |
bool | IsSet () const |
bool | NeedArg () const |
virtual char | Short () const |
virtual const std::string & | Long () const |
virtual bool | Handle (char s, const char *arg)=0 |
virtual bool | Handle (const std::string &l, const std::string &arg)=0 |
virtual void | Help () const |
Protected Attributes |
char | fShort |
std::string | fLong |
std::string | fHelp |
bool | fNeedArg |
bool | fSet |
Constructor & Destructor Documentation
OptionBase::OptionBase |
( |
char |
s, |
|
|
const char * |
l, |
|
|
const char * |
h, |
|
|
bool |
arg |
|
) |
[inline] |
|
|
Constructor.
- Parameters:
-
s | Short option, if any |
l | Long option, if any |
h | Help string |
arg | Whether this option needs an argument |
Definition at line 72 of file Options.h.
References fHelp, fLong, fNeedArg, fSet, and fShort. |
virtual OptionBase::~OptionBase |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
virtual bool OptionBase::Handle |
( |
const std::string & |
l, |
|
|
const std::string & |
arg |
|
) |
[pure virtual] |
|
|
Handle an option.
If the option matches, decode the value if needed and return true . - Parameters:
-
l | Long option string |
arg | argument to possibly decode to value |
- Returns:
true if we handled this option
Implemented in Option< T >. |
virtual bool OptionBase::Handle |
( |
char |
s, |
|
|
const char * |
arg |
|
) |
[pure virtual] |
|
|
Handle an option.
If the option matches, decode the value if needed and return true . - Parameters:
-
s | Short option character |
arg | argument to possibly decode to value |
- Returns:
true if we handled this option
Implemented in Option< T >. |
virtual void OptionBase::Help |
( |
|
) |
const [inline, virtual] |
|
bool OptionBase::IsSet |
( |
|
) |
const [inline] |
|
virtual const std::string& OptionBase::Long |
( |
|
) |
const [inline, virtual] |
|
|
- Returns:
- Long option string
Definition at line 88 of file Options.h.
References fLong. |
bool OptionBase::NeedArg |
( |
|
) |
const [inline] |
|
virtual char OptionBase::Short |
( |
|
) |
const [inline, virtual] |
|
|
- Returns:
- Short option character
Definition at line 86 of file Options.h.
References fShort. |
Field Documentation
The documentation for this struct was generated from the following file:
|