Questions tagged [boost-propertytree]

The Boost PropertyTree library provides a data structure that stores an arbitrarily deeply nested tree of values, indexed at each level by some key. It serializes and emulates XML, JSON and INI file structures.

The Boost PropertyTree library provides a data structure that stores an arbitrarily deeply nested tree of values, indexed at each level by some key. It serializes and emulates XML, JSON and INI file structures.

Note: Boost.PropertyTree is not a generic XML parser. It is not intended to be used as a fast-and-dirty way to load arbitrary XML files into memory. It's XML serialization capabilities are for serialization. It is intended to read the XML that it has written.

Please stop using Boost.PropertyTree as a generic XML parser.

354 questions
2
votes
1 answer

How to insert a Boost ptree into MongoDB using C++

I have MongoDB C++ Driver at https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/tutorial/ compiled and ready, tested OK with literal data. But the challenge is how to store a Boost ptree into MongoDB as a document. I have a Boost ptree because…
Dee
  • 7,455
  • 6
  • 36
  • 70
2
votes
1 answer

Boost ptree top level array

I would like to have write_json output a top level array, something to the effect of: [{...},{...},{...},...,{...}] But when I pass a list to write_json, it converts to a json full of blank keys. {"":{...},"":{...},"":{...},..."":{...}} Using…
2
votes
2 answers

RapidJson And Boost Json Parser

Is there any difference between Rapid JSON and Json parser in Boost Library(Boost\property_Tree\Json_parser.hpp) Thanks.
vishnubvrit
  • 317
  • 1
  • 3
  • 14
2
votes
1 answer

Boost/Property Tree determine the value type

I'd like to use Boost/Property Tree as a sort of synchronization with my application. To do this I'd planned to use Zeroc/ICE for state-synchronization (using an Observe pattern and bidirectional connections). However, to do this in an efficient…
Fohlen
  • 192
  • 2
  • 18
2
votes
1 answer

Boost: How to add child tree into an existing tree

I have the following property tree. propset1 { prop1 2 prop2 5 prop3 60 prop4 7 } I am trying to add couple of child trees to this so that the resulting property tree would look like below. propset1 { prop1 2 prop2 5 …
AnilJ
  • 1,951
  • 2
  • 33
  • 60
2
votes
1 answer

boost json_parser dependencies

I want to use boost's json_parser for reading json data and I'm trying to figure out the dependencies I need. I run bcp on 'boost\property_tree\detail\json_parser\read.hpp' and it extracted a bunch of headers along with two cpp files…
GrzegorzD
  • 73
  • 1
  • 6
2
votes
1 answer

How return leaf nodes of a boost::property_tree

I have a property tree where all the data is stored in its leaf nodes. The Tree, however, has a complex structure. What I want to do now is: get all (and only the) leaf nodes of the tree, for they contain the data and recall the path leading to the…
Marste
  • 627
  • 7
  • 22
2
votes
1 answer

Boost property_tree: multiple values per key, on a template class

On this topic, Boost property_tree: multiple values per key, a method is proposed to read multiples keys of a boost tree. I will paste a modified version below template struct my_vector { std::vector a_vector; }; The translator…
Napseis
  • 833
  • 2
  • 10
  • 24
2
votes
2 answers

Creating a boost property tree recursively

I am trying to create a boost property tree from a tree structure that I already have. I get a memeroy access violation error on the ptree node = *p line. How should I change this code to make it work? ptree*…
hAlE
  • 1,283
  • 3
  • 13
  • 19
2
votes
1 answer

Boost ptree node for all children in a json array

I have been searching for an answer to this but cant find anything so sorry if this has been asked before. I have the following json file {"GuiComponents": [ { "GuiComponent": { "screen": "WindowMain", "type": "class Robot", …
codetemplar
  • 671
  • 6
  • 19
2
votes
1 answer

boost::property_tree::json_parser::read_json cannot read files if path contains cyrillic characters

Is it possible to open files that have cyrillic parts in their path? I am able to read/write cyrillic contents of files, but I do not know how to open the file as json_parser::read_json only has std::string as a parameter and no std::wstring. Can…
Zeks
  • 2,265
  • 20
  • 32
2
votes
1 answer

boost property_tree adding nodes in a loop

How do you add nodes to a property tree while looping a array? This is probably a simple thing but I just don't understand how to work with boost_property_tree. I have an array of values that I want to add to a property tree and output it as xml.…
DbgCtrl
  • 85
  • 2
  • 6
2
votes
2 answers

property tree put/erase with const iterator, or how to convert const_iterator to iterator

I am using boost 1.55.0 on ubuntu 12.04lts with clang 3.4. I have a boost::property_tree::ptree whose xml input looks like: dad 43
Rico-E
  • 1,806
  • 2
  • 28
  • 47
2
votes
1 answer

Boost.Bind return type

I'm trying to fill boost::property_tree::ptree with Boost.Assign. So, I got the following worked fine: namespace bpt = boost::property_tree; bpt::ptree pt; boost::assign::make_list_inserter (boost::bind(&bpt::ptree::put, pt, _1,…
Loom
  • 9,768
  • 22
  • 60
  • 112
2
votes
1 answer

Reading ini file using boost::property_tree not working with children of form A.x

I have a file of the following format that I am trying to use boost::property_tree::read_ini and boost::property_tree to parse. Sample config file (some value contain white space) [Config] A = 1000 B.x = Test B.y = Test By C.x.y = Test_Cxy…
oracle3001
  • 1,090
  • 19
  • 31