COMMON: Add ConfMan function to know if a default is set for a key

This commit is contained in:
Thierry Crozat 2023-11-26 21:50:38 +00:00
parent cac0664757
commit c748d1fd6d
2 changed files with 9 additions and 0 deletions

View File

@ -482,6 +482,10 @@ bool ConfigManager::hasKey(const String &key, const String &domName) const {
return domain->contains(key);
}
bool ConfigManager::hasDefault(const String &key) const {
return _defaultsDomain.contains(key);
}
void ConfigManager::removeKey(const String &key, const String &domName) {
Domain *domain = getDomain(domName);

View File

@ -149,6 +149,11 @@ public:
void set(const String &key, const String &value); /*!< Assign a @p value to a @p key. */
/** @} */
/**
* Indicate if a default value has been set for the given key.
*/
bool hasDefault(const String &key) const;
/**
* Update a configuration entry for the active domain and flush
* the configuration file to disk if the value changed.