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

Boost property tree (XML) remove blank lines

I am using boost::property_tree to read and write xml configuration files. I want to change the value of some tags in my code and write them back to file, with some reasonable xml formatting (new lines, indenting, etc.). Currently I am…
mattu
  • 944
  • 11
  • 24
1
vote
1 answer

Accessing multi-valued keys in Property Tree

I am trying to query multi-valued keys in Property Tree. I have taken the reference from this SO link. Here is a piece of my Xml: 1920
Hummingbird
  • 647
  • 8
  • 27
1
vote
1 answer

Strip emojis from Telegram bot update

I want to remove the emojis from a json Telegram bot update parsed with boost property tree I tried to use the regex pattern from this answer and a few others but I'm not sure how to get them to work in C++ (the below causes a…
JFB
  • 13
  • 4
1
vote
1 answer

Property tree: complete path and name

I'd like to create a class that can be constructed from a property tree, as in this example: testing
senseiwa
  • 2,369
  • 3
  • 24
  • 47
1
vote
1 answer

How do I extend boost property_tree to handle custom types?

Boost PropertyTree allows serialization of custom types by providing a specialization of translator_between, but I couldn't find any documentation, and the code can be quite cryptic.
Andreas Haferburg
  • 5,189
  • 3
  • 37
  • 63
1
vote
1 answer

boost property tree add_child specifying the path

I'm using boost::property_tree to manipulate some XML. I have to add a subnode to an xml document The xml document looks like so:
stack user
  • 835
  • 1
  • 9
  • 28
1
vote
1 answer

Boost property tree xml parsing No such node ()

I'm trying to parse an XML file using the boost/propert_tree library. I can get the xml file correctly and everything, but when I look for childs, it doesn't find any. I have an input.xml file:
lpares12
  • 3,504
  • 4
  • 24
  • 45
1
vote
2 answers

Parse hex numbers along with decimal numbers from XML with boost::property_tree

I am parsing an XML file with boost::property_tree. The data I need to parse includes regular decimal numbers such as 42 and hex numbers such as 0xF1. For example: 0xF1 42 It's easy to parse decimal numbers and convert them to…
Null
  • 1,950
  • 9
  • 30
  • 33
1
vote
1 answer

Boost XML parser can support ?

I had able to read the XML file using boost and writing the same content to another file . while writing to another file this would changes to below format. This is Test
Munipratap
  • 529
  • 5
  • 9
1
vote
1 answer

XML version and encoding from boost ptree

I am using boost ptree to parse xml read_xml(stream, pt, trim_whitespace | no_comments); ..... How to read the version and encoding of the xml : I tried the…
Hummingbird
  • 647
  • 8
  • 27
1
vote
1 answer

How to decode an std::string formated JSON into a Boost Property tree?

Suppose that I'm receiving a JSON formated string from network and want to decode it in a Boost Property tree. What the best way of doing that?
Fernando
  • 1,477
  • 2
  • 14
  • 33
1
vote
0 answers

Passing boost::filesystem::path objects to boost::property_tree:xml_parser

I've been having a great deal of trouble in getting boost::property_tree::xml_parser to play nicely with boost::filesystem::path objects. IN the project I'm currently working on, I'm attempting to gather a set of xml files from a particular…
1
vote
1 answer

Forward declaration of typedef

I have the following code: namespace boost { namespace property_tree { template class basic_ptree; typedef basic_ptree > ptree; …
JosephConrad
  • 678
  • 2
  • 9
  • 20
1
vote
0 answers

Boost function "boost::property_tree::ini_parser::read_ini" causing "EXC_BAD_ACCESS (code=EXC_I386_GPFLT)"

I have a simple source like this that build and executes correctly under Windows 10 with Visual Studio 2015 but throws "EXC_BAD_ACCESS (code=EXC_I386_GPFLT)" under OsX 10.11.3 with Xcode 7.2.1: #include #include…
Andrea Giovacchini
  • 5,027
  • 3
  • 21
  • 23
1
vote
1 answer

Parsing xml file with boost property_tree and put selected content to a std::map

From a java property XML file I want to find each element named entry (inside the root element properties). Then put the content of its attribute key in a std::map as key and the content of the element (between and…
tzippy
  • 6,458
  • 30
  • 82
  • 151