22 #ifndef SHARED_CONF_CONF_SERIALIZER_H 23 #define SHARED_CONF_CONF_SERIALIZER_H 25 #include "common/config-manager.h" 47 ConfMan.flushToDisk();
68 const char *defaultValue =
nullptr) {
70 ConfMan.set(key, value);
72 value = ConfMan.hasKey(key) ? ConfMan.get(key) :
Common::String(defaultValue);
79 bool defaultValue =
false) {
81 ConfMan.setBool(key, value);
83 value = ConfMan.hasKey(key) ? ConfMan.getBool(key) : defaultValue;
92 ConfMan.setInt(key, value);
94 value = ConfMan.hasKey(key) ? ConfMan.getInt(key) : defaultValue;
Definition: conf_serializer.h:33
ConfSerializer(bool saving)
Definition: conf_serializer.h:40
void syncAsBool(const Common::String &key, bool &value, bool defaultValue=false)
Definition: conf_serializer.h:78
~ConfSerializer()
Definition: conf_serializer.h:45
void syncAsString(const Common::String &key, Common::String &value, const char *defaultValue=nullptr)
Definition: conf_serializer.h:67
Definition: detection.h:27
bool isLoading() const
Definition: conf_serializer.h:60
bool isSaving() const
Definition: conf_serializer.h:53
void syncAsInt(const Common::String &key, T &value, T defaultValue=0)
Definition: conf_serializer.h:90