JSON is a lightweight data exchange format than XML. for basic JSON knowledge, see JSON
Http://www.json.org/json-zh.html
See if JSON support is available in your language, as well as the JSON http://www.json.org/json-zh.html.
Cjson is a JSON decoder in C language. It is very lightweight and has only over 500 lines of C files, and the speed is also ideal. Project homepage: cjson | free software downloads at SourceForge. nethttp: // sourceforge.net/projects/cjson/
Cjson also has several vulnerabilities:
1 does not support [1, 2, 3,] and {"one": 1,} The Last unused comma. This is supported by the C language. This is not described in the json rfc document. It can only be said that this is an extended function.
2./* Comment */and // single line comment are not supported. This is also an extended feature. C/C ++/Java/JavaScript all support annotation, so I also want to write some annotation in the JSON file.
3. A global variable is used to indicate the error location. This is a problem with multithreading.
4. The file is not encapsulated. You need to read and write the file yourself.
Although the function is not very powerful (the above 124 is very easy to add a few lines of code can be supported), but the cjson slimming board and speed are the most commendable. Its code is well maintained and its structure is easy to understand. It can be used as a very good C Language Project for learning (the above 12 functions can be used as a job after learning ). The core of its resolution is through recursive functions, but it is assured that every function is very resource-saving.
For example, [1, "two", {"three": 3, "3": true}] The JSON object uses cjson to parse the data structure in the memory.
JSON-C is another C language project that provides all the functions and even supports single quotes, but the structure is more complex than cjson. The core function used to parse strings is not implemented recursively. A maximum of 32 layers of groups or object nesting are supported (how complicated is it to use such multi-layer JSON objects ???), When parsing, a bunch of statuses are used to jump, and the Level Jump is added, it is easy to get dizzy during reading.
JSON-C Project homepage: jehiah/JSON-C-GitHub https://github.com/jehiah/json-c
Autoit JSON support-livemylife.cn-blog channel-csdn. net
Http://blog.csdn.net/wadefelix/article/details/6220421