|
Boost Users : |
Subject: Re: [Boost-users] Using property_tree as json reader/writer
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-02-05 07:45:27
On Tue, Feb 5, 2013 at 12:16 PM, niXman <i.nixman_at_[hidden]> wrote:
> Tell me please, anybody trying to use property_tree as json
> reader/writer for tasks more difficult than reading configuration
> files?
>
We tried it in one of my previous jobs.
You have to keep in mind that property_tree is about property trees, not
about json or xml, which mean it don't map completely on these.
> Just wondering if anyone compared the performance of property_tree and
> other parsers?
>
On performance I couldn't tell, it was apparently fast enough for our use.
However, beware, as I said before, it's not a JSon library, which mean it
don't map with all the JSon capabilities.
I used it a lot for different systems which would have data serialized in
xml and
json, matching the capabilities of property tree, so no problem.
But when we tried to use it in systems that implied full JSON capabilities,
like systems related to networking, property_tree was inappropriate.
I dont' remember all the problems we had but one was no way to specify null.
Anyway, just understand that if what you want is a JSON library, use a JSON
library (
http://stackoverflow.com/questions/245973/whats-the-best-c-json-parser)
if you want a tree of properties with simple data in them, and be able to
serialize them, then property_tree is far enough.
Joel Lamotte
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net