|
|
optionmm::option_base Class Reference#include <optionmm/option.hh>
Inheritance diagram for optionmm::option_base:
[legend]Collaboration diagram for optionmm::option_base:
[legend]List of all members.
Detailed Description
Base class for options.
This is needed to use the std::vector container in the class command_line below.
Definition at line 60 of file option.hh.
|
Public Types |
| typedef std::vector< int > | position_list |
| enum | { cannot_handle,
can_handle,
bad_argument,
missing_argument
} |
Public Member Functions |
| | option_base (char s, const std::string &l, const std::string &h) |
| virtual | ~option_base () |
| char | short_name () const |
| const std::string & | long_name () const |
| const std::string & | help_string () const |
| virtual bool | need_argument () const |
| virtual bool | many_values () const |
| virtual int | push_arg (const char *arg, int pos)=0 |
| virtual int | push_arg (int pos)=0 |
| virtual int | position (int i=0) const |
| virtual void | print (int ll, std::ostream &o=std::cout) const =0 |
| virtual int | handle (const std::string &arg, int pos) |
| virtual int | handle (char *&opt, char *&arg, int pos) |
Protected Attributes |
| char | _short_name |
| std::string | _long_name |
| std::string | _help_string |
| position_list | _positions |
Member Typedef Documentation
Member Enumeration Documentation
|
|
- Enumeration values:
-
| cannot_handle |
|
| can_handle |
|
| bad_argument |
|
| missing_argument |
|
Definition at line 74 of file option.hh. |
Constructor & Destructor Documentation
| optionmm::option_base::option_base |
( |
char |
s, |
|
|
const std::string & |
l, |
|
|
const std::string & |
h |
|
) |
[inline] |
|
|
|
CTOR.
- Parameters:
-
| s | The short name (possibly '\0') |
| l | The long name (possibly ""); |
| h | The help string. |
Definition at line 137 of file option.hh. |
| virtual optionmm::option_base::~option_base |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
| int optionmm::option_base::handle |
( |
char *& |
opt, |
|
|
char *& |
arg, |
|
|
int |
pos |
|
) |
[inline, virtual] |
|
Here is the call graph for this function:
| int optionmm::option_base::handle |
( |
const std::string & |
arg, |
|
|
int |
pos |
|
) |
[inline, virtual] |
|
Here is the call graph for this function:
| const std::string& optionmm::option_base::help_string |
( |
|
) |
const [inline] |
|
| const std::string& optionmm::option_base::long_name |
( |
|
) |
const [inline] |
|
| virtual bool optionmm::option_base::many_values |
( |
|
) |
const [inline, virtual] |
|
| virtual bool optionmm::option_base::need_argument |
( |
|
) |
const [inline, virtual] |
|
| int optionmm::option_base::position |
( |
int |
i = 0 |
) |
const [inline, virtual] |
|
Here is the call graph for this function:
| virtual void optionmm::option_base::print |
( |
int |
ll, |
|
|
std::ostream & |
o = std::cout |
|
) |
const [pure virtual] |
|
| virtual int optionmm::option_base::push_arg |
( |
int |
pos |
) |
[pure virtual] |
|
| virtual int optionmm::option_base::push_arg |
( |
const char * |
arg, |
|
|
int |
pos |
|
) |
[pure virtual] |
|
| char optionmm::option_base::short_name |
( |
|
) |
const [inline] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
|