* Introduction:
=============
JSON (JavaScript Object Notation) is a lightweight data-interchange format.
It can represent integer, real number, string, an ordered sequence of
value, and a collection of name/value pairs.
JsonCpp is a simple API to manipulate JSON value, handle serialization
and unserialization to string.
It can also preserve existing comment in unserialization/serialization steps,
making it a convenient format to store user input files.
Unserialization parsing is user friendly and provides precise error reports.
* Building/Testing:
=================
JsonCpp uses Scons (http://www.scons.org) as a build system. Scons requires
python to be installed (http://www.python.org).
You download scons-local distribution from the following url:
http://sourceforge.net/project/showfiles.php?group_id=30337&package_id=67375
Unzip it in the directory where you found this README file. scons.py Should be
at the same level as README.
python scons.py platform=PLTFRM [TARGET]
where PLTFRM 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
linux-gcc Gnu C++ (linux, also reported to work for Mac OS X)
adding platform is fairly simple. You need to change the Sconstruct file
to do so.
and TARGET may be:
check: build library and run unit tests.
* Running the test manually:
==========================
cd test
# This will run the Reader/Writer tests
python runjsontests.py "path to jsontest.exe"
# 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.exe"
# This will run the unit tests (mostly Value)
python rununittests.py "path to test_lib_json.exe"
You can run the tests using valgrind:
python rununittests.py --valgrind "path to test_lib_json.exe"
* Building the documentation:
===========================
Run the python script doxybuild.py from the top directory:
python doxybuild.py --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.
TESTNAME.expected file format:
- 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
(e.g. represented by either [] or {}).
- element path: '.' represented 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 test_complex_01.json and test_complex_01.expected to better understand
element path.
* Understanding reader/writer test output:
========================================
When a test is run, output files are generated aside 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.exe from reading test_complex_01.json
- test_complex_01.rewrite: JSON document written by jsontest.exe using the
Json::Value parsed from test_complex_01.json and serialized using
Json::StyledWritter.
- test_complex_01.actual-rewrite: flattened JSON element tree produced by
jsontest.exe from reading test_complex_01.rewrite.
test_complex_01.process-output: jsontest.exe output, typically useful to
understand parsing error.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
C++线程池结合IOCP完成端口实现socket高并发服务端程序 (582个子文件)
AUTHORS 49B
RecAPP.cpp 97KB
json_value.cpp 38KB
TestTask.cpp 23KB
socket服务端.cpp 22KB
json_reader.cpp 20KB
json_writer.cpp 20KB
SocketTCP.cpp 16KB
SocketAPP.cpp 15KB
jsontest.cpp 13KB
mSQLSave.cpp 8KB
main.cpp 7KB
main.cpp 6KB
MyThreadPool.cpp 3KB
MyThread.cpp 3KB
MyList.cpp 987B
MyQueue.cpp 919B
MyStack.cpp 919B
SaveQueue.cpp 877B
main.cpp 430B
MyMutex.cpp 263B
stdafx.cpp 217B
Task.cpp 163B
libmysql.dll 5.05MB
libmysql.dll 5.05MB
libmysql.dll 5.05MB
libmysql.dll 4.46MB
libmysql.dll 4.46MB
libmysql.dll 4.46MB
msvcr100d.dll 1.77MB
msvcr100d.dll 1.43MB
msvcp100d.dll 990KB
msvcr100.dll 756KB
msvcr100.dll 756KB
msvcr100.dll 756KB
msvcr100.dll 756KB
msvcp100d.dll 726KB
msvcp100.dll 411KB
msvcp100.dll 411KB
msvcp100.dll 411KB
msvcp100.dll 411KB
jsoncpp.dox 4KB
roadmap.dox 2KB
socket服务端.exe 663KB
socket服务端.exe 407KB
socket服务端.exe 390KB
socket服务端.exe 174KB
test_large_01.expected 31KB
test_string_02.expected 2KB
test_array_05.expected 977B
test_complex_01.expected 358B
test_array_06.expected 190B
test_comment_01.expected 109B
test_string_01.expected 98B
test_object_03.expected 54B
test_array_04.expected 46B
test_array_03.expected 46B
test_string_unicode_05.expected 34B
test_preserve_comment_01.expected 27B
test_object_02.expected 19B
test_real_06.expected 18B
test_real_07.expected 18B
test_basic_03.expected 17B
test_real_03.expected 17B
test_real_02.expected 17B
test_real_05.expected 17B
test_real_01.expected 16B
test_integer_02.expected 15B
test_real_04.expected 15B
test_integer_01.expected 14B
test_integer_03.expected 14B
test_basic_04.expected 14B
test_array_02.expected 14B
test_object_04.expected 14B
test_basic_02.expected 14B
test_basic_01.expected 13B
test_basic_07.expected 11B
test_basic_05.expected 10B
test_basic_06.expected 10B
test_basic_08.expected 10B
test_basic_09.expected 10B
test_string_unicode_04.expected 10B
test_string_unicode_03.expected 9B
test_string_unicode_02.expected 8B
test_integer_04.expected 7B
test_integer_05.expected 7B
test_string_unicode_01.expected 7B
test_array_01.expected 6B
test_object_01.expected 6B
socket服务端.vcxproj.filters 6KB
mysqld_ername.h 118KB
mysqld_ername.h 117KB
psi.h 85KB
psi.h 84KB
mysqld_error.h 44KB
mysqld_error.h 43KB
my_sys.h 39KB
my_sys.h 38KB
mysql_file.h 38KB
mysql_file.h 38KB
共 582 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
- zxq5042019-06-23编译后可以使用
- wangacc19842018-02-27错误一大堆,怎么看?
- 北漂的驴子2020-11-10配置include / lib后可以编译成功,待测试中
少占鱼-正定
- 粉丝: 242
- 资源: 52
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- user+name.csv
- 安卓学习教材经验Android进阶学习资料安卓面试资料等文档资料合集(22个).zip
- 王小晨申论高分课.zip
- 基于matlab实现说话人语音识别源码+项目说明+PPT+报告(高分项目).zip
- VSc++编程助手1.0 - 1
- 基于matlab的说话人语音识别源码+PPT+报告(优质项目).zip
- 语音识别基于matlab说话人识别系统源码+报告PPT(高分优质项目).zip
- 毕业设计: 校园失物招领小程序的设计与实现论文(源码 + 数据库 + 说明文档)
- 美易ME-DUI自绘模块3.3-易语言模块
- 毕业设计:小程序消防知识每天学(源码 + 数据库 + 说明文档)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功