Commit 17c2a370 authored by Bryan Berthou's avatar Bryan Berthou
Browse files

refs#16

In ElementaryUtils (trunk) :
- Add remove() method in Parameters class.
parent 31a5625c
......@@ -41,6 +41,7 @@ public:
virtual std::string toString() const;
bool update(const std::string &key, const GenericType &value);
bool remove(const std::string &key);
const GenericType& get(const std::string &key) const;
const GenericType& getLastAvailable() const; /// Care ! Use it after isAvailable() to ensure that the iterator is in the map range.
......
......@@ -120,5 +120,16 @@ GenericType Parameters::value(size_t index) const {
return it->second;
}
} // namespace ElemUtils
bool ElemUtils::Parameters::remove(const std::string& key) {
bool erased = false;
std::map<std::string, GenericType>::iterator it = m_parameters.find(key);
if (it != m_parameters.end()) {
m_parameters.erase(it);
erased = true;
}
return erased;
}
} // namespace ElemUtils
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