boost-propertytree

Boost Property Tree and Xml parsing Problems.

So a quick question i started using boost::property_tree, anyways. The documentation is very vague and overall unhelpful, for the most part. Looking at the source/examples didnt help that much ether. What im wondering is the following: <VGHL> <StringTable> <Language>EN</Language> <DataPath>..\\Data\\Resources\\Strings\\st...

Boost Property Tree with filename as key

I am trying to use filenames as the key in boost::PropertyTree However, the '.' character in a filename such as "example.txt" causes an additional layer to be added within the property tree. The most obvious solution would be to replace '.' with another character, but there is likely a better way to do this, such as with an escape char...

Creating JSON arrays in Boost using Property Trees

I'm trying to create a JSON array using boost property trees. The documentation says: "JSON arrays are mapped to nodes. Each element is a child node with an empty name." So I'd like to create a property tree with empty names, then call write_json(...) to get the array out. However, the documentation doesn't tell me how to create unnam...

Boost PropertyTree library with C++Builder?

Has anyone got tried this or got it working with Embarcadero C++Builder 2010 - If so, what did you need to do? ...

Why boost property tree write_json saves everything as string? Is it possible to change that?

I'm trying to serialize using boost property tree write_json, it saves everything as strings, it's not that data are wrong, but I need to cast them explicitly every time and I want to use them somewhere else. (like in python or other C++ json (non boost) library) here is some sample code and what I get depending on locale: boost::prope...

Updating XML file using Boost property_tree

I have the following XML file: <xml version="1.0" encoding="utf-8"?> <Data> <Parameter1>1</Parameter1> </Data> I want to add a new node: Parameter2="2" to the Data node. This code doesn't work, saved file still contains only one parameter: boost::property_tree::ptree tree; boost::property_tree::ptree dataTree; read...

Adding static member variable to third-party class

I'm using Boost.Property_Tree for a project and I want to add a small bit of functionality to it. I want to add a "fromFile" static member variable that will figure out the file type and then use the proper parser. In my project, this is currently how I've got it. typedef boost::property_tree::ptree ConfigNode; Then I have another cla...

How are attributes parsed in Boost.PropertyTree?

Say I have this XML format: <Widget type="SomeWidget" name="foo"> <Event name="onmouseover"> dostuff(); </Event> </Widget> How do I read the attributes using Boost.PropertyTree? ...

C++: How to create an array using boost::property_tree?

I don't see a way to create an array using boost::property tree. The following code ... #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/json_parser.hpp> #include <iostream> int main() { try { boost::property_tree::ptree props; props.push_back(std::make_pair("foo", "bar")); props.push_back(std::make...