Using property_tree as json reader/writer

Hi, Tell me please, anybody trying to use property_tree as json reader/writer for tasks more difficult than reading configuration files? Just wondering if anyone compared the performance of property_tree and other parsers? Thanks.

On Tue, Feb 5, 2013 at 12:16 PM, niXman
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

Another problem is that it's a pain to store arrays.
On Tue, Feb 5, 2013 at 8:45 PM, Klaim - Joël Lamotte
On Tue, Feb 5, 2013 at 12:16 PM, niXman
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.

2013/2/5 Klaim - Joël Lamotte:
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.
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
Thank you for explanation, Joel. -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/

On 2/5/13 7:16 PM, niXman wrote:
Hi,
Tell me please, anybody trying to use property_tree as json reader/writer for tasks more difficult than reading configuration files? Just wondering if anyone compared the performance of property_tree and other parsers?
FYI, Spirit has a complete JSON parser in the examples (trunk). Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

2013/2/6 Joel de Guzman:
FYI, Spirit has a complete JSON parser in the examples (trunk).
It's great! I copied source codes of JSON parcer in the project, and tried to parse some structures. Everything works perfectly! But the most convenient in my opinion, so this creation of JSON objects. Joel, tell me please, this code is planned to make as public part of boost? -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/

On 02/06/2013 10:34 AM, niXman wrote:
2013/2/6 Joel de Guzman:
FYI, Spirit has a complete JSON parser in the examples (trunk).
It's great!
I copied source codes of JSON parcer in the project, and tried to parse some structures. Everything works perfectly! But the most convenient in my opinion, so this creation of JSON objects.
Joel, tell me please, this code is planned to make as public part of boost?
Hello niXman - The code is part of the Ciere JSON library. We are putting together some documentation and will be providing it as an open source library under the Boost license. The library has been used in production code for over a year. Our main interface requirement was to have the JSON value object behave as if it were a Python or JavaScript manipulation of JSON. With some luck, we will make the library available this month along with a YAML library. michael -- Michael Caisse ciere consulting ciere.com

2013/2/6 Michael Caisse:
The code is part of the Ciere JSON library. We are putting together some documentation and will be providing it as an open source library under the Boost license.
The library has been used in production code for over a year. Our main interface requirement was to have the JSON value object behave as if it were a Python or JavaScript manipulation of JSON.
With some luck, we will make the library available this month along with a YAML library.
Hello Michael, This is really great news! Thank you. -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/

2013/2/6 Michael Caisse:
Hello niXman -
The code is part of the Ciere JSON library. We are putting together some documentation and will be providing it as an open source library under the Boost license.
The library has been used in production code for over a year. Our main interface requirement was to have the JSON value object behave as if it were a Python or JavaScript manipulation of JSON.
With some luck, we will make the library available this month along with a YAML library.
P.S. I think it would be great to be able to use the path to prefixes. example: const bool exists = value.has_key("server.modes.debug"); The same applies to the: value::get() value::get_as() value::set() value::operator(). What do you think about this? -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/

On 06-02-2013 19:42, Michael Caisse wrote:
On 02/06/2013 10:34 AM, niXman wrote:
Hello niXman -
The code is part of the Ciere JSON library. We are putting together some documentation and will be providing it as an open source library under the Boost license.
That's great. Many of the other libs have unusable licences. One problem though: lack of utf8 support is really a deal-breaker for us. -Thorsten

On 02/07/2013 01:18 AM, Thorsten Ottosen wrote:
On 06-02-2013 19:42, Michael Caisse wrote:
On 02/06/2013 10:34 AM, niXman wrote:
Hello niXman -
The code is part of the Ciere JSON library. We are putting together some documentation and will be providing it as an open source library under the Boost license.
That's great. Many of the other libs have unusable licences.
One problem though: lack of utf8 support is really a deal-breaker for us.
-Thorsten
The Ciere JSON and YAML libraries both support utf8. michael -- Michael Caisse ciere consulting ciere.com

On 07-02-2013 10:41, Michael Caisse wrote:
On 02/07/2013 01:18 AM, Thorsten Ottosen wrote:
That's great. Many of the other libs have unusable licences.
One problem though: lack of utf8 support is really a deal-breaker for us.
-Thorsten
The Ciere JSON and YAML libraries both support utf8.
Cool. Looking forward to seing it. -Thorsten
participants (6)
-
Joel de Guzman
-
Klaim - Joël Lamotte
-
Michael Caisse
-
niXman
-
Thorsten Ottosen
-
☂Josh Chia (谢任中)