Re: [Boost-users] [OT] Interested in good (fast, robust)

I'm using json_spirit from http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx for parsing big but simple json files. So far I didn't have any problems with it. It's still based on classic spirit. Don't know if and when it will switch to spirit 2. Rgds Richard On Tue, 2009-12-01 at 12:00 -0500, boost-users-request@lists.boost.org wrote:
Date: Tue, 01 Dec 2009 17:38:36 +0100 From: Sebastian Redl
To: boost-users@lists.boost.org Subject: Re: [Boost-users] [OT] Interested in good (fast, robust) boost-based JSON API Message-ID: <4B15468C.7000309@getdesigned.at> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Dominique Devienne wrote:
Can anyone recommend one such good targeted library up to Boost's standards you've had good success with? (with a boost-like commercial friendly license)
Boost.PropertyTree has some support for parsing and writing JSON, but it doesn't preserve types.
Sebastian

On Tue, Dec 1, 2009 at 1:24 PM, Richard Ulrich
I'm using json_spirit from http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx for parsing big but simple json files. So far I didn't have any problems with it.
One objection I have with json_spirit is that its value is rather heavy memory wise, and also forces initializing all of the members. Maybe that's no longer true, I got the code below in Mar09. I think something boost::variant-based would be more suitable (incorrectly mentioned using tuple in my first post, when I meant variant). --DD namespace json_spirit { enum Value_type { ... }; typedef std::vector< Pair > Object; typedef std::vector< Value > Array; class Value { ... private: Value_type type_; std::string str_; Object obj_; Array array_; bool bool_; int i_; double d_; }; }

On Tue, Dec 1, 2009 at 12:40 PM, Dominique Devienne
On Tue, Dec 1, 2009 at 1:24 PM, Richard Ulrich
wrote: I'm using json_spirit from http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx for parsing big but simple json files. So far I didn't have any problems with it.
One objection I have with json_spirit is that its value is rather heavy memory wise, and also forces initializing all of the members. Maybe that's no longer true, I got the code below in Mar09. I think something boost::variant-based would be more suitable (incorrectly mentioned using tuple in my first post, when I meant variant). --DD
namespace json_spirit { enum Value_type { ... }; typedef std::vector< Pair > Object; typedef std::vector< Value > Array;
class Value { ... private: Value_type type_; std::string str_; Object obj_; Array array_; bool bool_; int i_; double d_; }; }
It has a few other issues as well. I think I commented on that article a while back actually about many of the issues... Mine has no such problems, yes I use Boost.Variant. :)
participants (3)
-
Dominique Devienne
-
OvermindDL1
-
Richard Ulrich