Boost logo

Boost :

Subject: Re: [boost] JSON Parsing Library for GSoC 14
From: Bjorn Reese (breese_at_[hidden])
Date: 2014-03-06 10:38:41


On 03/06/2014 02:35 PM, TONGARI J wrote:

> I'm confused. Your json::iarchive takes iterators not istream.
> I see there's stream_oarchive but no stream_iarchive, something I missed?

I have not needed stream_iarchive so far. But you are right, it should
be added.

> After a glance at some of the tests, say, the 'person' example
> in oarchive_suite.cpp, I wonder why it outputs value as array instead of
> object:
>
> {"name": "Kant", "age": 127}

NVP are intended for XML tags. As JSON has no tags, the name is
ignored. This was an arbitrary design choice that I am willing to
reconsider.

>> Another suitable GSoC project (for the student who wants to do meta-
>> programming) could be to write a more generic version of dynamic-cpp.
>> I have already written parts of it.
>
>
> What's the benefit of dynamic-cpp over Boost.Any?
> If you want more generic, I guess that's what Boost.TypeErasure is for.

Good question, and you can add Boost.Variant to that list. Alex
Fabijanic has written a good two-part article on the topic in ACCU
Overload:

   http://accu.org/index.php/journals/1855
   http://accu.org/index.php/journals/1841

With regards to using dynamic-cpp (or a generalization thereof) as a
JSON DOM, when you read a generic JSON document, you normally want to
investigate the type of its elements. That is a challenge when the type
has been erased.

I personally use dynamic-cpp because I prefer its syntax.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk