rj_schema 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (371) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rj_schema/rapidjson/CMakeLists.txt +9 -4
  3. data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +10 -0
  4. data/ext/rj_schema/rapidjson/appveyor.yml +22 -9
  5. data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
  6. data/ext/rj_schema/rapidjson/bin/unittestschema/address.json +139 -0
  7. data/ext/rj_schema/rapidjson/bin/unittestschema/allOf_address.json +7 -0
  8. data/ext/rj_schema/rapidjson/bin/unittestschema/anyOf_address.json +7 -0
  9. data/ext/rj_schema/rapidjson/bin/unittestschema/oneOf_address.json +7 -0
  10. data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +2 -2
  11. data/ext/rj_schema/rapidjson/doc/dom.md +1 -0
  12. data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +1 -0
  13. data/ext/rj_schema/rapidjson/doc/faq.md +3 -3
  14. data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +8 -8
  15. data/ext/rj_schema/rapidjson/doc/internals.md +1 -1
  16. data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +2 -2
  17. data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +1 -1
  18. data/ext/rj_schema/rapidjson/doc/sax.md +1 -1
  19. data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +2 -2
  20. data/ext/rj_schema/rapidjson/doc/stream.md +1 -1
  21. data/ext/rj_schema/rapidjson/doc/tutorial.md +1 -1
  22. data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +7 -6
  23. data/ext/rj_schema/rapidjson/example/CMakeLists.txt +1 -0
  24. data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +118 -0
  25. data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
  26. data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +1 -1
  27. data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +6 -6
  28. data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +1 -1
  29. data/ext/rj_schema/rapidjson/include/rapidjson/document.h +124 -35
  30. data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +1 -1
  31. data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +1 -1
  32. data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +49 -1
  33. data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +56 -1
  34. data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +2 -2
  35. data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +1 -1
  36. data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +2 -2
  37. data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +2 -2
  38. data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
  39. data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +3 -17
  40. data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +1 -1
  41. data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +1 -1
  42. data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +1 -1
  43. data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +1 -1
  44. data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +1 -1
  45. data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +20 -13
  46. data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +4 -3
  47. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +1 -1
  48. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +1 -1
  49. data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +1 -1
  50. data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +50 -35
  51. data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +1 -1
  52. data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +1 -1
  53. data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +1 -1
  54. data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +63 -5
  55. data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +2 -2
  56. data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +63 -1
  57. data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +67 -53
  58. data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +318 -164
  59. data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +1 -1
  60. data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +1 -1
  61. data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +10 -10
  62. data/ext/rj_schema/rapidjson/readme.md +51 -1
  63. data/ext/rj_schema/rapidjson/readme.zh-cn.md +2 -2
  64. data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +1 -1
  65. data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +1 -1
  66. data/ext/rj_schema/rapidjson/test/perftest/perftest.h +1 -1
  67. data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +2 -2
  68. data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +75 -1
  69. data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +1 -0
  70. data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +1 -1
  71. data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +1 -1
  72. data/ext/rj_schema/rapidjson/test/unittest/clzlltest.cpp +34 -0
  73. data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +19 -19
  74. data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +1 -1
  75. data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +1 -1
  76. data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +1 -1
  77. data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +1 -1
  78. data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +45 -2
  79. data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +1 -1
  80. data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +10 -10
  81. data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +8 -8
  82. data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +1 -1
  83. data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +1 -1
  84. data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +1 -1
  85. data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +157 -16
  86. data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +1 -1
  87. data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +113 -75
  88. data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +2 -1
  89. data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +593 -78
  90. data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +1 -1
  91. data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +1 -1
  92. data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +5 -5
  93. data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +1 -1
  94. data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +1 -1
  95. data/ext/rj_schema/rapidjson/test/unittest/unittest.h +4 -1
  96. data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +12 -12
  97. data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +1 -1
  98. data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
  99. data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +18 -1
  100. data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
  101. data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
  102. data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
  103. data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +16 -35
  104. data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
  105. data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
  106. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
  107. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
  108. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
  109. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
  110. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
  111. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
  112. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
  113. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
  114. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
  115. data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
  116. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +1 -1
  117. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +72 -32
  118. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +53 -42
  119. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
  120. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
  121. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +4 -4
  122. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +6 -4
  123. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +117 -132
  124. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +7 -4
  125. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +20 -12
  126. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +1 -2
  127. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +83 -26
  128. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +262 -68
  129. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +45 -6
  130. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +650 -366
  131. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +76 -20
  132. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +308 -229
  133. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +18 -15
  134. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +87 -26
  135. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +33 -16
  136. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +1209 -353
  137. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +33 -0
  138. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +159 -88
  139. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +2 -1
  140. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +1 -1
  141. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +3 -4
  142. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +16 -9
  143. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +71 -8
  144. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +7 -11
  145. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +14 -0
  146. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +69 -6
  147. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +2 -2
  148. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +69 -6
  149. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +83 -8
  150. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +14 -0
  151. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +63 -2
  152. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +63 -2
  153. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +76 -3
  154. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +1 -1
  155. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +4 -5
  156. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +3 -3
  157. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +1 -1
  158. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +36 -6
  159. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +210 -135
  160. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +108 -48
  161. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +23 -1
  162. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
  163. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +166 -2
  164. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +1 -1
  165. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +64 -62
  166. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +43 -18
  167. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +11 -9
  168. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +91 -36
  169. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +33 -14
  170. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +1286 -167
  171. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +85 -83
  172. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +102 -15
  173. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +136 -9
  174. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +1 -1
  175. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +1 -1
  176. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +24 -2
  177. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +8 -5
  178. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +20 -1
  179. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +8 -1
  180. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +3 -2
  181. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +44 -2
  182. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +5 -7
  183. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +40 -14
  184. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +60 -31
  185. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +232 -171
  186. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
  187. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
  188. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +54 -16
  189. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +1 -1
  190. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
  191. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +2 -2
  192. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +6 -6
  193. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{AdvancedGuide.md → advanced.md} +260 -26
  194. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{FAQ.md → faq.md} +62 -57
  195. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{Primer.md → primer.md} +43 -9
  196. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{Samples.md → samples.md} +0 -0
  197. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +53 -5
  198. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +1 -2
  199. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +30 -36
  200. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +8 -17
  201. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +140 -51
  202. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +2 -3
  203. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +4 -3
  204. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +126 -30
  205. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +6 -7
  206. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +8 -5
  207. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +6 -5
  208. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +4 -0
  209. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +13 -57
  210. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +1 -2
  211. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +98 -59
  212. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +34 -41
  213. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +3 -10
  214. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +9 -17
  215. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +8 -1
  216. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +232 -99
  217. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +3 -3
  218. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +17 -1
  219. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +17 -1
  220. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
  221. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
  222. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
  223. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
  224. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
  225. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
  226. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
  227. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
  228. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
  229. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
  230. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
  231. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
  232. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
  233. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
  234. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
  235. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
  236. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
  237. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
  238. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +6 -2
  239. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +1 -1
  240. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +0 -4
  241. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +2 -1
  242. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +2 -1
  243. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +7 -6
  244. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +5 -1
  245. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +3 -3
  246. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +2 -1
  247. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +10 -22
  248. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +2 -1
  249. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +0 -3
  250. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +1 -1
  251. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +10 -10
  252. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1 -1
  253. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +1 -1
  254. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +226 -32
  255. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +5 -7
  256. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +21 -29
  257. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +85 -67
  258. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +93 -8
  259. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +1 -9
  260. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +1 -0
  261. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +622 -164
  262. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +1 -1
  263. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
  264. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +12 -15
  265. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +2 -12
  266. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +1 -1
  267. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +6 -8
  268. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +1 -5
  269. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +84 -29
  270. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +1 -5
  271. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +11 -12
  272. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +165 -63
  273. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +1 -1
  274. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +1 -1
  275. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +1 -1
  276. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +13 -13
  277. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
  278. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +1 -3
  279. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +1 -2
  280. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +0 -2
  281. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +1 -1
  282. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +1 -2
  283. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +0 -8
  284. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +6 -4
  285. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +0 -2
  286. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +0 -3
  287. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +20 -18
  288. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +0 -2
  289. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +1 -1
  290. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
  291. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
  292. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
  293. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +4 -4
  294. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +2 -2
  295. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +11 -7
  296. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +17 -12
  297. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +104 -66
  298. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +1 -1
  299. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +2 -2
  300. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +2 -19
  301. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +0 -6
  302. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +12 -14
  303. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
  304. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
  305. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +1 -1
  306. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +4 -5
  307. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +2 -2
  308. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +240 -149
  309. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +0 -1
  310. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +0 -1
  311. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +15 -7
  312. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +100 -30
  313. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +0 -2
  314. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +25 -23
  315. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +1 -1
  316. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +1 -1
  317. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +4 -4
  318. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +47 -0
  319. data/ext/rj_schema/rapidjson/travis-doxygen.sh +13 -6
  320. data/ext/rj_schema/rj_schema.cpp +161 -17
  321. data/lib/rj_schema.rb +1 -1
  322. metadata +63 -58
  323. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DevGuide.md +0 -132
  324. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CheatSheet.md +0 -525
  325. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CookBook.md +0 -3250
  326. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/Documentation.md +0 -11
  327. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/ForDummies.md +0 -439
  328. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/FrequentlyAskedQuestions.md +0 -624
  329. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CheatSheet.md +0 -534
  330. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CookBook.md +0 -3342
  331. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/Documentation.md +0 -12
  332. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/ForDummies.md +0 -439
  333. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/FrequentlyAskedQuestions.md +0 -628
  334. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CheatSheet.md +0 -556
  335. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CookBook.md +0 -3432
  336. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/Documentation.md +0 -12
  337. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/ForDummies.md +0 -439
  338. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/FrequentlyAskedQuestions.md +0 -628
  339. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/DevGuide.md +0 -126
  340. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Documentation.md +0 -14
  341. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_AdvancedGuide.md +0 -2096
  342. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Documentation.md +0 -12
  343. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_FAQ.md +0 -886
  344. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Primer.md +0 -497
  345. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_PumpManual.md +0 -177
  346. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_XcodeGuide.md +0 -93
  347. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_AdvancedGuide.md +0 -2178
  348. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Documentation.md +0 -14
  349. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_FAQ.md +0 -1038
  350. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Primer.md +0 -501
  351. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_PumpManual.md +0 -177
  352. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Samples.md +0 -14
  353. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_XcodeGuide.md +0 -93
  354. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_AdvancedGuide.md +0 -2181
  355. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Documentation.md +0 -14
  356. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_FAQ.md +0 -1082
  357. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Primer.md +0 -501
  358. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_PumpManual.md +0 -177
  359. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Samples.md +0 -14
  360. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_XcodeGuide.md +0 -93
  361. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.sln +0 -45
  362. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.vcproj +0 -126
  363. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.sln +0 -45
  364. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.vcproj +0 -126
  365. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main-md.vcproj +0 -129
  366. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main.vcproj +0 -129
  367. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test-md.vcproj +0 -164
  368. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test.vcproj +0 -164
  369. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest-md.vcproj +0 -147
  370. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest.vcproj +0 -147
  371. data/ext/rj_schema/rapidjson/thirdparty/gtest/travis.sh +0 -15
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -17,6 +17,7 @@
17
17
 
18
18
  #include "../allocators.h"
19
19
  #include "swap.h"
20
+ #include <cstddef>
20
21
 
21
22
  #if defined(__clang__)
22
23
  RAPIDJSON_DIAG_PUSH
@@ -114,7 +115,7 @@ public:
114
115
  template<typename T>
115
116
  RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) {
116
117
  // Expand the stack if needed
117
- if (RAPIDJSON_UNLIKELY(stackTop_ + sizeof(T) * count > stackEnd_))
118
+ if (RAPIDJSON_UNLIKELY(static_cast<std::ptrdiff_t>(sizeof(T) * count) > (stackEnd_ - stackTop_)))
118
119
  Expand<T>(count);
119
120
  }
120
121
 
@@ -127,7 +128,7 @@ public:
127
128
  template<typename T>
128
129
  RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) {
129
130
  RAPIDJSON_ASSERT(stackTop_);
130
- RAPIDJSON_ASSERT(stackTop_ + sizeof(T) * count <= stackEnd_);
131
+ RAPIDJSON_ASSERT(static_cast<std::ptrdiff_t>(sizeof(T) * count) <= (stackEnd_ - stackTop_));
131
132
  T* ret = reinterpret_cast<T*>(stackTop_);
132
133
  stackTop_ += sizeof(T) * count;
133
134
  return ret;
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -17,6 +17,7 @@
17
17
 
18
18
  #include "stream.h"
19
19
  #include <iosfwd>
20
+ #include <ios>
20
21
 
21
22
  #ifdef __clang__
22
23
  RAPIDJSON_DIAG_PUSH
@@ -48,57 +49,71 @@ template <typename StreamType>
48
49
  class BasicIStreamWrapper {
49
50
  public:
50
51
  typedef typename StreamType::char_type Ch;
51
- BasicIStreamWrapper(StreamType& stream) : stream_(stream), count_(), peekBuffer_() {}
52
52
 
53
- Ch Peek() const {
54
- typename StreamType::int_type c = stream_.peek();
55
- return RAPIDJSON_LIKELY(c != StreamType::traits_type::eof()) ? static_cast<Ch>(c) : static_cast<Ch>('\0');
53
+ //! Constructor.
54
+ /*!
55
+ \param stream stream opened for read.
56
+ */
57
+ BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) {
58
+ Read();
56
59
  }
57
60
 
58
- Ch Take() {
59
- typename StreamType::int_type c = stream_.get();
60
- if (RAPIDJSON_LIKELY(c != StreamType::traits_type::eof())) {
61
- count_++;
62
- return static_cast<Ch>(c);
63
- }
64
- else
65
- return '\0';
61
+ //! Constructor.
62
+ /*!
63
+ \param stream stream opened for read.
64
+ \param buffer user-supplied buffer.
65
+ \param bufferSize size of buffer in bytes. Must >=4 bytes.
66
+ */
67
+ BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) {
68
+ RAPIDJSON_ASSERT(bufferSize >= 4);
69
+ Read();
66
70
  }
67
71
 
68
- // tellg() may return -1 when failed. So we count by ourself.
69
- size_t Tell() const { return count_; }
72
+ Ch Peek() const { return *current_; }
73
+ Ch Take() { Ch c = *current_; Read(); return c; }
74
+ size_t Tell() const { return count_ + static_cast<size_t>(current_ - buffer_); }
70
75
 
71
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
76
+ // Not implemented
72
77
  void Put(Ch) { RAPIDJSON_ASSERT(false); }
73
- void Flush() { RAPIDJSON_ASSERT(false); }
78
+ void Flush() { RAPIDJSON_ASSERT(false); }
79
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
74
80
  size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
75
81
 
76
82
  // For encoding detection only.
77
83
  const Ch* Peek4() const {
78
- RAPIDJSON_ASSERT(sizeof(Ch) == 1); // Only usable for byte stream.
79
- int i;
80
- bool hasError = false;
81
- for (i = 0; i < 4; ++i) {
82
- typename StreamType::int_type c = stream_.get();
83
- if (c == StreamType::traits_type::eof()) {
84
- hasError = true;
85
- stream_.clear();
86
- break;
87
- }
88
- peekBuffer_[i] = static_cast<Ch>(c);
89
- }
90
- for (--i; i >= 0; --i)
91
- stream_.putback(peekBuffer_[i]);
92
- return !hasError ? peekBuffer_ : 0;
84
+ return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0;
93
85
  }
94
86
 
95
87
  private:
88
+ BasicIStreamWrapper();
96
89
  BasicIStreamWrapper(const BasicIStreamWrapper&);
97
90
  BasicIStreamWrapper& operator=(const BasicIStreamWrapper&);
98
91
 
99
- StreamType& stream_;
100
- size_t count_; //!< Number of characters read. Note:
101
- mutable Ch peekBuffer_[4];
92
+ void Read() {
93
+ if (current_ < bufferLast_)
94
+ ++current_;
95
+ else if (!eof_) {
96
+ count_ += readCount_;
97
+ readCount_ = bufferSize_;
98
+ bufferLast_ = buffer_ + readCount_ - 1;
99
+ current_ = buffer_;
100
+
101
+ if (!stream_.read(buffer_, static_cast<std::streamsize>(bufferSize_))) {
102
+ readCount_ = static_cast<size_t>(stream_.gcount());
103
+ *(bufferLast_ = buffer_ + readCount_) = '\0';
104
+ eof_ = true;
105
+ }
106
+ }
107
+ }
108
+
109
+ StreamType &stream_;
110
+ Ch peekBuffer_[4], *buffer_;
111
+ size_t bufferSize_;
112
+ Ch *bufferLast_;
113
+ Ch *current_;
114
+ size_t readCount_;
115
+ size_t count_; //!< Number of characters read
116
+ bool eof_;
102
117
  };
103
118
 
104
119
  typedef BasicIStreamWrapper<std::istream> IStreamWrapper;
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -200,6 +200,36 @@ public:
200
200
  return *this;
201
201
  }
202
202
 
203
+ //! Swap the content of this pointer with an other.
204
+ /*!
205
+ \param other The pointer to swap with.
206
+ \note Constant complexity.
207
+ */
208
+ GenericPointer& Swap(GenericPointer& other) RAPIDJSON_NOEXCEPT {
209
+ internal::Swap(allocator_, other.allocator_);
210
+ internal::Swap(ownAllocator_, other.ownAllocator_);
211
+ internal::Swap(nameBuffer_, other.nameBuffer_);
212
+ internal::Swap(tokens_, other.tokens_);
213
+ internal::Swap(tokenCount_, other.tokenCount_);
214
+ internal::Swap(parseErrorOffset_, other.parseErrorOffset_);
215
+ internal::Swap(parseErrorCode_, other.parseErrorCode_);
216
+ return *this;
217
+ }
218
+
219
+ //! free-standing swap function helper
220
+ /*!
221
+ Helper function to enable support for common swap implementation pattern based on \c std::swap:
222
+ \code
223
+ void swap(MyClass& a, MyClass& b) {
224
+ using std::swap;
225
+ swap(a.pointer, b.pointer);
226
+ // ...
227
+ }
228
+ \endcode
229
+ \see Swap()
230
+ */
231
+ friend inline void swap(GenericPointer& a, GenericPointer& b) RAPIDJSON_NOEXCEPT { a.Swap(b); }
232
+
203
233
  //@}
204
234
 
205
235
  //!@name Append token
@@ -356,6 +386,33 @@ public:
356
386
  */
357
387
  bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); }
358
388
 
389
+ //! Less than operator.
390
+ /*!
391
+ \note Invalid pointers are always greater than valid ones.
392
+ */
393
+ bool operator<(const GenericPointer& rhs) const {
394
+ if (!IsValid())
395
+ return false;
396
+ if (!rhs.IsValid())
397
+ return true;
398
+
399
+ if (tokenCount_ != rhs.tokenCount_)
400
+ return tokenCount_ < rhs.tokenCount_;
401
+
402
+ for (size_t i = 0; i < tokenCount_; i++) {
403
+ if (tokens_[i].index != rhs.tokens_[i].index)
404
+ return tokens_[i].index < rhs.tokens_[i].index;
405
+
406
+ if (tokens_[i].length != rhs.tokens_[i].length)
407
+ return tokens_[i].length < rhs.tokens_[i].length;
408
+
409
+ if (int cmp = std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch) * tokens_[i].length))
410
+ return cmp < 0;
411
+ }
412
+
413
+ return false;
414
+ }
415
+
359
416
  //@}
360
417
 
361
418
  //!@name Stringify
@@ -431,10 +488,11 @@ public:
431
488
  v = &((*v)[t->index]);
432
489
  }
433
490
  else {
434
- typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
491
+ typename ValueType::MemberIterator m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
435
492
  if (m == v->MemberEnd()) {
436
493
  v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator);
437
- v = &(--v->MemberEnd())->value; // Assumes AddMember() appends at the end
494
+ m = v->MemberEnd();
495
+ v = &(--m)->value; // Assumes AddMember() appends at the end
438
496
  exist = false;
439
497
  }
440
498
  else
@@ -486,7 +544,7 @@ public:
486
544
  switch (v->GetType()) {
487
545
  case kObjectType:
488
546
  {
489
- typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
547
+ typename ValueType::MemberIterator m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
490
548
  if (m == v->MemberEnd())
491
549
  break;
492
550
  v = &m->value;
@@ -722,7 +780,7 @@ public:
722
780
  switch (v->GetType()) {
723
781
  case kObjectType:
724
782
  {
725
- typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
783
+ typename ValueType::MemberIterator m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
726
784
  if (m == v->MemberEnd())
727
785
  return false;
728
786
  v = &m->value;
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -60,7 +60,7 @@ public:
60
60
 
61
61
 
62
62
  explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
63
- Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {}
63
+ Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {}
64
64
 
65
65
  #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
66
66
  PrettyWriter(PrettyWriter&& rhs) :
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -490,6 +490,12 @@ RAPIDJSON_NAMESPACE_END
490
490
  #define RAPIDJSON_VERSION_CODE(x,y,z) \
491
491
  (((x)*100000) + ((y)*100) + (z))
492
492
 
493
+ #if defined(__has_builtin)
494
+ #define RAPIDJSON_HAS_BUILTIN(x) __has_builtin(x)
495
+ #else
496
+ #define RAPIDJSON_HAS_BUILTIN(x) 0
497
+ #endif
498
+
493
499
  ///////////////////////////////////////////////////////////////////////////////
494
500
  // RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF
495
501
 
@@ -591,8 +597,64 @@ RAPIDJSON_NAMESPACE_END
591
597
  #endif
592
598
  #endif // RAPIDJSON_HAS_CXX11_RANGE_FOR
593
599
 
600
+ ///////////////////////////////////////////////////////////////////////////////
601
+ // C++17 features
602
+
603
+ #if defined(__has_cpp_attribute)
604
+ # if __has_cpp_attribute(fallthrough)
605
+ # define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]]
606
+ # else
607
+ # define RAPIDJSON_DELIBERATE_FALLTHROUGH
608
+ # endif
609
+ #else
610
+ # define RAPIDJSON_DELIBERATE_FALLTHROUGH
611
+ #endif
612
+
594
613
  //!@endcond
595
614
 
615
+ //! Assertion (in non-throwing contexts).
616
+ /*! \ingroup RAPIDJSON_CONFIG
617
+ Some functions provide a \c noexcept guarantee, if the compiler supports it.
618
+ In these cases, the \ref RAPIDJSON_ASSERT macro cannot be overridden to
619
+ throw an exception. This macro adds a separate customization point for
620
+ such cases.
621
+
622
+ Defaults to C \c assert() (as \ref RAPIDJSON_ASSERT), if \c noexcept is
623
+ supported, and to \ref RAPIDJSON_ASSERT otherwise.
624
+ */
625
+
626
+ ///////////////////////////////////////////////////////////////////////////////
627
+ // RAPIDJSON_NOEXCEPT_ASSERT
628
+
629
+ #ifndef RAPIDJSON_NOEXCEPT_ASSERT
630
+ #ifdef RAPIDJSON_ASSERT_THROWS
631
+ #if RAPIDJSON_HAS_CXX11_NOEXCEPT
632
+ #define RAPIDJSON_NOEXCEPT_ASSERT(x)
633
+ #else
634
+ #include <cassert>
635
+ #define RAPIDJSON_NOEXCEPT_ASSERT(x) assert(x)
636
+ #endif // RAPIDJSON_HAS_CXX11_NOEXCEPT
637
+ #else
638
+ #define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x)
639
+ #endif // RAPIDJSON_ASSERT_THROWS
640
+ #endif // RAPIDJSON_NOEXCEPT_ASSERT
641
+
642
+ ///////////////////////////////////////////////////////////////////////////////
643
+ // malloc/realloc/free
644
+
645
+ #ifndef RAPIDJSON_MALLOC
646
+ ///! customization point for global \c malloc
647
+ #define RAPIDJSON_MALLOC(size) std::malloc(size)
648
+ #endif
649
+ #ifndef RAPIDJSON_REALLOC
650
+ ///! customization point for global \c realloc
651
+ #define RAPIDJSON_REALLOC(ptr, new_size) std::realloc(ptr, new_size)
652
+ #endif
653
+ #ifndef RAPIDJSON_FREE
654
+ ///! customization point for global \c free
655
+ #define RAPIDJSON_FREE(ptr) std::free(ptr)
656
+ #endif
657
+
596
658
  ///////////////////////////////////////////////////////////////////////////////
597
659
  // new/delete
598
660
 
@@ -1,6 +1,6 @@
1
1
  // Tencent is pleased to support the open source community by making RapidJSON available.
2
2
  //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4
4
  //
5
5
  // Licensed under the MIT License (the "License"); you may not use this file except
6
6
  // in compliance with the License. You may obtain a copy of the License at
@@ -20,6 +20,7 @@
20
20
  #include "allocators.h"
21
21
  #include "stream.h"
22
22
  #include "encodedstream.h"
23
+ #include "internal/clzll.h"
23
24
  #include "internal/meta.h"
24
25
  #include "internal/stack.h"
25
26
  #include "internal/strtod.h"
@@ -153,6 +154,7 @@ enum ParseFlag {
153
154
  kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings.
154
155
  kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays.
155
156
  kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles.
157
+ kParseEscapedApostropheFlag = 512, //!< Allow escaped apostrophe in strings.
156
158
  kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS
157
159
  };
158
160
 
@@ -443,16 +445,16 @@ inline const char *SkipWhitespace_SIMD(const char* p) {
443
445
 
444
446
  x = vmvnq_u8(x); // Negate
445
447
  x = vrev64q_u8(x); // Rev in 64
446
- uint64_t low = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 0); // extract
447
- uint64_t high = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 1); // extract
448
+ uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
449
+ uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
448
450
 
449
451
  if (low == 0) {
450
452
  if (high != 0) {
451
- int lz =__builtin_clzll(high);;
453
+ uint32_t lz = internal::clzll(high);
452
454
  return p + 8 + (lz >> 3);
453
455
  }
454
456
  } else {
455
- int lz = __builtin_clzll(low);;
457
+ uint32_t lz = internal::clzll(low);
456
458
  return p + (lz >> 3);
457
459
  }
458
460
  }
@@ -479,16 +481,16 @@ inline const char *SkipWhitespace_SIMD(const char* p, const char* end) {
479
481
 
480
482
  x = vmvnq_u8(x); // Negate
481
483
  x = vrev64q_u8(x); // Rev in 64
482
- uint64_t low = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 0); // extract
483
- uint64_t high = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 1); // extract
484
+ uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
485
+ uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
484
486
 
485
487
  if (low == 0) {
486
488
  if (high != 0) {
487
- int lz = __builtin_clzll(high);
489
+ uint32_t lz = internal::clzll(high);
488
490
  return p + 8 + (lz >> 3);
489
491
  }
490
492
  } else {
491
- int lz = __builtin_clzll(low);
493
+ uint32_t lz = internal::clzll(low);
492
494
  return p + (lz >> 3);
493
495
  }
494
496
  }
@@ -606,7 +608,7 @@ public:
606
608
  parseResult_.Clear();
607
609
  state_ = IterativeParsingStartState;
608
610
  }
609
-
611
+
610
612
  //! Parse one token from JSON text
611
613
  /*! \tparam InputStream Type of input stream, implementing Stream concept
612
614
  \tparam Handler Type of handler, implementing Handler concept.
@@ -618,11 +620,11 @@ public:
618
620
  bool IterativeParseNext(InputStream& is, Handler& handler) {
619
621
  while (RAPIDJSON_LIKELY(is.Peek() != '\0')) {
620
622
  SkipWhitespaceAndComments<parseFlags>(is);
621
-
623
+
622
624
  Token t = Tokenize(is.Peek());
623
625
  IterativeParsingState n = Predict(state_, t);
624
626
  IterativeParsingState d = Transit<parseFlags>(state_, t, n, is, handler);
625
-
627
+
626
628
  // If we've finished or hit an error...
627
629
  if (RAPIDJSON_UNLIKELY(IsIterativeParsingCompleteState(d))) {
628
630
  // Report errors.
@@ -630,11 +632,11 @@ public:
630
632
  HandleError(state_, is);
631
633
  return false;
632
634
  }
633
-
635
+
634
636
  // Transition to the finish state.
635
637
  RAPIDJSON_ASSERT(d == IterativeParsingFinishState);
636
638
  state_ = d;
637
-
639
+
638
640
  // If StopWhenDone is not set...
639
641
  if (!(parseFlags & kParseStopWhenDoneFlag)) {
640
642
  // ... and extra non-whitespace data is found...
@@ -645,11 +647,11 @@ public:
645
647
  return false;
646
648
  }
647
649
  }
648
-
650
+
649
651
  // Success! We are done!
650
652
  return true;
651
653
  }
652
-
654
+
653
655
  // Transition to the new state.
654
656
  state_ = d;
655
657
 
@@ -657,7 +659,7 @@ public:
657
659
  if (!IsIterativeParsingDelimiterState(n))
658
660
  return true;
659
661
  }
660
-
662
+
661
663
  // We reached the end of file.
662
664
  stack_.Clear();
663
665
 
@@ -665,10 +667,10 @@ public:
665
667
  HandleError(state_, is);
666
668
  return false;
667
669
  }
668
-
670
+
669
671
  return true;
670
672
  }
671
-
673
+
672
674
  //! Check if token-by-token parsing JSON text is complete
673
675
  /*! \return Whether the JSON has been fully decoded.
674
676
  */
@@ -990,7 +992,7 @@ private:
990
992
  //!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
991
993
  #define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
992
994
  static const char escape[256] = {
993
- Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/',
995
+ Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/',
994
996
  Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0,
995
997
  0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0,
996
998
  0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1013,19 +1015,31 @@ private:
1013
1015
  is.Take();
1014
1016
  os.Put(static_cast<typename TEncoding::Ch>(escape[static_cast<unsigned char>(e)]));
1015
1017
  }
1018
+ else if ((parseFlags & kParseEscapedApostropheFlag) && RAPIDJSON_LIKELY(e == '\'')) { // Allow escaped apostrophe
1019
+ is.Take();
1020
+ os.Put('\'');
1021
+ }
1016
1022
  else if (RAPIDJSON_LIKELY(e == 'u')) { // Unicode
1017
1023
  is.Take();
1018
1024
  unsigned codepoint = ParseHex4(is, escapeOffset);
1019
1025
  RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
1020
- if (RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDBFF)) {
1021
- // Handle UTF-16 surrogate pair
1022
- if (RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u')))
1023
- RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
1024
- unsigned codepoint2 = ParseHex4(is, escapeOffset);
1025
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
1026
- if (RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF))
1026
+ if (RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDFFF)) {
1027
+ // high surrogate, check if followed by valid low surrogate
1028
+ if (RAPIDJSON_LIKELY(codepoint <= 0xDBFF)) {
1029
+ // Handle UTF-16 surrogate pair
1030
+ if (RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u')))
1031
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
1032
+ unsigned codepoint2 = ParseHex4(is, escapeOffset);
1033
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
1034
+ if (RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF))
1035
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
1036
+ codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000;
1037
+ }
1038
+ // single low surrogate
1039
+ else
1040
+ {
1027
1041
  RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
1028
- codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000;
1042
+ }
1029
1043
  }
1030
1044
  TEncoding::Encode(os, codepoint);
1031
1045
  }
@@ -1244,19 +1258,19 @@ private:
1244
1258
  x = vorrq_u8(x, vcltq_u8(s, s3));
1245
1259
 
1246
1260
  x = vrev64q_u8(x); // Rev in 64
1247
- uint64_t low = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 0); // extract
1248
- uint64_t high = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 1); // extract
1261
+ uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
1262
+ uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
1249
1263
 
1250
1264
  SizeType length = 0;
1251
1265
  bool escaped = false;
1252
1266
  if (low == 0) {
1253
1267
  if (high != 0) {
1254
- unsigned lz = (unsigned)__builtin_clzll(high);;
1268
+ uint32_t lz = internal::clzll(high);
1255
1269
  length = 8 + (lz >> 3);
1256
1270
  escaped = true;
1257
1271
  }
1258
1272
  } else {
1259
- unsigned lz = (unsigned)__builtin_clzll(low);;
1273
+ uint32_t lz = internal::clzll(low);
1260
1274
  length = lz >> 3;
1261
1275
  escaped = true;
1262
1276
  }
@@ -1314,19 +1328,19 @@ private:
1314
1328
  x = vorrq_u8(x, vcltq_u8(s, s3));
1315
1329
 
1316
1330
  x = vrev64q_u8(x); // Rev in 64
1317
- uint64_t low = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 0); // extract
1318
- uint64_t high = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 1); // extract
1331
+ uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
1332
+ uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
1319
1333
 
1320
1334
  SizeType length = 0;
1321
1335
  bool escaped = false;
1322
1336
  if (low == 0) {
1323
1337
  if (high != 0) {
1324
- unsigned lz = (unsigned)__builtin_clzll(high);
1338
+ uint32_t lz = internal::clzll(high);
1325
1339
  length = 8 + (lz >> 3);
1326
1340
  escaped = true;
1327
1341
  }
1328
1342
  } else {
1329
- unsigned lz = (unsigned)__builtin_clzll(low);
1343
+ uint32_t lz = internal::clzll(low);
1330
1344
  length = lz >> 3;
1331
1345
  escaped = true;
1332
1346
  }
@@ -1370,17 +1384,17 @@ private:
1370
1384
  x = vorrq_u8(x, vcltq_u8(s, s3));
1371
1385
 
1372
1386
  x = vrev64q_u8(x); // Rev in 64
1373
- uint64_t low = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 0); // extract
1374
- uint64_t high = vgetq_lane_u64(reinterpret_cast<uint64x2_t>(x), 1); // extract
1387
+ uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
1388
+ uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
1375
1389
 
1376
1390
  if (low == 0) {
1377
1391
  if (high != 0) {
1378
- int lz = __builtin_clzll(high);
1392
+ uint32_t lz = internal::clzll(high);
1379
1393
  p += 8 + (lz >> 3);
1380
1394
  break;
1381
1395
  }
1382
1396
  } else {
1383
- int lz = __builtin_clzll(low);
1397
+ uint32_t lz = internal::clzll(low);
1384
1398
  p += lz >> 3;
1385
1399
  break;
1386
1400
  }
@@ -1403,7 +1417,7 @@ private:
1403
1417
  RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); }
1404
1418
  RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); }
1405
1419
  RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); }
1406
- RAPIDJSON_FORCEINLINE void Push(char) {}
1420
+ RAPIDJSON_FORCEINLINE void Push(char) {}
1407
1421
 
1408
1422
  size_t Tell() { return is.Tell(); }
1409
1423
  size_t Length() { return 0; }
@@ -1523,7 +1537,7 @@ private:
1523
1537
  }
1524
1538
  }
1525
1539
  }
1526
-
1540
+
1527
1541
  if (RAPIDJSON_UNLIKELY(!useNanOrInf)) {
1528
1542
  RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell());
1529
1543
  }
@@ -1769,12 +1783,12 @@ private:
1769
1783
 
1770
1784
  // Single value state
1771
1785
  IterativeParsingValueState,
1772
-
1786
+
1773
1787
  // Delimiter states (at bottom)
1774
1788
  IterativeParsingElementDelimiterState,
1775
1789
  IterativeParsingMemberDelimiterState,
1776
1790
  IterativeParsingKeyValueDelimiterState,
1777
-
1791
+
1778
1792
  cIterativeParsingStateCount
1779
1793
  };
1780
1794
 
@@ -2167,43 +2181,43 @@ private:
2167
2181
  RAPIDJSON_FORCEINLINE bool IsIterativeParsingDelimiterState(IterativeParsingState s) const {
2168
2182
  return s >= IterativeParsingElementDelimiterState;
2169
2183
  }
2170
-
2184
+
2171
2185
  RAPIDJSON_FORCEINLINE bool IsIterativeParsingCompleteState(IterativeParsingState s) const {
2172
2186
  return s <= IterativeParsingErrorState;
2173
2187
  }
2174
-
2188
+
2175
2189
  template <unsigned parseFlags, typename InputStream, typename Handler>
2176
2190
  ParseResult IterativeParse(InputStream& is, Handler& handler) {
2177
2191
  parseResult_.Clear();
2178
2192
  ClearStackOnExit scope(*this);
2179
2193
  IterativeParsingState state = IterativeParsingStartState;
2180
-
2194
+
2181
2195
  SkipWhitespaceAndComments<parseFlags>(is);
2182
2196
  RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
2183
2197
  while (is.Peek() != '\0') {
2184
2198
  Token t = Tokenize(is.Peek());
2185
2199
  IterativeParsingState n = Predict(state, t);
2186
2200
  IterativeParsingState d = Transit<parseFlags>(state, t, n, is, handler);
2187
-
2201
+
2188
2202
  if (d == IterativeParsingErrorState) {
2189
2203
  HandleError(state, is);
2190
2204
  break;
2191
2205
  }
2192
-
2206
+
2193
2207
  state = d;
2194
-
2208
+
2195
2209
  // Do not further consume streams if a root JSON has been parsed.
2196
2210
  if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState)
2197
2211
  break;
2198
-
2212
+
2199
2213
  SkipWhitespaceAndComments<parseFlags>(is);
2200
2214
  RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
2201
2215
  }
2202
-
2216
+
2203
2217
  // Handle the end of file.
2204
2218
  if (state != IterativeParsingFinishState)
2205
2219
  HandleError(state, is);
2206
-
2220
+
2207
2221
  return parseResult_;
2208
2222
  }
2209
2223