boost-propertytree Questions
1
Solved
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& getSu...
Phenology asked 2/4, 2014 at 12:27
1
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 wh...
Calypso asked 4/3, 2013 at 5:24
2
Solved
I am using boost 1.55.0 on ubuntu 12.04lts with clang 3.4.
I have a boost::property_tree::ptree whose xml input looks like:
<root>
<persons>
<person>
<name>dad</name...
Storekeeper asked 29/1, 2014 at 9:56
2
I am using boost ptree to read an xml file like this:
ptree myTree;
... /*open xml file*/
try{
myTree.get<string>(s);
}
catch(boost::exception const& ex)
{
/*get useful info!*/
}
I kn...
Ln asked 22/7, 2013 at 5:55
3
Solved
First of all I shall say that I think I got how it should be done but my code will not compile any way I try. I based my assumption on this official example of empty ptree trick. There you can find...
Dragonfly asked 11/7, 2011 at 20:49
2
Solved
UPD I've found answer to "formatting" issue here, so I remove this part of the question, please read updated question:
I need to write xml to file system on c++.
I've learned this titorial. In the...
Manvel asked 18/9, 2013 at 14:47
1
Solved
I'm trying to parse JSON using Boost's property_tree parser and from C++11 code (my system is Debian Wheezy with gcc 4.7.2 and Boost 1.49). I tried the following code based on Serializing and deser...
Indican asked 31/8, 2013 at 20:18
2
I need to add unnamed nodes to a boost::property_tree::ptree just like it's JSON parser does for arrays. However when I want to do it I get such assertion during runtime:
Assertion failed: !p.emp...
Strap asked 11/11, 2011 at 15:56
1
Solved
I have a file containing some JSON content that looks like:
{
"frame":
{
"id": "0",
"points":
[
[ "0.883", "0.553", "0" ],
[ "0.441", "0.889", "0" ],
]
},
"frame":
...
}
How do I pars...
Monika asked 15/6, 2013 at 14:25
1
I have found that boost::property_tree::ptree has an enormous memory overhead. My estimate is that an empty ptree is about 150 bytes, and, any entry put in a ptree adds at least another 150 bytes. ...
Slacker asked 25/5, 2013 at 2:18
1
Solved
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...
Christyna asked 13/5, 2012 at 0:48
2
Solved
I have a sample json record that I have parsed via boost json parser and saved it to boost property tree to get all key value pairs.ia following code I am able to get first attribute of tree but ho...
Stockholder asked 29/11, 2012 at 11:31
2
Solved
I tested boost::property_tree and it was good: I can load an XML, extract the elements, save the XML, etc. But, is it possible to generate an XML and print it? I don't want to save it.
void debug_...
Konstanz asked 11/3, 2013 at 5:51
1
Solved
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:...
Snowdrop asked 3/1, 2013 at 13:53
1
Solved
I have an XML structure along the lines of:
<root>
<SomeElement>
<AnotherElement>
<ElementIWant x="1" y="1"/>
</AnotherElement>
</SomeElement>
<SomeEle...
Belmonte asked 28/12, 2012 at 12:22
1
Solved
I'm building an application that gets movie information from themoviedb.com. The information is provided in a JSON file. I'm trying to store the information using boost property tree. But There is ...
Plassey asked 20/12, 2012 at 12:29
1
Solved
Boost property tree seems like an excellent library to use for parsing config files. However, I can't figure out how to handle situations where there are multiple values per key. For example, let's...
Claimant asked 25/10, 2012 at 16:7
1
Solved
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...
Maximamaximal asked 9/2, 2012 at 17:49
2
Solved
I have the following XML file and I want to store it using the below structures.
the data structs:
struct transitions
{
string oldstate;
string event;
string newstate;
};
struct XML_Diagr...
Gurney asked 1/1, 2012 at 18:7
2
Solved
I have read through the documentation for boost::property_tree and have not found a way to update or merge a ptree with another ptree. How do I do this?
Given the code below, how would the update_...
Xanthic asked 16/11, 2011 at 15:26
2
Solved
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.Pr...
Onus asked 11/9, 2010 at 9:18
2
I've often come across APIs that allow users to get and set various parameters that control a module's operation. I now find myself contemplating writing yet another properties API but don't want t...
Kelila asked 26/4, 2011 at 8:1
3
Solved
I was looking for a solution to store program settings or options or configuration in C++. These could be settings that are exposed in a GUI and need to be saved between runs of my code.
In my sea...
Photographic asked 9/5, 2011 at 23:53
3
Solved
I am sorry, I asked a question about the same topic before, but my problem concerns another aspect of the one described there (How to iterate a boost...).
Take a look at the following code:
#incl...
Johnathanjohnathon asked 4/1, 2011 at 18:30
1
Solved
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>
#includ...
Chipboard asked 20/9, 2010 at 12:14
© 2022 - 2024 — McMap. All rights reserved.