Public Member Functions | Private Attributes | List of all members
icl_core::config::ConfigParameter Class Reference

#include <ConfigParameter.h>

Inheritance diagram for icl_core::config::ConfigParameter:
Inheritance graph
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
optionThe long option name of this parameter. If option ends with a colon (":") then the parameter also expects a value.
short_optionThe short option name of this parameter. If this is set to the empty string then no short option is used.
config_keyThe configuration key in which the option value should be stored.
helpThe help text for this parameter.
default_valueThe 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.

Member Function Documentation

icl_core::String icl_core::config::ConfigParameter::configKey ( ) const
inline

Get the configuration key in which the option should be stored.

Definition at line 76 of file ConfigParameter.h.

icl_core::String icl_core::config::ConfigParameter::defaultValue ( ) const
inline

Get the default value of the configuration parameter.

Definition at line 84 of file ConfigParameter.h.

bool icl_core::config::ConfigParameter::hasDefaultValue ( ) const
inline

Check if a default value has been set.

Definition at line 80 of file ConfigParameter.h.

Member Data Documentation

icl_core::String icl_core::config::ConfigParameter::m_config_key
private

Definition at line 111 of file ConfigParameter.h.

icl_core::String icl_core::config::ConfigParameter::m_default_value
private

Definition at line 112 of file ConfigParameter.h.


The documentation for this class was generated from the following files:


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59