A super easy to use, platform-independent C++ JSON library with no dependencies beyond the standard libraries, no annoying make files, no installation of any other software needed. Read up on the JSON format here: http://json.org
Read the README.txt file for usage and examples.
LAST UPDATED: 8/31/2014 (see README.txt for changelog)
- Easy to use
- Platform independent
- No dependencies other than the standard libraries
- No nerdy makefiles
- No need to install other software to build the library
- Familiar std::map and std::vector-like usage
Simple and no dependencies, great for when you just need JSON and don't care how many microseconds it takes. Unfortunately it's not entirely platform-neutral, `std::string::_Copy_s` is a Microsoft-ism that had to be replaced with portable code, but that was the only such problem.
Pretty decent. Doesn't properly deal with escaped back slashes before endquotes: ["this will break it\\"] also unexpected string termination results in a memfault... It copies like it's it's job, basically nothing is passed by reference. Also when string unescaping was added, no complimentary escaping was added. Additionally, the new JSON standard allows all values to be top level, so things like 34 should now be allowed as valid JSON but this enforces the top level values as arrays or objects
Putting this here in case it helps anyone: I'm developing with VS2013 and I needed to change line 15 of json.cpp from: #define _stricmp strcasecmp to #define strcasecmp _stricmp other than that it seems to work just fine for me
easy, fast and works
Ok for testing. Now for a real job, it's a little short: (1) Need a delete function for removing items from arrays or object (2) Need a support for pointers: This is very important for applications that modify the json data. If a do json::Array *Ar = new json@Array; I can do: Ar->push_back("truc"); fs = json::Serialize(*Ar); (*Ar) = "Machin"; fs = json::Serialize(*Ar); The last two should be handled with a better syntax. Now the real issue is if I were willing to modify a complex json tree. For instance having an object that contains an array; if i do: json::Array R = myVal.ToArray; and then modify the array R, my value is not modified because R contains a copy of the array that is inside the value. Like when working with XML nodes, it is necessary to get a pointer to the item I want to modify. Apparently I didn't find a way to do that. (3) The documentation is far from what is needed to easily use the library. It is even misleading. When saying "An object is just a pair of key/values" this is wrong. The object is the container containing such pairs.