Introduction
------------
[JSON][json-org] is a lightweight data-interchange format. It can represent
numbers, strings, ordered sequences of values, and collections of name/value
pairs.
[json-org]: http://json.org/
[JsonCpp][] is a C++ library that allows manipulating JSON values, including
serialization and deserialization to and from strings. It can also preserve
existing comment in unserialization/serialization steps, making it a convenient
format to store user input files.
[JsonCpp]: http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html
## A note on backward-compatibility
* `1.y.z` is built with C++11.
* `0.y.z` can be used with older compilers.
* Major versions maintain binary-compatibility.
# Using JsonCpp in your project
-----------------------------
The recommended approach to integrating JsonCpp in your project is to include
the [amalgamated source](#generating-amalgamated-source-and-header) (a single
`.cpp` file and two `.h` files) in your project, and compile and build as you
would any other source file. This ensures consistency of compilation flags and
ABI compatibility, issues which arise when building shared or static
libraries. See the next section for instructions.
The `include/` should be added to your compiler include path. Jsoncpp headers
should be included as follow:
#include <json/json.h>
If JsonCpp was built as a dynamic library on Windows, then your project needs to
define the macro `JSON_DLL`.
Generating amalgamated source and header
----------------------------------------
JsonCpp is provided with a script to generate a single header and a single
source file to ease inclusion into an existing project. The amalgamated source
can be generated at any time by running the following command from the
top-directory (this requires Python 2.6):
python amalgamate.py
It is possible to specify header name. See the `-h` option for detail.
By default, the following files are generated:
* `dist/jsoncpp.cpp`: source file that needs to be added to your project.
* `dist/json/json.h`: corresponding header file for use in your project. It is
equivalent to including `json/json.h` in non-amalgamated source. This header
only depends on standard headers.
* `dist/json/json-forwards.h`: header that provides forward declaration of all
JsonCpp types.
The amalgamated sources are generated by concatenating JsonCpp source in the
correct order and defining the macro `JSON_IS_AMALGAMATION` to prevent inclusion
of other headers.
# Contributing to JsonCpp
Building and testing with CMake
-------------------------------
[CMake][] is a C++ Makefiles/Solution generator. It is usually available on most
Linux system as package. On Ubuntu:
sudo apt-get install cmake
[CMake]: http://www.cmake.org
Note that Python is also required to run the JSON reader/writer tests. If
missing, the build will skip running those tests.
When running CMake, a few parameters are required:
* a build directory where the makefiles/solution are generated. It is also used
to store objects, libraries and executables files.
* the generator to use: makefiles or Visual Studio solution? What version or
Visual Studio, 32 or 64 bits solution?
Steps for generating solution/makefiles using `cmake-gui`:
* Make "source code" point to the source directory.
* Make "where to build the binary" point to the directory to use for the build.
* Click on the "Grouped" check box.
* Review JsonCpp build options (tick `BUILD_SHARED_LIBS` to build as a
dynamic library).
* Click the configure button at the bottom, then the generate button.
* The generated solution/makefiles can be found in the binary directory.
Alternatively, from the command-line on Unix in the source directory:
mkdir -p build/debug
cd build/debug
cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../..
make
For a good pkg-config file, add:
-DCMAKE_INSTALL_INCLUDEDIR=include/jsoncpp
Running `cmake -h` will display the list of available generators (passed using
the `-G` option).
By default CMake hides compilation commands. This can be modified by specifying
`-DCMAKE_VERBOSE_MAKEFILE=true` when generating makefiles.
Building and testing with SCons
-------------------------------
**Note:** The SCons-based build system is deprecated. Please use CMake; see the
section above.
JsonCpp can use [Scons][] as a build system. Note that SCons requires Python to
be installed.
[SCons]: http://www.scons.org/
Invoke SCons as follows:
scons platform=$PLATFORM [TARGET]
where `$PLATFORM` may be one of:
* `suncc`: Sun C++ (Solaris)
* `vacpp`: Visual Age C++ (AIX)
* `mingw`
* `msvc6`: Microsoft Visual Studio 6 service pack 5-6
* `msvc70`: Microsoft Visual Studio 2002
* `msvc71`: Microsoft Visual Studio 2003
* `msvc80`: Microsoft Visual Studio 2005
* `msvc90`: Microsoft Visual Studio 2008
* `linux-gcc`: Gnu C++ (linux, also reported to work for Mac OS X)
If you are building with Microsoft Visual Studio 2008, you need to set up the
environment by running `vcvars32.bat` (e.g. MSVC 2008 command prompt) before
running SCons.
## Running the tests manually
You need to run tests manually only if you are troubleshooting an issue.
In the instructions below, replace `path/to/jsontest` with the path of the
`jsontest` executable that was compiled on your platform.
cd test
# This will run the Reader/Writer tests
python runjsontests.py path/to/jsontest
# This will run the Reader/Writer tests, using JSONChecker test suite
# (http://www.json.org/JSON_checker/).
# Notes: not all tests pass: JsonCpp is too lenient (for example,
# it allows an integer to start with '0'). The goal is to improve
# strict mode parsing to get all tests to pass.
python runjsontests.py --with-json-checker path/to/jsontest
# This will run the unit tests (mostly Value)
python rununittests.py path/to/test_lib_json
# You can run the tests using valgrind:
python rununittests.py --valgrind path/to/test_lib_json
## Running the tests using scons
Note that tests can be run using SCons using the `check` target:
scons platform=$PLATFORM check
Building the documentation
--------------------------
Run the Python script `doxybuild.py` from the top directory:
python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
See `doxybuild.py --help` for options.
Adding a reader/writer test
---------------------------
To add a test, you need to create two files in test/data:
* a `TESTNAME.json` file, that contains the input document in JSON format.
* a `TESTNAME.expected` file, that contains a flatened representation of the
input document.
The `TESTNAME.expected` file format is as follows:
* each line represents a JSON element of the element tree represented by the
input document.
* each line has two parts: the path to access the element separated from the
element value by `=`. Array and object values are always empty (i.e.
represented by either `[]` or `{}`).
* element path: `.` represents the root element, and is used to separate object
members. `[N]` is used to specify the value of an array element at index `N`.
See the examples `test_complex_01.json` and `test_complex_01.expected` to better
understand element paths.
Understanding reader/writer test output
---------------------------------------
When a test is run, output files are generated beside the input test files.
Below is a short description of the content of each file:
* `test_complex_01.json`: input JSON document.
* `test_complex_01.expected`: flattened JSON element tree used to check if
parsing was corrected.
* `test_complex_01.actual`: flattened JSON element tree produced by `jsontest`
from
没有合适的资源?快使用搜索试试~ 我知道了~
webrtc_vs2015.7z windows
共14669个文件
h:3561个
c:2859个
cc:1795个
需积分: 9 4 下载量 110 浏览量
2020-04-30
11:57:36
上传
评论
收藏 376.8MB 7Z 举报
温馨提示
vs2015编译通过 peer_client和peer_server可两台电脑直连 亲测可用 如果peerclient崩溃,video_capture_ds.cc 140行到148行屏蔽即可(pause失败)
资源推荐
资源详情
资源评论
收起资源包目录
webrtc_vs2015.7z windows (14669个子文件)
wavpack-channels-4.0 34B
lossless-truehd-5.1-downmix-2.0 34B
ffmpeg-all.1 927KB
ffprobe-all.1 721KB
ffmpeg-filters.1 450KB
ffmpeg-codecs.1 146KB
ffmpeg-formats.1 96KB
ffmpeg.1 91KB
ffmpeg-devices.1 66KB
ffmpeg-protocols.1 50KB
ffprobe.1 42KB
ffmpeg-utils.1 37KB
COPYING.LGPLv2.1 26KB
ffmpeg-resampler.1 14KB
ffmpeg-bitstream-filters.1 11KB
ffmpeg-scaler.1 8KB
faac.1 3KB
wavpack-channels-5.1 34B
lossless-truehd-5.1 34B
wavpack-channels-6.1 34B
wavpack-channels-7.1 34B
test_cif_I_CABAC_PCM.264 18.99MB
test_cif_I_CABAC_slice.264 3.17MB
CVPCMNL1_SVA_C.264 3.05MB
test_cif_P_CABAC_slice.264 843KB
LS_SVA_D.264 635KB
BA1_FT_C.264 606KB
CI1_FT_B.264 405KB
NLMQ1_JVC_C.264 402KB
BAMQ1_JVC_C.264 402KB
MR2_MW_A.264 318KB
MR2_TANDBERG_E.264 265KB
NLMQ2_JVC_C.264 253KB
BAMQ2_JVC_C.264 252KB
MR1_MW_A.264 158KB
MPS_MW_A.264 154KB
Error_I_P.264 60KB
test_vd_1d.264 56KB
BANM_MW_D.264 55KB
CI_MW_D.264 55KB
MIDR_MW_D.264 55KB
BA_MW_D.264 55KB
BA_MW_D_P_LOST.264 54KB
NRF_MW_E.264 54KB
BA_MW_D_IDR_LOST.264 52KB
test_vd_rc.264 48KB
test_qcif_cabac.264 40KB
QCIF_2P_I_allIPCM.264 38KB
SVA_NL1_B.264 32KB
SVA_BA1_B.264 32KB
SVA_CL1_E.264 18KB
test_scalinglist_jm.264 14KB
Static.264 9KB
SVA_FM1_E.264 8KB
SVA_Base_B.264 8KB
SVA_NL2_E.264 8KB
SVA_BA2_D.264 7KB
libswresample.3 6KB
libswscale.3 5KB
libavutil.3 5KB
libavcodec.3 5KB
libavformat.3 5KB
libavdevice.3 5KB
libavfilter.3 5KB
4xm-1 898B
4xm-2 10KB
adpcm-creative-8-2.6bit 34B
785b96587d0eb44dd5d75b7a886f37e2ac504511 24B
8bps 2KB
libavcodec.a 14.97MB
libavformat.a 5.49MB
libyuv.a 4.6MB
libcrypto.a 3.83MB
libswscale.a 2.24MB
libyuv.a 1.55MB
libavutil.a 1.28MB
libavfilter.a 1.11MB
libyuv.a 921KB
libyuv.a 921KB
libssl.a 672KB
libyuv.a 422KB
libswresample.a 305KB
libavutil.dll.a 289KB
libavcodec.dll.a 144KB
libavformat.dll.a 112KB
libavfilter.dll.a 54KB
libswscale.dll.a 23KB
libswresample.dll.a 15KB
libavdevice.dll.a 13KB
aasc 1KB
AboutTest 3KB
configure.ac 32KB
configure.ac 1KB
acodec-adpcm-ima_qt 3KB
acodec-adpcm-ima_qt-trellis 3KB
acodec-adpcm-ima_wav 3KB
acodec-adpcm-ima_wav-trellis 3KB
acodec-adpcm-ms 3KB
acodec-adpcm-ms-trellis 3KB
acodec-adpcm-swf 3KB
共 14669 条
- 1
- 2
- 3
- 4
- 5
- 6
- 147
资源评论
霜菊子
- 粉丝: 2
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功