WSL/SLF GitLab Repository

Commit 47c40d07 authored by Thomas Egger's avatar Thomas Egger
Browse files

Added a deleteKey function to Config object: both deleteKey("testkey",...

Added a deleteKey function to Config object: both deleteKey("testkey", "mysection") or just deleteKey("testkey2") are valid (defaulting to the GENERAL section).
parent 6aeede37
......@@ -70,6 +70,13 @@ void Config::addKey(std::string key, std::string section, const std::string& val
properties[section + "::" + key] = value;
}
void Config::deleteKey(std::string key, std::string section)
{
IOUtils::toUpper(key);
IOUtils::toUpper(section);
properties.erase(section + "::" + key);
}
std::ostream& operator<<(std::ostream &os, const Config& cfg)
{
os << "<Config>\n";
......
......@@ -90,6 +90,13 @@ class Config {
*/
void addKey(const std::string& key, const std::string& value);
/**
* @brief Delete a specific key/value pair from the internal map object, key/section are case insensitive
* @param[in] key string representing the key to be added
* @param[in] section std::string representing a section name; the key has to be part of this section
*/
void deleteKey(std::string key, std::string section=Config::defaultSection);
/**
* @brief Add a specific key/value pair to the internal key/value map object.
* key and section are case insensitive
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment