Boost logo

Boost :

Subject: [boost] [Boost.serialization] - Json Serialization (Marshalling and unmarshalling)
From: Demetrio Car (demetrio.pepi_at_[hidden])
Date: 2011-09-02 17:07:53


I need some example of how to serialize/deserilize from Json format to
Object and from Object to Json. I used this example
http://www.boost.org/doc/libs/1_47_0/libs/serialization/doc/index.html, but
it only serialize to a simple text. In my project, for other requirenments,
I am using boost library with success. I am almost sure that I do need some
other specific library like Json-Spirit or standard QT library
(QScriptEngine). Any simple example will be very appreciate.

This is an example of the Json files I must serialized to a class.

[{"DscTipoEstrutura":"Unidade de
Neg\u00f3cio","FlgAtivo":true,"IdDominio":1,"IdTipoEstrutura":1,"NroOrdem":0},{"DscTipoEstrutura":"Regi\u00e3o","FlgAtivo":true,"IdDominio":1,"IdTipoEstrutura":2,"NroOrdem":1},{"DscTipoEstrutura":"Distrito","FlgAtivo":true,"IdDominio":1,"IdTipoEstrutura":3,"NroOrdem":2}]

Ps.: I found http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx and
http://boost-spirit.com/repository/applications/show_contents.php similiar
to I need but, because I am C++ begnnier, I couldn't understand them neither
run the example after some couple of hours. I need some simple example.


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