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
0
votes
1 answer

Problem triing to compile basic Boost PropertyTree sample - compilation error. What to do?

So this is official Boost PropertyTree example, I try to compile it on my visual studio 2008 and same on VS2010 get Error C2228: left of '.put_value' must have class/struct/union c:\program files…
Rella
  • 65,003
  • 109
  • 363
  • 636
0
votes
1 answer

How to make boost ptree parse xml and json the same way?

So lets take a look onto a littel bit modified example code: #include #include #include #include #include #include void…
Rella
  • 65,003
  • 109
  • 363
  • 636
0
votes
1 answer

recursively get complete key path to all values in a boost property tree

I'm reading an XML file into a boost::property_tree and trying to get the complete key path for every value. Does boost have a built in way to do this Were is the error in my recursion? example input - my_file.xml abc
J'e
  • 3,014
  • 4
  • 31
  • 55
0
votes
1 answer

Angular PrimeNG pTree TreeNode

How to get the positions of nodes of TreeNode of pTree in Angular as per the hierarchial order in which they are displayed? I am having data of type TreeNode and in the data I am also having children, branched children, any number of branching. How…
0
votes
1 answer

Is there a way to save raw binary data from a registry call to a string without casting it as a string?

I'm working on an utility to hook various bits of the Windows API used by different applications. The aim of the project is, at the moment to make any application portable by redirecting filesystem and registry calls to custom locations using…
enzeinzen
  • 11
  • 4
0
votes
0 answers

I have a Huge XML File of which I want to read its childtrees into the C++ boost::property_tree::pTree type

The normal way of doing it is using boost::property_tree::ptree pt1; boost::property_tree::read_xml( XML_FILE_PATH, pt1 ); But what this does is that it reads the entire XML File, which is really huge in the pt1 So I think it is inefficient when…
rrajanuk
  • 27
  • 8
0
votes
2 answers

Boost.PropertyTree doesn't release memory in destructor

I test the following code #include namespace pt = boost::property_tree; int main() { { //1 pt::ptree xml; pt::read_xml("very_big_xml.xml", xml); // xml.clear(); //destructor should do the job } …
Mariusz Jaskółka
  • 4,137
  • 2
  • 21
  • 47
0
votes
0 answers

Faulty JSON is getting generated using boost::property_tree::ptree

I am using boost::property_tree::ptree to add data and create JSON file. The following is the recursive code that I have written - using Strings = vector; Strings _headers; map _subHeaders; namespace pt =…
Harshu
  • 91
  • 9
0
votes
1 answer

Does boost::property_tree::xml_parser::read_xml preserve the order?

Considering the following xml element: Concerning the property tree populated by boost::property_tree::xml_parser::read_xml, is it guaranteed that sub_elem "first" will be…
FlashMcQueen
  • 635
  • 3
  • 13
0
votes
2 answers

PrimeNG p-tree: How to hide certain node from ptree on basis of a boolean value coming from json file?

I am using primeng tree to display json data like this: The JSON data is being read into dataToDisplayFromConfig. I want to make certain nodes…
Anamika Yadav
  • 63
  • 1
  • 6
0
votes
0 answers

boost::Property_tree cannot write double values

I have a simple ptree with some values and want to output it in a file for debug reasons. But whenever I want to write double values it throws a bad any cast exception. Am I missing something? property_tree::ptree obj; …
Börkn
  • 38
  • 6
0
votes
1 answer

Boost Ptree Custom Sort

I want to use this Function and make a custom sorting function, but I don't know how the Compare Function works or with a lambda. Could someone be so kind to give me a working example for using it. /* Sorts the direct children of this node according…
MarcelIsi
  • 19
  • 4
0
votes
1 answer

Boost.PropertyTree crash when iterating over some empty trees

Looping over the children of an empty Boost.PropertyTree is usually a no-op: ptree empty; for (auto const& elements : empty) { std::cout << "child\n"; // Executed 0 times, as expected } but sometimes it crashes with an access violation : ptree…
MSalters
  • 173,980
  • 10
  • 155
  • 350
0
votes
0 answers

boost ptree read_ini crashes standalone application

I am using CodeBlocks and wxWidgets with minGW compiler on Windows. Under project's build options->search directories->compiler I have boost root folder, and under resource compiler wxWidgets-3.1.2/include folder. When running application through…
user3007875
  • 123
  • 7