#include <ConfigParameter.h>
Public Member Functions | |
icl_core::String | configKey () const |
ConfigParameter (const icl_core::String &option, const icl_core::String &short_option, const icl_core::String &config_key, const icl_core::String &help, const icl_core::String &default_value="") | |
icl_core::String | defaultValue () const |
bool | hasDefaultValue () const |
Public Member Functions inherited from icl_core::config::GetoptParameter | |
GetoptParameter (const icl_core::String &option, const icl_core::String &short_option, const icl_core::String &help, bool is_prefix=false) | |
bool | hasValue () const |
Check if the option also expects a value. More... | |
icl_core::String | help () const |
Get the help text. More... | |
bool | isPrefixOption () const |
Check if this is a prefix option. More... | |
icl_core::String | option () const |
Get the long option name. More... | |
icl_core::String | shortOption () const |
Get the short option name. More... | |
Private Attributes | |
icl_core::String | m_config_key |
icl_core::String | m_default_value |
Contains information about how to handle a specific commandline parameter and how to map it into a configuration parameter.
For key/value parameters the option value is stored in the specified config key. For presence parameters (without a value) the value "yes" is stored in the config key if the option is present on the commandline; otherweise the value "no" is stored in the config key.
Definition at line 49 of file ConfigParameter.h.
icl_core::config::ConfigParameter::ConfigParameter | ( | const icl_core::String & | option, |
const icl_core::String & | short_option, | ||
const icl_core::String & | config_key, | ||
const icl_core::String & | help, | ||
const icl_core::String & | default_value = "" |
||
) |
Create a new config parameter.
option | The long option name of this parameter. If option ends with a colon (":") then the parameter also expects a value. |
short_option | The short option name of this parameter. If this is set to the empty string then no short option is used. |
config_key | The configuration key in which the option value should be stored. |
help | The help text for this parameter. |
default_value | The default value to be set, if it has neither been set in the config file and on the commandline. |
See GetoptParameter for details about the syntax of the option parameter.
Definition at line 27 of file ConfigParameter.cpp.
|
inline |
Get the configuration key in which the option should be stored.
Definition at line 76 of file ConfigParameter.h.
|
inline |
Get the default value of the configuration parameter.
Definition at line 84 of file ConfigParameter.h.
|
inline |
Check if a default value has been set.
Definition at line 80 of file ConfigParameter.h.
|
private |
Definition at line 111 of file ConfigParameter.h.
|
private |
Definition at line 112 of file ConfigParameter.h.