提高属性树,迭代器的元素插入? [英] boost property tree, iterators to an element for inserting?

查看:119
本文介绍了提高属性树,迭代器的元素插入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索过升压手动很多,和互联网,因为我相信这是一个相当标准的功能?

I've searched a lot through the boost manual, and the internet, as I believe it is quite a standard feature?

嗯,我寻找到合并的属性树。 - 我注意到函数插入,我希望我可以用这个合并的树?
下面是我想获得工作的行:

Well I'm looking into "merging" property trees. - I noticed the function insert, and I hope I can merge trees with this? Below is the line which I am trying to get working:

base.insert(base.get_child("BRANCH"), t);

T 是财产树有作为分支分支(其中之一)。现在,我要插入 T 进入该分支?结果
更具体地讲:我怎样才能得到一个迭代器元素如果我知道的名字是元素

base and t are "property trees", base has as (one of many) branch "BRANCH". Now I wish to insert t into this branch?
More specifically: how can I get an iterator to "element" if I know that element by name?

推荐答案

您可以使用的开始()获得一个迭代的元素的方法:

  base.get_child("BRANCH").begin();

为了插入每个元素在T上那个位置,你应该使用:

In order to insert every element in t on that position, you should use:

base.insert(base.get_child("BRANCH").begin(), t.begin(), t.end());

如果T包含一个父节点或者你只是想插入第一个节点,你可以使用:

If t contains one parent node or you only want to insert the first node, you can use:

base.insert(base.get_child("BRANCH").begin(), t.front());

这篇关于提高属性树,迭代器的元素插入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆