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:
parent
7259fc8a7f
commit
0b254ecbb1
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue