You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Art of C++ / JSON is a zero-dependency C++11 header-only library that provides a generic JSON value object as well as conversions from and to JSON string representation. It uses `std::vector` for arrays, `std::map` for objects, and both `int64_t` and `double` for numbers.
8
+
The Art of C++ / JSON is a zero-dependency C++11 header-only library that provides a generic JSON value object as well as conversions from and to JSON string representation. It also serves as a fully functional real-world example application for the [Parsing Expression Grammar Template Library (PEGTL)](https://github.com/ColinH/PEGTL).
9
9
10
-
This library is designed for correctness and simplicity and as a real-world example application for the [Parsing Expression Grammar Template Library (PEGTL)](https://github.com/ColinH/PEGTL) that is used for parsing.
10
+
## Design
11
11
12
+
This library is designed for correctness and simplicity, and strives for speed through minimalism rather than complicated optimisations.
13
+
14
+
It uses `std::vector` for arrays, `std::map` for objects, `std::string` for strings, `bool` for Booleans, and both `int64_t` and `double` for numbers.
15
+
16
+
The JSON value class contains a `union` of all of these types and does *not itself* perform any heap allocations (the wrapped `std::map`, `std::vector` and `std::string`*do* perform allocations normally).
17
+
12
18
## Status
13
19
14
20
The core JSON value class is implemented and working.
@@ -17,23 +23,29 @@ The conversions from and to JSON string representation are finished and working:
17
23
18
24
In internal tests we achieve a 100% score in the [Native JSON Benchmark](https://github.com/miloyip/nativejson-benchmark) conformance tests.
19
25
20
-
In a nutshell, that what is implemented works, but the API might still change before the 1.0 release.
26
+
In a nutshell, that what is implemented works, but the API might still change (and be extended) before the 1.0 release.
21
27
22
28
## Documentation
23
29
24
-
Proper documentation will be written once all interfaces are stable.
30
+
The documentation will be written once all interfaces are stable...
25
31
26
32
Until then, here are a few short indications on how to use this library:
27
33
28
34
* Requires Clang or GCC with -std=c++11 (or other compiler with sufficient C++11 support).
29
35
* The library is header-only, to install and use simply copy the directory `include/tao` to a convenient place and include the file `include/tao/json.hh`.
30
-
* The generic JSON value classis in `include/tao/json/value.hh`, that's the main part of this library.
36
+
* The generic JSON value class, the main part of this library, is in `include/tao/json/value.hh`.
31
37
* The interface and functions of class `tao::json::value` are hopefully reasonably self-explanatory.
32
38
* To parse a JSON string representation, use one of the functions in `include/tao/json/parse.hh`.
33
39
* To produce a JSON string representation, use one of the appropriate functions in `include/tao/json/stream.hh`.
40
+
* Operators to compare JSON value objects are provided, as are equality operators between JSON values and some other types.
34
41
35
42
For questions and suggestions please contact the authors at **jsonl(at)colin-hirsch.net**.
36
43
44
+
#### Thank You
45
+
46
+
* Niels Lohmann and his [JSON library](https://github.com/nlohmann/json) for the inspiration.
47
+
* Milo Yip and his [Native JSON Benchmark](https://github.com/miloyip/nativejson-benchmark) for a reference to measure progress against.
0 commit comments