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
2 answers

C++ storing a float value in boost property tree

I'm trying to modify some library and I need to store a float value in a ptree. However when I retrieve the value it's different from what I've put in there. This doesn't happen with doubles. Example: Ptree pt; float f = 230518.391; pt.put("float",…
jaho
  • 4,852
  • 6
  • 40
  • 66
2
votes
1 answer

How to iterate over childnodes in boost::propertytree, if these have childs itself?

I load a boost::property_tree::ptree from an XML-file, that looks somewhat like this:
Mnementh
  • 50,487
  • 48
  • 148
  • 202
2
votes
3 answers

boost/property_tree/xml_parser.hpp: No such file or directory

I have installed boost_1_41_0 and try to follow some tutorials on xml parsing: #include int main(){ using boost::property_tree::ptree; ptree pt; cout<<"Here is an XML test!\n"; return 0; } But the problem is…
Alex
  • 21
  • 1
  • 2
2
votes
1 answer

boost propertytree

Based on the boost documentation here: http://www.boost.org/doc/libs/1_41_0/doc/html/boost_propertytree/container.html "There may be multiple children with the same key value in a node. However, these children are not necessarily sequential. The…
2
votes
1 answer

Need to draw vertical lines in expand/collapse in p-tree

I am using p-tree from prime-ng, and need to draw the vertical lines(Highlighted with red pen) via css like this: I have done the rest part and working fine, only vertical lines need to draw. My Implementation is looking something like below: I…
2
votes
0 answers

Convert JSON model to primeNg p-tree nodes Angular

I'm trying to use the tree component of PrimeNG https://www.primefaces.org/primeng/#/tree I'm trying to convert an array of objects into an array of TreeNode, in order to be displayed like a tree. My typescript model looks like this : [ { …
2
votes
1 answer

Converting Boost ptree node to XML string

I am using boost (version 1.70.0) property tree. Is there a way to convert a node to XML string including the node itself, not just node's children? If I have this XML: ..
M.K.
  • 159
  • 8
2
votes
1 answer

How to remove the special character that write_json is adding to the string in boost C++

write_json is converting the string "test/123" as "test\/123". How to remove the special character (\) that write_json is adding to the string in boost C++ Thanks,
John Paul Coder
  • 313
  • 1
  • 12
2
votes
1 answer

boost property tree json

i have a JSON file: { "level_1" : { "level_1_1" : [[1, "text", 0, 1, 2], [2, "text", 1, 3, 4], [3, "text", 5, 6, 8], [7, "text", 5, 4, 3] ], …
2
votes
2 answers

what(): No such node json boost

I am trying to parse below JSON file using boost::property_tree. { "pi": 3.141, "temp": 3.141, "happy": true, "name": "Niels", "nothing": null, "answer": { "everything": 42 }, "list": [ 1, 0, …
user12784615
2
votes
2 answers

INFO Format reference from (boost property tree)

I'm searching for a way to write complex data configurations for my application. I don't really like xml or json for that job for different reasons. But I found a format that is kind of perfect for the job, it's implemented in boost property…
racer
  • 4,497
  • 3
  • 18
  • 13
2
votes
2 answers

How can i decide the datatype Boost Property Tree uses?

I am using the Boost Property Tree for a Project and came across a problem. I'm using it like this: using Namespace boost::property_tree; ptree proot; int myInt = 5; proot.put("Number", myInt); write_json("myjson.json", proot); If I use it like…
xPazone
  • 33
  • 2
2
votes
0 answers

C++ / Boost:: Propery_Tree - Is it possible to take ini config value with dot in name

Here is my code: My Config.h: #include #include namespace pt = boost::property_tree; class Config { public: Config(std::string conf); template T GetConfigValue(std::string…
Venelin
  • 2,905
  • 7
  • 53
  • 117
2
votes
1 answer

Using boost::property_tree::ptree how to get the value of a specific key

How do I parse all the sections that are present in the file and get the value for each key. That is, I have to parse section1, get the value for key1, key2, key3 . Proceed to section2 get the value for key1, key2 and key3. My .ini file looks…
ursd
  • 45
  • 6
2
votes
1 answer

how to create empty array?

It's possible to get following output from boost::property_tree::json_parser::write_json { "id": "id", "method": "test_method", "params": [] } I know how to create array with some items, but when I try to create empty array, I've get…
Aleksey Bakin
  • 1,506
  • 13
  • 27