eVaf
|
Default implementation of the iConfig interface. More...
#include <Common/config.h>
Public Member Functions | |
iConfig * | _interface () const |
Returns the current implementation of the iConfig interface. More... | |
Config () | |
void | done () |
Finalizes the iConfig interface implementation. More... | |
virtual QVariant | getValue (QString const ¶mName, QVariant const &defaultValue) const |
Reads a configuration parameter value. More... | |
bool | init () |
Initializes the iConfig interface implementation. More... | |
virtual bool | setValue (QString const ¶mName, QVariant const &value, bool commit) |
Writes a configuration parameter value. More... | |
virtual | ~Config () |
Public Member Functions inherited from eVaf::Common::iConfig | |
iConfig () | |
Interface constructor. More... | |
virtual | ~iConfig () |
Empty virtual destructor. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from eVaf::Common::iConfig | |
static iConfig * | instance () |
Returns the current iConfig interface instance. More... | |
Default implementation of the iConfig interface.
This class implements the iConfig interface using INI files in the eVaf::Common::iApp::instance()->etcDir() directory.
eVaf::Common::Internal::Config::Config | ( | ) |
|
virtual |
iConfig* eVaf::Common::Internal::Config::_interface | ( | ) | const |
Returns the current implementation of the iConfig interface.
void eVaf::Common::Internal::Config::done | ( | ) |
Finalizes the iConfig interface implementation.
|
virtual |
Reads a configuration parameter value.
paramName | Name of the parameter |
defaultValue | Default value |
The getValue() method returns a configuration parameter value identified by the parameter name. If the parameter cannot be read or is not found, returns the default value.
The default value is used to determine the type of the value. For example, if the default value is an integer, then the returned value is also an integer. The default iConfig interface implementation validates parameter values and makes sure that the parameter value is of the proper type. If the value cannot be converted to the proper type, returns the default value. Other implementations of the iConfig interface are encouraged to do the same.
Implements eVaf::Common::iConfig.
bool eVaf::Common::Internal::Config::init | ( | ) |
Initializes the iConfig interface implementation.
|
virtual |
Writes a configuration parameter value.
paramName | Name of the parameter |
value | The parameter value |
commit | If true, then commits new parameter values |
The setValue() method writes new configuration parameter values identified by the parameter name.
The commit argument can be used to improve the performance of writing several parameter values at once. Use commit = false for all except the last parameter's write operation.
Implements eVaf::Common::iConfig.