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

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…
Jonathan Sternberg
  • 6,421
  • 7
  • 39
  • 58
1
vote
1 answer

Simple way to model JSon in C++

I need to model a JSon in C++. Firstly I thought about: boost::property_tree But unfortunately - it does not care about JSon types. Integers are represented as strings - and it is not an option. The second idea would be: boost::variant with…
Dejwi
  • 4,393
  • 12
  • 45
  • 74
1
vote
1 answer

Boost json parser with a ptree within a ptree

So I am working on an assignment and I need to parser several properties into a json to send over a network. Here is what the final value should look…
lesyriad
  • 21
  • 1
  • 2
1
vote
1 answer

Boost XML parser RAM consumption

I decided to check memory usage of PropertyTree for XML parsing with this piece of code. The XML has something over 120M, but this program was consuming over 2G when I decided to kill it. Is this standard consumption of PropertyTree or there is…
user965748
  • 2,227
  • 4
  • 22
  • 30
1
vote
2 answers

boost property tree cannot read multiple json data in one file

I really need to get help to decide my problem. I am using boost property tree to parse twitter messages that is stored in json file. All messages are saved in one json file and I need to parse all one by one. Here is the twitter json data saved…
Edy
  • 11
  • 2
1
vote
0 answers

How to manually create a boost ptree?

I've been using boost libraries to parse XML files and I have to create a ptree manually. I need to add several children with the same tag name to the ptree. I've tried with put, add_child and put_child, but I can't make it. The ptree that I need…
Javier Buzano
  • 103
  • 1
  • 6
1
vote
0 answers

Disable exception working for boost::smart_ptr but not for boost::property_tree

I'm using boost 1.57. I need to disable exception support in my not widely-used proprietary compiler. When I needed to use boost::smart_ptr, the following steps worked like a charm: Disabled C++11 support using the following user.hpp file…
Valmir
  • 401
  • 1
  • 5
  • 14
1
vote
1 answer

Get value from json using ptree in c++ if key name is with dots(.)

I tried using ptree to fetch value of key in c++ for key name having multiple . in keys. so I have json, "product": { "product.description.text": "Some text here" } I tried calling std::string product =…
1
vote
1 answer

Boost property tree specify allowed values

I wanted to use boosts property tree as handling the settings of my c++ app since it seems to be widely used in this scenario. My question: when changing values in the property tree (through xml parsing or manually), is there a way to specify a list…
KO70
  • 189
  • 2
  • 15
1
vote
1 answer

Read & Parse a JSON file c++ BOOST

As there is a lot of questions already on this, I am kind of apprehensive about asking... but I've looked at many different Questions and nothing from any of them is working for me. I have this code as my attempt but it doesn't work: #include…
MLMLTL
  • 1,519
  • 5
  • 21
  • 35
1
vote
1 answer

Boost Property Tree: Where have my escape sequences gone in JSON String?

I am using boost for creating JSON string. I am trying to send this JSON string to server via http POST. Following is the string created by…
K.K
  • 401
  • 5
  • 22
1
vote
1 answer

Boost read_xml issue parsing string?

I'm trying to parse this string and retrieve the "sid" and the "Type". I have the following code. It is crashing at the get_child line and I'm not entirely sure why... const boost::property_tree::ptree& empty_ptree(){ static…
Suzan Aydın
  • 355
  • 6
  • 17
1
vote
1 answer

Parse .ini file from resource during runtime using C++/boost

I have an .ini file which is located inside the resource as an RCDATA. I load it from the resource during runtime, and I am able to get it as a very long string. I am interested of loading the .ini file (from the resource at runtime) and parse it as…
OhadM
  • 4,687
  • 1
  • 47
  • 57
1
vote
1 answer

how get name-value pair when creating JSON string from using JSON boost serialization?

Before answering this question I would request all you good people here to first take a look at this output that I am getting presently. The output is fetched from a sqlite3 table SiteCode which has two columns ID and Code. Although, I go the output…
K.K
  • 401
  • 5
  • 22
1
vote
2 answers

Serializing std::list into json with boost ptree

okay, so I am banging my head on this for last couple of days but still I am unable to get it right. I have a std::list container and I want to serialize it into JSON string so that I can send it over network. NOTE: I compile my code using…
K.K
  • 401
  • 5
  • 22