mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 06:57:25 +00:00
add optional string key parameter to config::append_children
This commit is contained in:
parent
402a97e1fc
commit
adc5eca399
@ -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);
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user