Project

General

Profile

Convert C++ objects to JSON

Added by w asla over 8 years ago

Is there something in Wt that I can use to convert C objects to JSON ? Could it be we have such a capability but I'm missing it ?


Replies (1)

RE: Convert C++ objects to JSON - Added by Roel Standaert over 8 years ago

Wt has two implementations of JSON serialization:

  • The Wt::Json library. This library allows you to serialize Objects (implemented as std::map<std::string,"Wt::Json::Value":https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1Json_1_1Value.html >) and Arrays (implemented as std::vector<Wt::Json::Value>).
  • As part of Dbo, there's jsonSerialize, which you can use to serialize Dbo objects to Json.
    (1-1/1)