
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. :)