0

I have a simple tree structure stored in XML and use boost::property_tree::ptree to read and extract the information. I then recreate the tree using std::maps so that I can store data in the leaves. This works well and I like the separation of the fixed tree structure from the data but I feel that I am duplicating a lot of code and that if I could add a class to each leaf node in the ptree I could greatly simplify my code.

As a possible slight complication I am using boost::variant in the class I wish to store in the leaves.

My main question is should I try to add dynamic data to the ptree and secondly, if so, do you have any suggestions of the best way to add it.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ant
  • 1,668
  • 2
  • 18
  • 35
  • Hi Ant, I love the fact that you got the Tumbleweed badge for this question! Oh wait, has the badge just been taken away since this comment went live?!? P.S. I don't know the answer... – Surfbutler Sep 26 '13 at 12:29
  • The Tumbleweed badge is still there and the question remains unanswered. :-( – Ant Oct 02 '13 at 09:36
  • You could trying posting a bounty, might get more interest. Oh also you haven't got c++ as one of the tags. – Surfbutler Oct 02 '13 at 12:20

0 Answers0