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
1
vote
1 answer

Boost.PropertyTree subpath processing

The following is a reduced sample of actual xml I would like to process with Boost.PropertyTree library. Actually, there are a lot of other fields in an original xml-file
Loom
  • 9,768
  • 22
  • 60
  • 112
1
vote
1 answer

Getting the ptree from boost::property_tree::ptree::iterator

I have a piece of code that iterates over a boost property tree (XML). I need a ptree of the current node, not the children of the node. UPDATE xml tree child A1 child A2…
aquawicket
  • 524
  • 1
  • 9
  • 27
1
vote
1 answer

Parsing XML File with Boost C++

I have to parse one xml file using boost c++, I have written one test code which is working for this xml. a.xml abc def ghi Output is…
avinashse
  • 1,440
  • 4
  • 30
  • 55
1
vote
1 answer

no operator found error with boost read_xml function

I am trying to read an xml file into a ptree using read_xml function as below: read_xml(myFile, myPtree, boost::property_tree::xml_parser::trim_whitespace); Here myFile is an std::string and myPtree is a basic_ptree. It…
ashish g
  • 429
  • 1
  • 7
  • 16
1
vote
1 answer

Boost property tree Bad path for nothing

I am having trouble with this library... My code works fine, the parsers/creator works too, but an err appears, I don't know why: #include #include #include…
Josef
  • 13
  • 4
1
vote
1 answer

Add XML headers using Boost's property trees

I've been working on a XML reader/writer, and I used Boost's property trees to do so. Everything is working, only one thing is missing in the output file: I'd like to add two header tags at the top of the file. Right now, the only header is this…
Nepho
  • 1,074
  • 1
  • 11
  • 32
1
vote
1 answer

Better XML formatting using Boost?

I'm using Boost Property Trees to export my class-instants as XML nodes. It works but it just puts everything in 1 line. I would like it to have indents, like:
1
vote
1 answer

ptree iterator members not identifed by autocomplete?

I am using boost library to parse .ini file that looks like: [head] type1=val1 type2=cal2 ... My code is this: #include #include #include #include using…
1
vote
2 answers

boost recognize a child

My question is related to : boost Some of the boost code is working correctly to find that a node has child, but if one node have two other nodes it didn't recognize the children. It's recursive call to be able to read all the tree nodes and then…
melom
  • 107
  • 1
  • 13
1
vote
1 answer

Adding parent name to boost ptree

I have a boost ptree with nodes: pt.put("a.b", 1.0); pt.put("a.c", 2.0); pt.put("b.g", 3.0); I would like the extract a tree that has "a.b" and "a.c" (but not "b.g"). When I use pt.get_child("a") I get a tree with "b" and "c". Is there a way to…
ad_ad
  • 375
  • 3
  • 14
1
vote
1 answer
1
vote
1 answer

Parse and write a content mathML rational number with boost ptree containing sep

I am trying to write and to read/parse MathMl content XML files with boost ptree (property_tree)I cannot seep. I cannot solve to write or to parse this code:
EckhardN
  • 469
  • 5
  • 11
1
vote
1 answer

Boost::ptree parser can't read the container from the xml file

I need to make a simple input-output of the XML file. I'm using the boost::ptree. struct structure { std::string str; int ival; std::list bval; void save(const std::string& filename) { ptree pt; …
johnsnow
  • 13
  • 3
1
vote
1 answer

How to diff two boost::property_tree?

Please consider two 'boost::property_tree'-s. ptree1: { "node1" : 1, "node_that_only_appears_in_this_one" : 2, "node3" : { "nested1" : 3, "nested2" { "double_nested1" : 5, …
Benedict
  • 2,771
  • 20
  • 21
1
vote
1 answer

Parsing JSON array with Boost.PropertyTree

I have JSON file presented below. { "instruments": [ { "minShift": -1.0, // opcjonalnie - jeśli brak, to taka, jak dla globalnych ustawień "maxShift": 1.0, // opcjonalnie - jeśli brak, to taka, jak dla globalnych ustawień …
CppMonster
  • 1,216
  • 4
  • 18
  • 35