Boost logo

Boost Users :

Subject: Re: [Boost-users] Property Tree - adding child nodes to a parent
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2010-01-30 07:24:59


Jon Shuler wrote:
>
> I am trying to build a property tree from hierarchy data in a
> database. I want to be able to add a child at a given node using
> something similar to:
>
> parentNode.add_child(“child name”, data_type). There is a add_child
> method but it expects the path to add the child at. I looked at the
> examples and did not see anything. Is this possible?
>
I don't understand the problem. If the path contains only a single
element, it's equivalent to adding a direct child.

Alternatively, you can use push_front, push_back or insert to insert a
std::pair<name, child>.

Sebastian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net