Handles command line options.
More...
#include <Options.h>
List of all members.
Public Member Functions |
| Options (const char *programName) |
| ~Options () |
bool | initialize () |
bool | usage () |
| Print the usage message.
|
bool | parse (const int argc, char *const *argv) |
| Parse the command line options.
|
bool | addOption (const Option &option, void *userPtr=NULL) |
| Add a option.
|
bool | addOptions (size_t count, const Option *options, void *userPtr=NULL) |
| Add multiple options.
|
bool | addDescription (const char *description) |
| Add test to the description, will be printed with the usage message.
|
bool | requestExit () |
| Request exit after the current option, called from callback function.
|
bool | requestedExit () const |
| Has the exit been requested?
|
Static Public Member Functions |
static bool | printHelp (void *userPtr, const char *optArg) |
| help option callback
|
static bool | exit (void *userPtr, const char *optArg) |
| exit option callback
|
Private Member Functions |
| Options () |
| Hide default constructor.
|
Detailed Description
Handles command line options.
Definition at line 43 of file Options.h.
Constructor & Destructor Documentation
ArgusSamples::Options::Options |
( |
const char * |
programName | ) |
|
|
explicit |
ArgusSamples::Options::~Options |
( |
| ) |
|
ArgusSamples::Options::Options |
( |
| ) |
|
|
private |
Hide default constructor.
Member Function Documentation
bool ArgusSamples::Options::addDescription |
( |
const char * |
description | ) |
|
Add test to the description, will be printed with the usage message.
- Parameters:
-
[in] | description | Description |
Definition at line 118 of file Options.cpp.
bool ArgusSamples::Options::addOption |
( |
const Option & |
option, |
|
|
void * |
userPtr = NULL |
|
) |
| |
Add a option.
- Parameters:
-
[in] | option | option to add |
[in] | userPtr | user pointer passed to callback function |
Definition at line 90 of file Options.cpp.
bool ArgusSamples::Options::addOptions |
( |
size_t |
count, |
|
|
const Option * |
options, |
|
|
void * |
userPtr = NULL |
|
) |
| |
Add multiple options.
- Parameters:
-
[in] | count | how many options to add |
[in] | options | option array |
[in] | userPtr | user pointer passed to callback functions |
Definition at line 109 of file Options.cpp.
bool ArgusSamples::Options::exit |
( |
void * |
userPtr, |
|
|
const char * |
optArg |
|
) |
| |
|
static |
bool ArgusSamples::Options::initialize |
( |
| ) |
|
bool ArgusSamples::Options::parse |
( |
const int |
argc, |
|
|
char *const * |
argv |
|
) |
| |
Parse the command line options.
- Parameters:
-
[in] | argc | argument count |
[in] | argv | argument values |
Definition at line 137 of file Options.cpp.
bool ArgusSamples::Options::printHelp |
( |
void * |
userPtr, |
|
|
const char * |
optArg |
|
) |
| |
|
static |
bool ArgusSamples::Options::requestedExit |
( |
| ) |
const |
Has the exit been requested?
Definition at line 132 of file Options.cpp.
bool ArgusSamples::Options::requestExit |
( |
| ) |
|
Request exit after the current option, called from callback function.
Definition at line 126 of file Options.cpp.
bool ArgusSamples::Options::usage |
( |
| ) |
|
Member Data Documentation
std::string ArgusSamples::Options::m_description |
|
private |
bool ArgusSamples::Options::m_initialized |
|
private |
std::vector<Option> ArgusSamples::Options::m_options |
|
private |
std::string ArgusSamples::Options::m_programName |
|
private |
bool ArgusSamples::Options::m_requestExit |
|
private |
The documentation for this class was generated from the following files: