Boost logo

Boost :

From: Hans Dembinski (hans.dembinski_at_[hidden])
Date: 2020-09-21 17:57:25


> On 21. Sep 2020, at 19:44, Vinnie Falco via Boost <boost_at_[hidden]> wrote:
>
> On Mon, Sep 21, 2020 at 10:29 AM Mathias Gaunard
> <mathias.gaunard_at_[hidden]> wrote:
>>>> In both cases, I'd like to read/write my data from/to JSON with the
>>>> same framework.
>>>
>>> Why? What specifically, is the requirement here?
>>
>> What I'd like is a way to describe how my C++ types map to a key-value
>> structure with normalized types so that I can easily convert my
>> objects back and forth through a structured self-describing and
>> human-readable interchange format.
>
> Right, but what I'm asking you is: *specifically* in what way would a
> framework that offers both JSON DOM and JSON Serialization be
> "consistent?" Can you show in terms of declarations, what that would
> look like? In other words I'm asking you to show using example code
> how putting these two separate concerns in a single library would
> offer benefits over having them in separate libraries.

The Boost.Serialization framework is able to do both. The two things needs are
a) a JSON archive that follows the Archive concept
b) a serialize function for json::value

Once you have these two, you can convert the DOM type and/or any custom type to JSON and back.


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