Skip to content

Commit e7185b9

Browse files
committed
Align rapidjson with socket
1 parent 04ba76f commit e7185b9

57 files changed

Lines changed: 1452 additions & 477 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

contrib/rapidjson/.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.cpp text
7+
*.h text
8+
*.txt text
9+
*.md text
10+
*.cmake text
11+
*.svg text
12+
*.dot text
13+
*.yml text
14+
*.in text
15+
*.sh text
16+
*.autopkg text
17+
Dockerfile text
18+
19+
# Denote all files that are truly binary and should not be modified.
20+
*.png binary
21+
*.jpg binary
22+
*.json binary

contrib/rapidjson/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/bin/*
2+
!/bin/data
3+
!/bin/encodings
4+
!/bin/jsonchecker
5+
!/bin/types
6+
/build
7+
/doc/html
8+
/doc/doxygen_*.db
9+
*.a
10+
11+
# Temporary files created during CMake build
12+
CMakeCache.txt
13+
CMakeFiles
14+
cmake_install.cmake
15+
CTestTestfile.cmake
16+
Makefile
17+
RapidJSON*.cmake
18+
RapidJSON.pc
19+
Testing
20+
/googletest
21+
install_manifest.txt
22+
Doxyfile
23+
Doxyfile.zh-cn
24+
DartConfiguration.tcl
25+
*.nupkg
26+
27+
# Files created by OS
28+
*.DS_Store

contrib/rapidjson/.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "thirdparty/gtest"]
2+
path = thirdparty/gtest
3+
url = https://github.com/google/googletest.git

contrib/rapidjson/.travis.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
sudo: required
2+
dist: xenial
3+
4+
language: cpp
5+
cache:
6+
- ccache
7+
8+
addons:
9+
apt:
10+
sources:
11+
- ubuntu-toolchain-r-test
12+
packages:
13+
- cmake
14+
- valgrind
15+
- clang-8
16+
env:
17+
global:
18+
- USE_CCACHE=1
19+
- CCACHE_SLOPPINESS=pch_defines,time_macros
20+
- CCACHE_COMPRESS=1
21+
- CCACHE_MAXSIZE=100M
22+
- ARCH_FLAGS_x86='-m32' # #266: don't use SSE on 32-bit
23+
- ARCH_FLAGS_x86_64='-msse4.2' # use SSE4.2 on 64-bit
24+
- ARCH_FLAGS_aarch64='-march=armv8-a'
25+
- GITHUB_REPO='Tencent/rapidjson'
26+
- secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
27+
28+
matrix:
29+
include:
30+
# gcc
31+
- env: CONF=release ARCH=x86 CXX11=ON
32+
compiler: gcc
33+
arch: amd64
34+
- env: CONF=release ARCH=x86_64 CXX11=ON
35+
compiler: gcc
36+
arch: amd64
37+
- env: CONF=debug ARCH=x86 CXX11=OFF
38+
compiler: gcc
39+
arch: amd64
40+
- env: CONF=debug ARCH=x86_64 CXX11=OFF
41+
compiler: gcc
42+
arch: amd64
43+
- env: CONF=release ARCH=aarch64 CXX11=ON
44+
compiler: gcc
45+
arch: arm64
46+
- env: CONF=debug ARCH=aarch64 CXX11=OFF
47+
compiler: gcc
48+
arch: arm64
49+
# clang
50+
- env: CONF=debug ARCH=x86 CXX11=ON CCACHE_CPP2=yes
51+
compiler: clang
52+
arch: amd64
53+
- env: CONF=debug ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
54+
compiler: clang
55+
arch: amd64
56+
- env: CONF=debug ARCH=x86 CXX11=OFF CCACHE_CPP2=yes
57+
compiler: clang
58+
arch: amd64
59+
- env: CONF=debug ARCH=x86_64 CXX11=OFF CCACHE_CPP2=yes
60+
compiler: clang
61+
arch: amd64
62+
- env: CONF=release ARCH=x86 CXX11=ON CCACHE_CPP2=yes
63+
compiler: clang
64+
arch: amd64
65+
- env: CONF=release ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
66+
compiler: clang
67+
arch: amd64
68+
- env: CONF=debug ARCH=aarch64 CXX11=ON CCACHE_CPP2=yes
69+
compiler: clang
70+
arch: arm64
71+
- env: CONF=debug ARCH=aarch64 CXX11=OFF CCACHE_CPP2=yes
72+
compiler: clang
73+
arch: arm64
74+
# coverage report
75+
- env: CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage'
76+
compiler: gcc
77+
arch: amd64
78+
cache:
79+
- ccache
80+
- pip
81+
after_success:
82+
- pip install --user cpp-coveralls
83+
- coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
84+
- env: CONF=debug ARCH=x86_64 GCOV_FLAGS='--coverage'
85+
compiler: gcc
86+
arch: amd64
87+
cache:
88+
- ccache
89+
- pip
90+
after_success:
91+
- pip install --user cpp-coveralls
92+
- coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
93+
- env: CONF=debug ARCH=aarch64 GCOV_FLAGS='--coverage'
94+
compiler: gcc
95+
arch: arm64
96+
cache:
97+
- ccache
98+
- pip
99+
after_success:
100+
- pip install --user cpp-coveralls
101+
- coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
102+
- script: # Documentation task
103+
- cd build
104+
- cmake .. -DRAPIDJSON_HAS_STDSTRING=ON -DCMAKE_VERBOSE_MAKEFILE=ON
105+
- make travis_doc
106+
cache: false
107+
addons:
108+
apt:
109+
packages:
110+
- doxygen
111+
112+
before_install:
113+
- if [ "x86_64" = "$(arch)" ]; then sudo apt-get install -y g++-multilib libc6-dbg:i386 --allow-unauthenticated; fi
114+
115+
before_script:
116+
# travis provides clang-7 for amd64 and clang-3.8 for arm64
117+
# here use clang-8 to all architectures as clang-7 is not available for arm64
118+
- if [ -f /usr/bin/clang++-8 ]; then
119+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 1000;
120+
sudo update-alternatives --config clang++;
121+
export PATH=/usr/bin:$PATH;
122+
fi
123+
- if [ "$CXX" = "clang++" ]; then export CCACHE_CPP2=yes; fi
124+
- ccache -s
125+
# hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469),
126+
# exposed by merging PR#163 (using -march=native)
127+
# TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded.
128+
- sed -i "s/-march=native//" CMakeLists.txt
129+
- mkdir build
130+
131+
script:
132+
- if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++ ${CXXFLAGS}"; fi
133+
- >
134+
eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ;
135+
(cd build && cmake
136+
-DRAPIDJSON_HAS_STDSTRING=ON
137+
-DRAPIDJSON_BUILD_CXX11=$CXX11
138+
-DCMAKE_VERBOSE_MAKEFILE=ON
139+
-DCMAKE_BUILD_TYPE=$CONF
140+
-DCMAKE_CXX_FLAGS="$ARCH_FLAGS $GCOV_FLAGS"
141+
-DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS
142+
..)
143+
- cd build
144+
- make tests -j 2
145+
- make examples -j 2
146+
- ctest -j 2 -V `[ "$CONF" = "release" ] || echo "-E perftest"`

contrib/rapidjson/CHANGELOG.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## [Unreleased]
6+
7+
## 1.1.0 - 2016-08-25
8+
9+
### Added
10+
* Add GenericDocument ctor overload to specify JSON type (#369)
11+
* Add FAQ (#372, #373, #374, #376)
12+
* Add forward declaration header `fwd.h`
13+
* Add @PlatformIO Library Registry manifest file (#400)
14+
* Implement assignment operator for BigInteger (#404)
15+
* Add comments support (#443)
16+
* Adding coapp definition (#460)
17+
* documenttest.cpp: EXPECT_THROW when checking empty allocator (470)
18+
* GenericDocument: add implicit conversion to ParseResult (#480)
19+
* Use <wchar.h> with C++ linkage on Windows ARM (#485)
20+
* Detect little endian for Microsoft ARM targets
21+
* Check Nan/Inf when writing a double (#510)
22+
* Add JSON Schema Implementation (#522)
23+
* Add iostream wrapper (#530)
24+
* Add Jsonx example for converting JSON into JSONx (a XML format) (#531)
25+
* Add optional unresolvedTokenIndex parameter to Pointer::Get() (#532)
26+
* Add encoding validation option for Writer/PrettyWriter (#534)
27+
* Add Writer::SetMaxDecimalPlaces() (#536)
28+
* Support {0, } and {0, m} in Regex (#539)
29+
* Add Value::Get/SetFloat(), Value::IsLossLessFloat/Double() (#540)
30+
* Add stream position check to reader unit tests (#541)
31+
* Add Templated accessors and range-based for (#542)
32+
* Add (Pretty)Writer::RawValue() (#543)
33+
* Add Document::Parse(std::string), Document::Parse(const char*, size_t length) and related APIs. (#553)
34+
* Add move constructor for GenericSchemaDocument (#554)
35+
* Add VS2010 and VS2015 to AppVeyor CI (#555)
36+
* Add parse-by-parts example (#556, #562)
37+
* Support parse number as string (#564, #589)
38+
* Add kFormatSingleLineArray for PrettyWriter (#577)
39+
* Added optional support for trailing commas (#584)
40+
* Added filterkey and filterkeydom examples (#615)
41+
* Added npm docs (#639)
42+
* Allow options for writing and parsing NaN/Infinity (#641)
43+
* Add std::string overload to PrettyWriter::Key() when RAPIDJSON_HAS_STDSTRING is defined (#698)
44+
45+
### Fixed
46+
* Fix gcc/clang/vc warnings (#350, #394, #397, #444, #447, #473, #515, #582, #589, #595, #667)
47+
* Fix documentation (#482, #511, #550, #557, #614, #635, #660)
48+
* Fix emscripten alignment issue (#535)
49+
* Fix missing allocator to uses of AddMember in document (#365)
50+
* CMake will no longer complain that the minimum CMake version is not specified (#501)
51+
* Make it usable with old VC8 (VS2005) (#383)
52+
* Prohibit C++11 move from Document to Value (#391)
53+
* Try to fix incorrect 64-bit alignment (#419)
54+
* Check return of fwrite to avoid warn_unused_result build failures (#421)
55+
* Fix UB in GenericDocument::ParseStream (#426)
56+
* Keep Document value unchanged on parse error (#439)
57+
* Add missing return statement (#450)
58+
* Fix Document::Parse(const Ch*) for transcoding (#478)
59+
* encodings.h: fix typo in preprocessor condition (#495)
60+
* Custom Microsoft headers are necessary only for Visual Studio 2012 and lower (#559)
61+
* Fix memory leak for invalid regex (26e69ffde95ba4773ab06db6457b78f308716f4b)
62+
* Fix a bug in schema minimum/maximum keywords for 64-bit integer (e7149d665941068ccf8c565e77495521331cf390)
63+
* Fix a crash bug in regex (#605)
64+
* Fix schema "required" keyword cannot handle duplicated keys (#609)
65+
* Fix cmake CMP0054 warning (#612)
66+
* Added missing include guards in istreamwrapper.h and ostreamwrapper.h (#634)
67+
* Fix undefined behaviour (#646)
68+
* Fix buffer overrun using PutN (#673)
69+
* Fix rapidjson::value::Get<std::string>() may returns wrong data (#681)
70+
* Add Flush() for all value types (#689)
71+
* Handle malloc() fail in PoolAllocator (#691)
72+
* Fix builds on x32 platform. #703
73+
74+
### Changed
75+
* Clarify problematic JSON license (#392)
76+
* Move Travis to container based infrastructure (#504, #558)
77+
* Make whitespace array more compact (#513)
78+
* Optimize Writer::WriteString() with SIMD (#544)
79+
* x86-64 48-bit pointer optimization for GenericValue (#546)
80+
* Define RAPIDJSON_HAS_CXX11_RVALUE_REFS directly in clang (#617)
81+
* Make GenericSchemaDocument constructor explicit (#674)
82+
* Optimize FindMember when use std::string (#690)
83+
84+
## [1.0.2] - 2015-05-14
85+
86+
### Added
87+
* Add Value::XXXMember(...) overloads for std::string (#335)
88+
89+
### Fixed
90+
* Include rapidjson.h for all internal/error headers.
91+
* Parsing some numbers incorrectly in full-precision mode (`kFullPrecisionParseFlag`) (#342)
92+
* Fix some numbers parsed incorrectly (#336)
93+
* Fix alignment of 64bit platforms (#328)
94+
* Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502573f1afd3341073dd24b12c3db20fbde4)
95+
96+
### Changed
97+
* CMakeLists for include as a thirdparty in projects (#334, #337)
98+
* Change Document::ParseStream() to use stack allocator for Reader (ffbe38614732af8e0b3abdc8b50071f386a4a685)
99+
100+
## [1.0.1] - 2015-04-25
101+
102+
### Added
103+
* Changelog following [Keep a CHANGELOG](https://github.com/olivierlacan/keep-a-changelog) suggestions.
104+
105+
### Fixed
106+
* Parsing of some numbers (e.g. "1e-00011111111111") causing assertion (#314).
107+
* Visual C++ 32-bit compilation error in `diyfp.h` (#317).
108+
109+
## [1.0.0] - 2015-04-22
110+
111+
### Added
112+
* 100% [Coverall](https://coveralls.io/r/Tencent/rapidjson?branch=master) coverage.
113+
* Version macros (#311)
114+
115+
### Fixed
116+
* A bug in trimming long number sequence (4824f12efbf01af72b8cb6fc96fae7b097b73015).
117+
* Double quote in unicode escape (#288).
118+
* Negative zero roundtrip (double only) (#289).
119+
* Standardize behavior of `memcpy()` and `malloc()` (0c5c1538dcfc7f160e5a4aa208ddf092c787be5a, #305, 0e8bbe5e3ef375e7f052f556878be0bd79e9062d).
120+
121+
### Removed
122+
* Remove an invalid `Document::ParseInsitu()` API (e7f1c6dd08b522cfcf9aed58a333bd9a0c0ccbeb).
123+
124+
## 1.0-beta - 2015-04-8
125+
126+
### Added
127+
* RFC 7159 (#101)
128+
* Optional Iterative Parser (#76)
129+
* Deep-copy values (#20)
130+
* Error code and message (#27)
131+
* ASCII Encoding (#70)
132+
* `kParseStopWhenDoneFlag` (#83)
133+
* `kParseFullPrecisionFlag` (881c91d696f06b7f302af6d04ec14dd08db66ceb)
134+
* Add `Key()` to handler concept (#134)
135+
* C++11 compatibility and support (#128)
136+
* Optimized number-to-string and vice versa conversions (#137, #80)
137+
* Short-String Optimization (#131)
138+
* Local stream optimization by traits (#32)
139+
* Travis & Appveyor Continuous Integration, with Valgrind verification (#24, #242)
140+
* Redo all documentation (English, Simplified Chinese)
141+
142+
### Changed
143+
* Copyright ownership transferred to THL A29 Limited (a Tencent company).
144+
* Migrating from Premake to CMAKE (#192)
145+
* Resolve all warning reports
146+
147+
### Removed
148+
* Remove other JSON libraries for performance comparison (#180)
149+
150+
## 0.11 - 2012-11-16
151+
152+
## 0.1 - 2011-11-18
153+
154+
[Unreleased]: https://github.com/Tencent/rapidjson/compare/v1.1.0...HEAD
155+
[1.1.0]: https://github.com/Tencent/rapidjson/compare/v1.0.2...v1.1.0
156+
[1.0.2]: https://github.com/Tencent/rapidjson/compare/v1.0.1...v1.0.2
157+
[1.0.1]: https://github.com/Tencent/rapidjson/compare/v1.0.0...v1.0.1
158+
[1.0.0]: https://github.com/Tencent/rapidjson/compare/v1.0-beta...v1.0.0

0 commit comments

Comments
 (0)