Lines Matching +full:json +full:- +full:buffer
3 Ultralightweight JSON parser in ANSI C.
8 * [Welcome to cJSON](#welcome-to-cjson)
10 * [Copying the source](#copying-the-source)
15 * [Including cJSON](#including-cjson)
16 * [Data Structure](#data-structure)
17 * [Working with the data structure](#working-with-the-data-structure)
18 * [Basic types](#basic-types)
21 * [Parsing JSON](#parsing-json)
22 * [Printing JSON](#printing-json)
27 * [Zero Character](#zero-character)
28 * [Character Encoding](#character-encoding)
29 * [C Standard](#c-standard)
30 * [Floating Point Numbers](#floating-point-numbers)
31 * [Deep Nesting Of Arrays And Objects](#deep-nesting-of-arrays-and-objects)
32 * [Thread Safety](#thread-safety)
33 * [Case Sensitivity](#case-sensitivity)
34 * [Duplicate Object Members](#duplicate-object-members)
35 * [Enjoy cJSON!](#enjoy-cjson)
41 > Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
68 JSON is described best here: http://www.json.org/
69 It's like XML, but fat-free. You use it to move data around, store things, or just
74 in one of two modes: Auto and Manual. Let's have a quick run-through.
76 I lifted some JSON from this page: http://www.json.org/fatfree.html
78 philosophy as JSON itself. Simple, dumb, out of the way.
106 …cjson` and the libraries to `/usr/local/lib`. It also installs files for pkg-config to make it eas…
110 * `-DENABLE_CJSON_TEST=On`: Enable building the tests. (on by default)
111 * `-DENABLE_CJSON_UTILS=On`: Enable building cJSON_Utils. (off by default)
112 * `-DENABLE_TARGET_EXPORT=On`: Enable the export of CMake targets. Turn off if it makes problems. (…
113 * `-DENABLE_CUSTOM_COMPILER_FLAGS=On`: Enable custom compiler flags (currently for Clang, GCC and M…
114 * `-DENABLE_VALGRIND=On`: Run tests with [valgrind](http://valgrind.org). (off by default)
115 * `-DENABLE_SANITIZERS=On`: Compile cJSON with [AddressSanitizer](https://github.com/google/sanitiz…
116 * `-DENABLE_SAFE_STACK`: Enable the [SafeStack](https://clang.llvm.org/docs/SafeStack.html) instrum…
117 * `-DBUILD_SHARED_LIBS=On`: Build the shared libraries. (on by default)
118 * `-DBUILD_SHARED_AND_STATIC_LIBS=On`: Build both shared and static libraries. (off by default)
119 * `-DCMAKE_INSTALL_PREFIX=/usr`: Set a prefix for the installation.
120 * `-DENABLE_LOCALES=On`: Enable the usage of localeconv method. ( on by default )
121 * `-DCJSON_OVERRIDE_BUILD_SHARED_LIBS=On`: Enable overriding the value of `BUILD_SHARED_LIBS` with …
122 * `-DENABLE_CJSON_VERSION_SO`: Enable cJSON so version. ( on by default )
123 * `-DENABLE_INT64`: Enable int64 support for cjson. Please note this will use c99 instead of c89. (…
129 cmake .. -DENABLE_CJSON_UTILS=On -DENABLE_CJSON_TEST=Off -DCMAKE_INSTALL_PREFIX=/usr
155 project('c-json-example', 'c')
173 ./bootstrap-vcpkg.sh
190 cJSON represents JSON data using the `cJSON` struct data type:
208 An item of this type represents a JSON value. The type is stored in `type` as a bit-flag (**this me…
222 …JSON that is stored as a zero terminated array of characters in `valuestring`. This can be used, f…
283 ### Parsing JSON
285 Given some JSON in a zero terminated string, you can parse it with `cJSON_Parse`.
288 cJSON *json = cJSON_Parse(string);
291 Given some JSON in a string (whether zero terminated or not), you can parse it with `cJSON_ParseWit…
294 cJSON *json = cJSON_ParseWithLength(string, buffer_length);
297 It will parse the JSON and allocate a tree of `cJSON` items that represents it. Once it returns, yo…
302 By default, characters in the input string that follow the parsed JSON will not be considered as an…
305 …JSON in the input string or the position that an error occurs at (thereby replacing `cJSON_GetErro…
307 If you want more options giving buffer length, use `cJSON_ParseWithLengthOpts(const char *value, si…
309 ### Printing JSON
314 char *string = cJSON_Print(json);
317 It will allocate a string and print a JSON representation of the tree into it. Once it returns, you…
321 …rst buffer size to use for printing. `cJSON_Print` currently uses 256 bytes for its first buffer s…
323 …buffer allocations can be completely avoided by using `cJSON_PrintPreallocated(cJSON *item, char *…
327 In this example we want to build and parse the following JSON:
329 ```json
351 Let's build the above JSON and print it to a string:
488 In this example we will parse a JSON in the above format and check if the monitor supports a Full H…
511 if (cJSON_IsString(name) && (name->valuestring != NULL))
513 printf("Checking monitor \"%s\"\n", name->valuestring);
528 if ((width->valuedouble == 1920) && (height->valuedouble == 1080))
551 …-8 encoded input. In most cases it doesn't reject invalid UTF-8 as input though, it just propagate…
581 When cJSON was originally created, it didn't follow the JSON standard and didn't make a distinction…
585 cJSON supports parsing and printing JSON that contains objects that have multiple members with the …
589 - Dave Gamble (original author)
590 - Max Bruckner and Alan Wang (current maintainer)
591 - and the other [cJSON contributors](CONTRIBUTORS.md)