Krotos Modules 3
Loading...
Searching...
No Matches
SettingsFile.h
Go to the documentation of this file.
1namespace krotos
2{
9 class SettingsFile final : private JsonFile
10 {
11 public:
16 SettingsFile(const File& settingsFile);
17
23 var getSetting(const Identifier& key);
24
30 void setSetting(const Identifier& key, const var& value);
31
37 String getSettingsVersion() const;
38
44 void setSettingsVersion(const String& version);
45
50 bool existsAsFile() { return m_jsonFile.existsAsFile(); }
51
57 void setDefaultIfVoid(const Identifier& key, const var& defaultValue);
58
59 private:
60 };
61} // namespace krotos
Definition JsonFile.h:6
File m_jsonFile
The json file.
Definition JsonFile.h:60
A class to manage the settings.json file, derived privately from JsonFile.
Definition SettingsFile.h:10
void setDefaultIfVoid(const Identifier &key, const var &defaultValue)
Sets the default value (if required) associated with a given key in the settings.
Definition SettingsFile.cpp:97
String getSettingsVersion() const
Retrieves the settings version from the JSON data. This function retrieves the settings version from ...
Definition SettingsFile.cpp:64
void setSetting(const Identifier &key, const var &value)
Sets the value associated with a given key in the settings.
Definition SettingsFile.cpp:33
bool existsAsFile()
Checks if the associated JSON file exists as a file.
Definition SettingsFile.h:50
void setSettingsVersion(const String &version)
Sets the settings version in the JSON data. This function sets the settings version in the JSON data ...
Definition SettingsFile.cpp:83
var getSetting(const Identifier &key)
Retrieves the value associated with a given key.
Definition SettingsFile.cpp:11
SettingsFile(const File &settingsFile)
Constructor that initializes the SettingsFile with a given File object.
Definition SettingsFile.cpp:3
Definition AirAbsorptionFilter.cpp:2