77
88[ json-org ] : http://json.org/
99
10- JsonCpp is a C++ library that allows manipulating JSON values, including
10+ [ JsonCpp] [ ] is a C++ library that allows manipulating JSON values, including
1111serialization and deserialization to and from strings. It can also preserve
1212existing comment in unserialization/serialization steps, making it a convenient
1313format to store user input files.
1414
15+ [ JsonCpp ] : http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html
16+
1517## A note on backward-compatibility
16- Very soon, we are switching to C++11 only. For older compilers, try the ` pre-C++11 ` branch.
18+ * ` 1.y.z ` is built with C++11.
19+ * ` 0.8.z ` can be used with older compilers.
20+ * Major versions maintain binary-compatibility.
1721
1822Using JsonCpp in your project
1923-----------------------------
20-
2124The recommended approach to integrating JsonCpp in your project is to build
2225the amalgamated source (a single ` .cpp ` file) with your own build system. This
2326ensures consistency of compilation flags and ABI compatibility. See the section
@@ -28,13 +31,11 @@ should be included as follow:
2831
2932 #include <json/json.h>
3033
31- If JsonCpp was build as a dynamic library on Windows, then your project needs to
34+ If JsonCpp was built as a dynamic library on Windows, then your project needs to
3235define the macro ` JSON_DLL ` .
3336
34-
35- Building and testing with new CMake
36- -----------------------------------
37-
37+ Building and testing with CMake
38+ -------------------------------
3839[ CMake] [ ] is a C++ Makefiles/Solution generator. It is usually available on most
3940Linux system as package. On Ubuntu:
4041
@@ -75,10 +76,8 @@ the `-G` option).
7576By default CMake hides compilation commands. This can be modified by specifying
7677` -DCMAKE_VERBOSE_MAKEFILE=true ` when generating makefiles.
7778
78-
7979Building and testing with SCons
8080-------------------------------
81-
8281** Note:** The SCons-based build system is deprecated. Please use CMake; see the
8382section above.
8483
@@ -107,14 +106,7 @@ If you are building with Microsoft Visual Studio 2008, you need to set up the
107106environment by running ` vcvars32.bat ` (e.g. MSVC 2008 command prompt) before
108107running SCons.
109108
110-
111- Running the tests manually
112- --------------------------
113-
114- Note that test can be run using SCons using the ` check ` target:
115-
116- scons platform=$PLATFORM check
117-
109+ # Running the tests manually
118110You need to run tests manually only if you are troubleshooting an issue.
119111
120112In the instructions below, replace ` path/to/jsontest ` with the path of the
@@ -137,20 +129,21 @@ In the instructions below, replace `path/to/jsontest` with the path of the
137129 # You can run the tests using valgrind:
138130 python rununittests.py --valgrind path/to/test_lib_json
139131
132+ ## Running the tests using scons
133+ Note that tests can be run using SCons using the ` check ` target:
134+
135+ scons platform=$PLATFORM check
140136
141137Building the documentation
142138--------------------------
143-
144139Run the Python script ` doxybuild.py ` from the top directory:
145140
146141 python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
147142
148143See ` doxybuild.py --help ` for options.
149144
150-
151145Generating amalgamated source and header
152146----------------------------------------
153-
154147JsonCpp is provided with a script to generate a single header and a single
155148source file to ease inclusion into an existing project. The amalgamated source
156149can be generated at any time by running the following command from the
@@ -172,10 +165,8 @@ The amalgamated sources are generated by concatenating JsonCpp source in the
172165correct order and defining the macro ` JSON_IS_AMALGAMATION ` to prevent inclusion
173166of other headers.
174167
175-
176168Adding a reader/writer test
177169---------------------------
178-
179170To add a test, you need to create two files in test/data:
180171
181172* a ` TESTNAME.json ` file, that contains the input document in JSON format.
@@ -195,10 +186,8 @@ The `TESTNAME.expected` file format is as follows:
195186See the examples ` test_complex_01.json ` and ` test_complex_01.expected ` to better
196187understand element paths.
197188
198-
199189Understanding reader/writer test output
200190---------------------------------------
201-
202191When a test is run, output files are generated beside the input test files.
203192Below is a short description of the content of each file:
204193
@@ -215,10 +204,7 @@ Below is a short description of the content of each file:
215204* ` test_complex_01.process-output ` : ` jsontest ` output, typically useful for
216205 understanding parsing errors.
217206
218-
219207License
220208-------
221-
222209See the ` LICENSE ` file for details. In summary, JsonCpp is licensed under the
223210MIT license, or public domain if desired and recognized in your jurisdiction.
224-
0 commit comments