17 Nov
2019
17 Nov
'19
3:40 p.m.
Bjorn Reese wrote:
Should there be a JSON archive for Boost.Serialization?
There are many possible ways to write Boost.Serialization JSON archives, depending on the JSON produced. You could for instance output structs as `{ "x": 1, "y": 2 }`, or `[ "x", 1, "y", 2 ]`, or `[ 1, 2 ]`, or even `{ "size": 3, "data": [ 1, 2 ] }`. The first representation is the most natural and human-editable, but can't be deserialized incrementally because the fields can come in any order. (Arrays can also include the size or not.) Assuming we're talking about the first option, it should be possible to use the proposed JSON library to implement a JSON input archive that reads from a json::value. The output archive doesn't really need a library.