Naughter Software Logo

JSON++ v1.15 A set of C++ classes to support JSON / JSON5

I have been working with JSON recently in a number of C++ projects and wanted to learn it by understanding the JSON specification by writing my own JSON parser / encoder. There are a number of nice JSON libraries for C++ out there such as SimpleJSON and JSON for Modern C++. I particularly liked the SimpleJSON library which was able to implement a nice JSON parser / encoder in c. 1500 lines of code. I decided to write my own class based on SimpleJSON but using some modern C++ features such as r-value references, move constructors and operator=. Thus was born JSON++. Included in the download is the JSON++ source code and a VC 2017 application to fully exercise all the functionality of JSON++. The main class provided is CValue and is implemented in a JSONPP namespace. All the constructors of the CValue class allow a JSON value object to be constructed directly from other C++ types such as bool, double, long, STL strings, STL vectors, STL maps etc. Standard C++ operator= methods are also provided which mirror the constructor methods. The class also supports construction and assignment from C++ r-value references. A "Parse" method of CValue allows a JSON encoded string (either UTF8 or UTF16) to be parsed into the CValue instance. An "Encode" method allows a JSON encoded string in the form of a std::wstring to be created from a CValue instance. Various other CValue methods are modeled on the SimpleJSON classes.

 

Features

 

The enclosed zip file contains the JSON++ source code and a VC 2017 console based application which exercises all of the JSON++ functionality.

 

Copyright

 

Usage

 

Updates

v1.15 (9 July 2023)

v1.14 (12 May 2023)

v1.13 (22 April 2022)

v1.12 (29 January 2022)

v1.11 (2 November 2021)

v1.10 (23 May 2020)

v1.09 (29 January 2020)

v1.08 (16 December 2019)

v1.07 (3 August 2019)

v1.06 (22 April 2019)

v1.05 (2 September 2018)

v1.04 (31 July 2018)

v1.03 (30 June 2018)

v1.02 (29 May 2018)

v1.01 (10 January 2018)

V1.0 (25 November 2017)