This code implements a naive JSON writer in C++ complying with RFC 4627. I wrote this as I believe it is a very good example of a real life problem involving lots of C++ constructs. This sample only supports writing JSON and does not support heterogenous ‘object’ serialization and extension are left as an exercice. See Writing json in C++ for some details.
json_stream
: astd::ofstream
wrapper fulfilling RFC 4627 constraints;utf8_json
: some code to decode/“json encode”std::string
UTF-8 buffersjson_test.cpp
: a very simple program testing the code