scim 1.4.18
|
A dummy implementation of interface class scim::ConfigBase. More...
#include <scim_config_base.h>
Public Member Functions | |
DummyConfig () | |
virtual | ~DummyConfig () |
virtual bool | valid () const |
Check if this Config object is valid. | |
virtual String | get_name () const |
Return the name of this configuration module. | |
virtual bool | read (const String &key, String *ret) const |
Read a string from the given key. | |
virtual bool | read (const String &key, int *ret) const |
Read an int value from the given key. | |
virtual bool | read (const String &key, double *ret) const |
Read a double value from the given key. | |
virtual bool | read (const String &key, bool *ret) const |
Read a bool value from the given key. | |
virtual bool | read (const String &key, std::vector< String > *ret) const |
Read a string list from the given key. | |
virtual bool | read (const String &key, std::vector< int > *ret) const |
Read an int list from the given key. | |
virtual bool | write (const String &key, const String &value) |
Write a string to the given key. | |
virtual bool | write (const String &key, int value) |
Write an int value to the given key. | |
virtual bool | write (const String &key, double value) |
Write a double value to the given key. | |
virtual bool | write (const String &key, bool value) |
Write a bool value to the given key. | |
virtual bool | write (const String &key, const std::vector< String > &value) |
Write a string list to the given key. | |
virtual bool | write (const String &key, const std::vector< int > &value) |
Write an int list to the given key. | |
virtual bool | flush () |
Permanently writes all changes. | |
virtual bool | erase (const String &key) |
Erase a key and its value. | |
virtual bool | reload () |
Reload the configurations from storage. | |
![]() | |
ConfigBase () | |
Contrustor. | |
virtual | ~ConfigBase () |
Virtual destructor empty but ensures that dtor of all derived classes is virtual. | |
String | read (const String &key, const String &defVal=String()) const |
Read a string from the given key with a default fallback value. | |
int | read (const String &key, int defVal) const |
Read an int value from the given key with a default fallback value. | |
double | read (const String &key, double defVal) const |
Read a double value from the given key with a default fallback value. | |
bool | read (const String &key, bool defVal) const |
Read a bool value from the given key with a default fallback value. | |
std::vector< String > | read (const String &key, const std::vector< String > &defVal) const |
Read a string list from the given key with a default fallback value. | |
std::vector< int > | read (const String &key, const std::vector< int > &defVal) const |
Read an int list from the given key with a default fallback value. | |
Connection | signal_connect_reload (ConfigSlotVoid *slot) |
connect the given slot to the reload signal. | |
![]() | |
bool | is_referenced () const |
void | ref () |
Increase an object's reference count by one. | |
void | unref () |
Additional Inherited Members | |
![]() | |
static ConfigPointer | set (const ConfigPointer &p_config) |
Set the default global Config object. | |
static ConfigPointer | get (bool create_on_demand=true, const String &default_module=String("")) |
Get the default global Config object. | |
![]() | |
ReferencedObject () | |
Constructor. | |
virtual | ~ReferencedObject ()=0 |
Destructor. | |
void | set_referenced (bool reference) |
A dummy implementation of interface class scim::ConfigBase.
The read methods will just return false and the default value (if available). The write methods will do nothing.
scim::DummyConfig::DummyConfig | ( | ) |
|
virtual |
Check if this Config object is valid.
Implements scim::ConfigBase.
Return the name of this configuration module.
This name must be same as the config module's name.
Implements scim::ConfigBase.
Read a string from the given key.
key | - the key to be read. |
ret | - the result will be stored into *ret. |
Implements scim::ConfigBase.
Read an int value from the given key.
key | - the key to be read. |
ret | - the result will be stored into *ret. |
Implements scim::ConfigBase.
Read a double value from the given key.
key | - the key to be read. |
ret | - the result will be stored into *ret. |
Implements scim::ConfigBase.
Read a bool value from the given key.
key | - the key to be read. |
ret | - the result will be stored into *ret. |
Implements scim::ConfigBase.
|
virtual |
Read a string list from the given key.
key | - the key to be read. |
ret | - the result will be stored into *ret. |
Implements scim::ConfigBase.
Read an int list from the given key.
key | - the key to be read. |
ret | - the result will be stored into *ret. |
Implements scim::ConfigBase.
Write a string to the given key.
key | - the key to be written. |
value | - the string to be written to the key. |
Implements scim::ConfigBase.
Write an int value to the given key.
key | - the key to be written. |
value | - the int value to be written to the key. |
Implements scim::ConfigBase.
Write a double value to the given key.
key | - the key to be written. |
value | - the double value to be written to the key. |
Implements scim::ConfigBase.
Write a bool value to the given key.
key | - the key to be written. |
value | - the bool value to be written to the key. |
Implements scim::ConfigBase.
|
virtual |
Write a string list to the given key.
key | - the key to be written. |
value | - the string list to be written to the key. |
Implements scim::ConfigBase.
|
virtual |
Write an int list to the given key.
key | - the key to be written. |
value | - the int list to be written to the key. |
Implements scim::ConfigBase.
Erase a key and its value.
key | - the key to be erased. |
Implements scim::ConfigBase.
Reload the configurations from storage.
All modified keys after the last flush maybe lost.
The derived method should call this base method after reload the configurations successfully, in order to emit the reload signal.
The derived method should have some machanism to avoid reload again if there is no update after the previous reload.
Implements scim::ConfigBase.