add an add_attribute function to config...

...should be faster than using operator[] and assignment. Not used
anywhere yet, but a good candidate for places that create configs a
lot.
This commit is contained in:
Tomasz Śniatowski 2008-06-14 11:55:39 +01:00
parent 7259fc8a7f
commit 0b254ecbb1

View file

@ -79,6 +79,9 @@ public:
const t_string& get_attribute(const std::string& key) const;
bool has_attribute(const std::string& key) const {return values.find(key) != values.end();}
bool add_attribute(const std::string& key, const t_string& value) {
return values.insert(string_map::value_type(key, value)).second;
}
config* find_child(const std::string& key, const std::string& name,
const t_string& value);