@@ -129,6 +129,46 @@ bool ConfigManager::ValidateConfig() const {
129129 }
130130}
131131
132+ void ConfigManager::SetBool (const std::string& key, bool value) {
133+ std::lock_guard<std::mutex> lock (configMutex_);
134+ std::string keyPath = key;
135+ std::replace (keyPath.begin (), keyPath.end (), ' .' , ' /' );
136+ nlohmann::json::json_pointer ptr (" /" + keyPath);
137+ config_[ptr] = value;
138+ }
139+
140+ void ConfigManager::SetInt (const std::string& key, int value) {
141+ std::lock_guard<std::mutex> lock (configMutex_);
142+ std::string keyPath = key;
143+ std::replace (keyPath.begin (), keyPath.end (), ' .' , ' /' );
144+ nlohmann::json::json_pointer ptr (" /" + keyPath);
145+ config_[ptr] = value;
146+ }
147+
148+ void ConfigManager::SetFloat (const std::string& key, float value) {
149+ std::lock_guard<std::mutex> lock (configMutex_);
150+ std::string keyPath = key;
151+ std::replace (keyPath.begin (), keyPath.end (), ' .' , ' /' );
152+ nlohmann::json::json_pointer ptr (" /" + keyPath);
153+ config_[ptr] = value;
154+ }
155+
156+ void ConfigManager::SetString (const std::string& key, const std::string& value) {
157+ std::lock_guard<std::mutex> lock (configMutex_);
158+ std::string keyPath = key;
159+ std::replace (keyPath.begin (), keyPath.end (), ' .' , ' /' );
160+ nlohmann::json::json_pointer ptr (" /" + keyPath);
161+ config_[ptr] = value;
162+ }
163+
164+ void ConfigManager::SetJson (const std::string& key, const nlohmann::json& value) {
165+ std::lock_guard<std::mutex> lock (configMutex_);
166+ std::string keyPath = key;
167+ std::replace (keyPath.begin (), keyPath.end (), ' .' , ' /' );
168+ nlohmann::json::json_pointer ptr (" /" + keyPath);
169+ config_[ptr] = value;
170+ }
171+
132172// Server configuration getters
133173std::string ConfigManager::GetServerHost () const {
134174 std::lock_guard<std::mutex> lock (configMutex_);
0 commit comments