add optional string key parameter to config::append_children

This commit is contained in:
gfgtdf 2015-09-06 22:05:42 +02:00
parent 402a97e1fc
commit adc5eca399
2 changed files with 14 additions and 0 deletions

View File

@ -515,6 +515,15 @@ void config::append_children(const config &cfg)
}
}
void config::append_children(const config &cfg, const std::string& key)
{
check_valid(cfg);
BOOST_FOREACH(const config &value, cfg.child_range(key)) {
add_child(key, value);
}
}
void config::append(const config &cfg)
{
append_children(cfg);

View File

@ -667,6 +667,11 @@ public:
*/
void append_children(const config &cfg);
/**
* Adds children from @a cfg.
*/
void append_children(const config &cfg, const std::string& key);
/**
* All children with the given key will be merged
* into the first element with that key.