GATE
|
A single program parameter option definition. More...
#include <applications.hpp>
Public Types | |
enum | OptionTypeEnum { OptionType_Switch = GATE_APP_OPTION_TYPE_SWITCH , OptionType_Boolean = GATE_APP_OPTION_TYPE_BOOL , OptionType_Int32 = GATE_APP_OPTION_TYPE_I32 , OptionType_Int64 = GATE_APP_OPTION_TYPE_I64 , OptionType_Real = GATE_APP_OPTION_TYPE_REAL , OptionType_String = GATE_APP_OPTION_TYPE_STRING , OptionType_StringArray = GATE_APP_OPTION_TYPE_ARRAY } |
Data type of option. More... | |
Public Member Functions | |
AppOptionDef (String const &key, OptionTypeEnum type, void *targetValue, String const alias=String(), String const &optionName=String(), String const &description=String()) | |
Construct app option definition. | |
AppOptionDef (gate_app_option_t const &src) | |
Construct app option definition from C object. | |
AppOptionDef (AppOptionDef const &src) | |
Copy constructor. | |
AppOptionDef & | operator= (AppOptionDef const &src) |
Assignment operator. | |
~AppOptionDef () noexcept | |
Destructor. | |
String | Key () const |
Returns the option's long-key (e.g. "--my-param") | |
String | Alias () const |
Returns the option's short-key alias (e.g. "-MP") | |
String | OptionName () const |
Returns the option's variable name (documention purpose) | |
String | Description () const |
Returns the option's description. | |
OptionTypeEnum | Type () const noexcept |
Returns the option's value type. | |
bool_t | getBool () const noexcept |
Returns the options value as bool type. | |
int32_t | getInt32 () const noexcept |
Returns the options value as int32 type. | |
int64_t | getInt64 () const noexcept |
Returns the options value as int64 type. | |
real64_t | getReal () const noexcept |
Returns the options value as floating point type. | |
String | getString () const |
Returns the options value as string. | |
Array< String > | getStringArray () const |
Returns the options value as a string array. | |
gate_app_option_t * | c_impl () noexcept |
Returns a pointer to C implementation of option definition. | |
gate_app_option_t const * | c_impl () const noexcept |
Returns a pointer to C implementation of option definition. | |
bool | operator! () const noexcept |
Returns true if definition is empty/uninitialized. | |
Static Public Member Functions | |
static AppOptionDef | createSwitch (String const &key, String const &alias=String(), String const &name=String(), String const &description=String()) |
Creates a switch option defition. | |
static AppOptionDef | createBool (String const &key, String const &alias=String(), bool_t default_value=false, String const &name=String(), String const &description=String()) |
Creates a boolean option defition. | |
static AppOptionDef | createInt32 (String const &key, String const &alias=String(), int32_t default_value=0, String const &name=String(), String const &description=String()) |
Creates a int32 option defition. | |
static AppOptionDef | createInt64 (String const &key, String const &alias=String(), int64_t default_value=0, String const &name=String(), String const &description=String()) |
Creates a int64 option defition. | |
static AppOptionDef | createReal64 (String const &key, String const &alias=String(), real64_t default_value=0.0, String const &name=String(), String const &description=String()) |
Creates a floating-point option defition. | |
static AppOptionDef | createString (String const &key, String const &alias=String(), String const &default_value=String(), String const &name=String(), String const &description=String()) |
Creates a string option defition. | |
static AppOptionDef | createArray (String const &key, String const &alias=String(), String const &name=String(), String const &description=String()) |
Creates a string array option defition. | |
A single program parameter option definition.
enum OptionTypeEnum |
Data type of option.
AppOptionDef | ( | String const & | key, |
OptionTypeEnum | type, | ||
void * | targetValue, | ||
String const | alias = String(), | ||
String const & | optionName = String(), | ||
String const & | description = String() ) |
Construct app option definition.
key | option's full key identifier (e.g.: "--my-param") |
type | option's value type |
targetValue | pointer to variable that receives the option's value |
alias | option's short alias identifier (e.g.: "-MP") |
optionName | internal variable name of option value |
description | description of option value |
AppOptionDef | ( | gate_app_option_t const & | src | ) |
Construct app option definition from C object.
src | reference to source option to copy data from |