ugly, refactor required

This commit is contained in:
MihailRis
2024-04-01 20:16:45 +03:00
parent d47193cbb3
commit e456b77143
8 changed files with 81 additions and 35 deletions
+9
View File
@@ -32,6 +32,15 @@ dynamic::Value SettingsHandler::getValue(const std::string& name) const {
}
}
std::string SettingsHandler::toString(const std::string& name) const {
auto found = map.find(name);
if (found == map.end()) {
throw std::runtime_error("setting '"+name+"' does not exist");
}
auto setting = found->second;
return setting->toString();
}
void SettingsHandler::setValue(const std::string& name, dynamic::Value value) {
auto found = map.find(name);
if (found == map.end()) {