Commit 6b944740 authored by Bryan Berthou's avatar Bryan Berthou
Browse files

refs#16

In ElementaryUtils (trunk) :
- Add update() method for Parameters.
parent 41835a15
......@@ -43,6 +43,8 @@ public:
virtual std::string toString() const;
bool update(const std::string &key, const GenericType &value);
private:
// <key, value>
std::map<std::string, GenericType> m_parameters;
......
......@@ -86,5 +86,19 @@ std::string ElemUtils::Parameters::toString() const {
return formatter.str();
}
} // namespace ElemUtils
bool ElemUtils::Parameters::update(const std::string& key,
const GenericType& value) {
bool result = false;
std::map<std::string, GenericType>::iterator it;
it = m_parameters.find(key);
if (it != m_parameters.end()) {
(it->second) = value;
result = true;
}
return result;
}
} // 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