Class for switch option.
More...
#include <yat/utility/OptionSwitch.h>
theplu::yat::utility::OptionSwitch::OptionSwitch |
( |
CommandLine & |
cmd, |
|
|
std::string |
name, |
|
|
std::string |
desc, |
|
|
bool |
def = false |
|
) |
| |
Constructor.
- Parameters
-
cmd | Commandline Option is associated with |
name | string such as "help" for –help, "h" for -h or "h,help" for having both short and long option name |
desc | string used in help display |
def | default value for switch |
const CommandLine& theplu::yat::utility::Option::cmd |
( |
void |
| ) |
const |
|
protectedinherited |
std::string theplu::yat::utility::Option::description |
( |
void |
| ) |
const |
|
inherited |
void theplu::yat::utility::Option::description |
( |
const std::string & |
description | ) |
|
|
inherited |
set description
- Since
- New in yat 0.7
std::string theplu::yat::utility::Option::long_name |
( |
void |
| ) |
const |
|
inherited |
- Returns
- long name e.g. 'help' for –help option.
bool theplu::yat::utility::Option::present |
( |
void |
| ) |
const |
|
inherited |
Get if option was found in cmd.
- Returns
- true if option has been detected in parsing
std::string theplu::yat::utility::Option::print |
( |
void |
| ) |
|
|
inherited |
print help output
This function calls the four virtual private functions print1, print2, print3, and print4. This allows an inherited class to implement one (or several) of these functions and keep the default output of the others. The default behavior is that:
char theplu::yat::utility::Option::short_name |
( |
void |
| ) |
const |
|
inherited |
- Returns
- short name e.g. 'h' for -h option.
void theplu::yat::utility::Option::validate |
( |
void |
| ) |
|
|
inherited |
The documentation for this class was generated from the following file: