![]() |
libcyberradio
22.01.24
|
Defines a command-line option that is supported by an application. More...
#include <App.h>
Public Member Functions | |
| AppOption () | |
| Constructs an empty AppOption object. | |
| AppOption (const std::string &shortName, const std::string &longName, int valueType, void *valuePtr, const std::string &helpArgName, const std::string &helpText, bool showDefault) | |
| Constructs an AppOption object from initial parameters. More... | |
| AppOption (const AppOption &opt) | |
| Constructs an AppOption object as a copy of another. More... | |
| virtual AppOption & | operator= (const AppOption &opt) |
| Makes one AppOption object equivalent to another. More... | |
| virtual | ~AppOption () |
| Destroys an AppOption object. | |
Data Fields | |
| std::string | shortName |
| Short option name, without leading hyphen. More... | |
| std::string | longName |
| Long option name, without leading hyphens. More... | |
| int | valueType |
| Type of value that this option sets. More... | |
| void * | valuePtr |
| Pointer to a variable that holds the option value. | |
| std::string | helpArgName |
| Option argument name to display in the help text. | |
| std::string | helpText |
| Option help text. | |
| bool | showDefault |
| Show the default value in the option help text. More... | |
Static Public Attributes | |
| static int | TYPE_NONE |
| Option does not set a value. | |
| static int | TYPE_INTEGER |
| Option sets an integer value. | |
| static int | TYPE_FLOAT |
| Option sets a floating-point value. | |
| static int | TYPE_DOUBLE |
| Option sets a double-precision floating-point value. | |
| static int | TYPE_STRING |
| Option sets a string value. | |
| static int | TYPE_BOOLEAN |
| Option explicitly sets a boolean value. | |
| static int | TYPE_BOOLEAN_SET_TRUE |
| Option sets a boolean value that is False by default but becomes True if this option is specified. | |
| static int | TYPE_BOOLEAN_SET_FALSE |
| Option sets a boolean value that is True by default but becomes False if this option is specified. | |
Defines a command-line option that is supported by an application.
| AppOption | ( | const std::string & | shortName, |
| const std::string & | longName, | ||
| int | valueType, | ||
| void * | valuePtr, | ||
| const std::string & | helpArgName, | ||
| const std::string & | helpText, | ||
| bool | showDefault | ||
| ) |
Constructs an AppOption object from initial parameters.
| shortName | Short option name, without leading hyphen. If empty, this option does not support short format. |
| longName | Long option name, without leading hyphens. If empty, this option does not support long format. |
| valueType | Type of value that this option sets. Must be one of the AppOption::TYPE_* constants. |
| valuePtr | Pointer to a variable that holds the option value. |
| helpArgName | Option argument name to display in the help text. |
| helpText | Option help text. |
| showDefault | Whether or not to show the default value of the option in the help text. The default value will be appended to the help text given in helpText. |
| std::string longName |
| std::string shortName |
| bool showDefault |
| int valueType |