|
Pakman
|
#include <LongOptions.h>
Public Member Functions | |
| LongOptions () | |
| ~LongOptions ()=default | |
| void | add (struct option long_opt) |
| const struct option * | getLongOpts () const |
| const char * | getShortOpts () const |
| std::string | getLongOptionName (char short_option) const |
A class for representing command-line options.
The LongOptions class is a utility wrapper for the struct option array type defined in getopt.h, and used by getopt_long().
Long options are added with add(). The struct option array is accessed with getLongOpts(), while the optstring is accessed with getShortOpts().
Definition at line 20 of file LongOptions.h.
| LongOptions::LongOptions | ( | ) |
Default constructor.
The constructor will push the null struct option to the struct option array so that a valid struct option is always maintained.
Definition at line 13 of file LongOptions.cc.
|
default |
Default destructor does nothing.
| void LongOptions::add | ( | struct option | long_opt | ) |
Add a long option.
| long_opt | long option to add. |
Definition at line 20 of file LongOptions.cc.
| std::string LongOptions::getLongOptionName | ( | char | short_option | ) | const |
Get the long option name for a short option.
| short_option | short option character. |
Definition at line 82 of file LongOptions.cc.
| const struct option * LongOptions::getLongOpts | ( | ) | const |
Definition at line 71 of file LongOptions.cc.
| const char * LongOptions::getShortOpts | ( | ) | const |
Definition at line 77 of file LongOptions.cc.