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.

287 questions
7
votes
2 answers

Boost Property Tree and Xml parsing Problems

I'm using boost::property_tree. The documentation is very vague and overall unhelpful for the most part. Looking at the source/examples didn't help that much, either. What I'm wondering is the following:
UberJumper
  • 17,305
  • 17
  • 62
  • 86
7
votes
3 answers

omit xml declaration when saving xml with boost

Is it possible, via the xml_writer_settings used as third parameter in the write_xml call, to omit the xml declaration when the function saves the xml? I mean, I would like not to have the initial "xml version="blah" encoding="blah blah" part. I'm…
Magallo
  • 196
  • 2
  • 14
6
votes
1 answer

C++ Boost Property Tree Update Existing Node By Attribute Qualifier

Ok, so here's a sample of the XML structure: actual value
CapersL
  • 174
  • 2
  • 7
6
votes
0 answers

Any standard library implementation for boost::property tree

Is there an alternative to to "boost/property_tree" ? Actually I'm trying to remove all boost implementations of C++ and use standard library functions. I've been able to find alternatives to some other implementations of boost C++ but none so for…
Mayank Jha
  • 621
  • 2
  • 7
  • 18
6
votes
2 answers

where is boost property_tree::empty_ptree?

I'm using boots's property_tree library. I'm looking for a way to get a child node from a ptree object, but return an empty ptree if failed. I came across a nice example in property_tree/examples/empty_ptree_trick.cpp: void process_settings(const…
bavaza
  • 8,590
  • 10
  • 54
  • 88
6
votes
2 answers

How to convert class object to json string using boost library in C++?

I am fairly new to C++ and I apologise beforehand if you find this very easy. I have the following files POST1.h #ifndef POST1_HH #define POST1_HH #include #include #include…
K.K
  • 371
  • 3
  • 21
6
votes
1 answer

Boost: How to get a subtree form an existing property tree?

I am trying to get a subtree from a boost::ptree using get_child like this: I have: class ConfigFile { ptree pt; ConfigFile(const string& name) { read_json(name, pt); } ptree& getSubTree(const string& path) { ptree spt =…
thedarkside ofthemoon
  • 2,041
  • 4
  • 26
  • 44
6
votes
3 answers

performance is very bad to construct boost property tree from json file?

I am using boost property tree to load/dump json file. However, the performance is very bad. For example, I have a json file whose size is 1.8M. The boost C++ program spends 3 seconds to load the json file and construct the property tree. If I use…
limi
  • 832
  • 7
  • 18
6
votes
1 answer

Checking if a value in a boost property tree is a tree or a terminal value

I have been looking for APIs in boost::property_tree (that is used for reading a json) that I can use to determine if a value of a field is a tree or a terminal value. For example, I have a json where the value of foo can either be a tree as…
rama44ster
  • 71
  • 1
  • 4
6
votes
1 answer

Concurrency problems wih Boost Property tree

I developed a simple wrapper that encapsulates a JSONObject with Boost Property trees. The problem is a segmentation fault in this code: void JSONObject::parse(const std::string &text) { std::istringstream ss(text); …
mariolpantunes
  • 1,073
  • 2
  • 13
  • 27
6
votes
4 answers

Boost property tree: Remove a node

How would you remove a node from boost xml property tree? I have a document like this: some/folder some/folder some/folder I know how to itereate and print all folders,…
Rasmus Styrk
  • 1,145
  • 2
  • 19
  • 33
6
votes
1 answer

Boost property tree issue when converting to Unicode

Ok, first off I'm not a C++ developer by nature; I've managed to put some stuff together and it works fine, but I'm sure through the eyes of an expert it looks like garbage =) So I have a freeware app that I've made which uses Property Tree from the…
CapersL
  • 174
  • 2
  • 7
5
votes
1 answer

iterate through boost property tree

I'm iterating over an XML document using boost property tree and storing the results in a struct. The issue I have is that I can only get to the first "item" nodes and can't access the second "item" nodes. I was hoping someone would point out where…
01100110
  • 2,128
  • 3
  • 21
  • 31
5
votes
1 answer

Crash in boost::coroutine library when used alongside boost::property_tree XML parser

I'm using Simple-Web-Server library for creating simple web service for translation of XML to JSON and vice versa. On its turn it uses several boost libraries as well boost::coroutine among them. For XML<->JSON conversion I'm using…
bobeff
  • 2,800
  • 1
  • 26
  • 51
5
votes
1 answer

How to output boost property tree as JSON encoded string?

Sometimes it is very useful to create JSON encoded strings for representing and exchanging data. What is be best way of encoding a Boost property tree into a JSON string?
Fernando
  • 1,287
  • 1
  • 10
  • 28
1 2
3
19 20