rj_schema 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (614) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
  3. data/ext/rj_schema/rapidjson/CMakeLists.txt +226 -0
  4. data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
  5. data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
  6. data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +25 -0
  7. data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
  8. data/ext/rj_schema/rapidjson/appveyor.yml +54 -0
  9. data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
  10. data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
  11. data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
  12. data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
  13. data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
  14. data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
  15. data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
  16. data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
  17. data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
  18. data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
  19. data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
  20. data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
  21. data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
  22. data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
  23. data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
  24. data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
  25. data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
  26. data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
  27. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
  28. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
  29. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
  30. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
  31. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
  32. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
  33. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
  34. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
  35. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
  36. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
  37. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
  38. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
  39. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
  40. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
  41. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
  42. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
  43. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
  44. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
  45. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
  46. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
  47. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
  48. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
  49. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
  50. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
  51. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
  52. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
  53. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
  54. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
  55. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
  56. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
  57. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
  58. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
  59. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
  60. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
  61. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
  62. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
  63. data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
  64. data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
  65. data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
  66. data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
  67. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
  68. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
  69. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
  70. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
  71. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
  72. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
  73. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
  74. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
  75. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
  76. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
  77. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
  78. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
  79. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
  80. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
  81. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
  82. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
  83. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
  84. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
  85. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
  86. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
  87. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
  88. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
  89. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
  90. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
  91. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
  92. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
  93. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
  94. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
  95. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
  96. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
  97. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
  98. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
  99. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
  100. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
  101. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
  102. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
  103. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
  104. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
  105. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
  106. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
  107. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
  108. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
  109. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
  110. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
  111. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
  112. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
  113. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
  114. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
  115. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
  116. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
  117. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
  118. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
  119. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
  120. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
  121. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
  122. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
  123. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
  124. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
  125. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
  126. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
  127. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
  128. data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
  129. data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
  130. data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
  131. data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
  132. data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
  133. data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
  134. data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
  135. data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
  136. data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
  137. data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
  138. data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
  139. data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
  140. data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
  141. data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
  142. data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
  143. data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
  144. data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
  145. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
  146. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
  147. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
  148. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
  149. data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
  150. data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
  151. data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
  152. data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
  153. data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
  154. data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
  155. data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
  156. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
  157. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
  158. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
  159. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
  160. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
  161. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
  162. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
  163. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
  164. data/ext/rj_schema/rapidjson/doc/dom.md +281 -0
  165. data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +285 -0
  166. data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
  167. data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
  168. data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
  169. data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
  170. data/ext/rj_schema/rapidjson/doc/features.md +104 -0
  171. data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
  172. data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
  173. data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
  174. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
  175. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
  176. data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
  177. data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
  178. data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
  179. data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
  180. data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
  181. data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
  182. data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
  183. data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
  184. data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
  185. data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
  186. data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
  187. data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
  188. data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
  189. data/ext/rj_schema/rapidjson/doc/stream.md +429 -0
  190. data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +429 -0
  191. data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
  192. data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +535 -0
  193. data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
  194. data/ext/rj_schema/rapidjson/example/CMakeLists.txt +46 -0
  195. data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
  196. data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
  197. data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
  198. data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
  199. data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
  200. data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
  201. data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
  202. data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
  203. data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
  204. data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
  205. data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
  206. data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
  207. data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
  208. data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +78 -0
  209. data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
  210. data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
  211. data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
  212. data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
  213. data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
  214. data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
  215. data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
  216. data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +284 -0
  217. data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
  218. data/ext/rj_schema/rapidjson/include/rapidjson/document.h +2732 -0
  219. data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
  220. data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
  221. data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +74 -0
  222. data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +161 -0
  223. data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
  224. data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
  225. data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
  226. data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
  227. data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
  228. data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +257 -0
  229. data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
  230. data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
  231. data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +308 -0
  232. data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +186 -0
  233. data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
  234. data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +739 -0
  235. data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +232 -0
  236. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +69 -0
  237. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +290 -0
  238. data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
  239. data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +128 -0
  240. data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
  241. data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
  242. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
  243. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
  244. data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
  245. data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1415 -0
  246. data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
  247. data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +676 -0
  248. data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2236 -0
  249. data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2496 -0
  250. data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
  251. data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
  252. data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +710 -0
  253. data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
  254. data/ext/rj_schema/rapidjson/library.json +15 -0
  255. data/ext/rj_schema/rapidjson/license.txt +57 -0
  256. data/ext/rj_schema/rapidjson/package.json +24 -0
  257. data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
  258. data/ext/rj_schema/rapidjson/readme.md +210 -0
  259. data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
  260. data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
  261. data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
  262. data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
  263. data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
  264. data/ext/rj_schema/rapidjson/test/perftest/perftest.h +185 -0
  265. data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
  266. data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +546 -0
  267. data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
  268. data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +92 -0
  269. data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +100 -0
  270. data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
  271. data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
  272. data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +672 -0
  273. data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
  274. data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
  275. data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
  276. data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +155 -0
  277. data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
  278. data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
  279. data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
  280. data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
  281. data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
  282. data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
  283. data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1638 -0
  284. data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
  285. data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2225 -0
  286. data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
  287. data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2072 -0
  288. data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
  289. data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
  290. data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
  291. data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
  292. data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
  293. data/ext/rj_schema/rapidjson/test/unittest/unittest.h +143 -0
  294. data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1851 -0
  295. data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
  296. data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
  297. data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
  298. data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +33 -0
  299. data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
  300. data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
  301. data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
  302. data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +122 -0
  303. data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
  304. data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
  305. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
  306. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
  307. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
  308. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
  309. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
  310. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
  311. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
  312. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
  313. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
  314. data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
  315. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
  316. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +242 -0
  317. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
  318. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
  319. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
  320. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +344 -0
  321. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
  322. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
  323. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
  324. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +564 -0
  325. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3660 -0
  326. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
  327. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +15 -0
  328. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +447 -0
  329. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +627 -0
  330. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
  331. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1262 -0
  332. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
  333. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2571 -0
  334. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +833 -0
  335. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1379 -0
  336. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +347 -0
  337. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2258 -0
  338. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +675 -0
  339. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +458 -0
  340. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +178 -0
  341. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +5255 -0
  342. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
  343. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +91 -0
  344. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1918 -0
  345. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +95 -0
  346. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
  347. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
  348. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +38 -0
  349. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
  350. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +286 -0
  351. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
  352. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +574 -0
  353. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +87 -0
  354. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
  355. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
  356. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
  357. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
  358. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
  359. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
  360. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +46 -0
  361. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +145 -0
  362. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
  363. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +151 -0
  364. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +176 -0
  365. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +46 -0
  366. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +145 -0
  367. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
  368. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +151 -0
  369. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +176 -0
  370. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
  371. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
  372. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +34 -0
  373. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
  374. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  375. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
  376. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
  377. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
  378. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
  379. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
  380. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
  381. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
  382. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
  383. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
  384. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
  385. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
  386. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
  387. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
  388. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +204 -0
  389. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +573 -0
  390. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +883 -0
  391. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +205 -0
  392. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
  393. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
  394. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1575 -0
  395. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
  396. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1230 -0
  397. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +647 -0
  398. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +129 -0
  399. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1341 -0
  400. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +718 -0
  401. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +6767 -0
  402. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +710 -0
  403. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +511 -0
  404. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
  405. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2771 -0
  406. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
  407. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
  408. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
  409. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
  410. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
  411. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
  412. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +691 -0
  413. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +183 -0
  414. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +310 -0
  415. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +317 -0
  416. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +323 -0
  417. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +262 -0
  418. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +110 -0
  419. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
  420. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +312 -0
  421. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
  422. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
  423. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +339 -0
  424. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +341 -0
  425. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
  426. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
  427. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +280 -0
  428. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
  429. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
  430. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
  431. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
  432. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
  433. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
  434. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
  435. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
  436. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
  437. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
  438. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +2416 -0
  439. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/faq.md +1092 -0
  440. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/primer.md +536 -0
  441. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/samples.md +14 -0
  442. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +342 -0
  443. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +249 -0
  444. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1438 -0
  445. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +501 -0
  446. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +1082 -0
  447. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +231 -0
  448. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
  449. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +264 -0
  450. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2332 -0
  451. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +357 -0
  452. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +61 -0
  453. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +70 -0
  454. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  455. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +45 -0
  456. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +275 -0
  457. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +205 -0
  458. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1277 -0
  459. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
  460. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5139 -0
  461. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +279 -0
  462. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +723 -0
  463. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +100 -0
  464. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2687 -0
  465. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
  466. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
  467. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
  468. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3347 -0
  469. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +313 -0
  470. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
  471. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
  472. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
  473. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
  474. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
  475. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
  476. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
  477. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
  478. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
  479. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
  480. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
  481. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
  482. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
  483. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
  484. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
  485. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
  486. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
  487. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
  488. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
  489. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
  490. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
  491. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +127 -0
  492. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
  493. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
  494. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +140 -0
  495. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +154 -0
  496. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
  497. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
  498. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +110 -0
  499. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
  500. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +152 -0
  501. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
  502. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
  503. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +49 -0
  504. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
  505. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +225 -0
  506. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +118 -0
  507. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +174 -0
  508. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +157 -0
  509. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
  510. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
  511. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
  512. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
  513. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
  514. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
  515. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
  516. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
  517. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
  518. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
  519. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1536 -0
  520. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +385 -0
  521. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1175 -0
  522. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1277 -0
  523. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +458 -0
  524. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +102 -0
  525. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +119 -0
  526. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5846 -0
  527. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
  528. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
  529. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
  530. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1424 -0
  531. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +652 -0
  532. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
  533. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
  534. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
  535. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +213 -0
  536. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +61 -0
  537. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1110 -0
  538. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +53 -0
  539. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1303 -0
  540. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1737 -0
  541. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
  542. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
  543. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
  544. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
  545. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
  546. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
  547. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
  548. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
  549. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +210 -0
  550. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +87 -0
  551. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +235 -0
  552. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
  553. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +129 -0
  554. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +63 -0
  555. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +119 -0
  556. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +124 -0
  557. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +189 -0
  558. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +638 -0
  559. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +138 -0
  560. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
  561. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
  562. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
  563. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
  564. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
  565. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
  566. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
  567. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
  568. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
  569. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +344 -0
  570. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1067 -0
  571. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +781 -0
  572. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
  573. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
  574. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
  575. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +236 -0
  576. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
  577. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
  578. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
  579. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +250 -0
  580. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +318 -0
  581. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
  582. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
  583. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
  584. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
  585. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
  586. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +69 -0
  587. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
  588. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7797 -0
  589. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +48 -0
  590. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +48 -0
  591. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +140 -0
  592. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +378 -0
  593. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +179 -0
  594. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +196 -0
  595. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
  596. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
  597. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
  598. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
  599. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
  600. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
  601. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
  602. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
  603. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
  604. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
  605. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
  606. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
  607. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
  608. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
  609. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
  610. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
  611. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
  612. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1182 -0
  613. data/ext/rj_schema/rapidjson/travis-doxygen.sh +128 -0
  614. metadata +613 -1
@@ -0,0 +1,223 @@
1
+ // Tencent is pleased to support the open source community by making RapidJSON available.
2
+ //
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
+ //
5
+ // Licensed under the MIT License (the "License"); you may not use this file except
6
+ // in compliance with the License. You may obtain a copy of the License at
7
+ //
8
+ // http://opensource.org/licenses/MIT
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software distributed
11
+ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
+ // specific language governing permissions and limitations under the License.
14
+
15
+ #include "rapidjson.h"
16
+
17
+ #ifndef RAPIDJSON_STREAM_H_
18
+ #define RAPIDJSON_STREAM_H_
19
+
20
+ #include "encodings.h"
21
+
22
+ RAPIDJSON_NAMESPACE_BEGIN
23
+
24
+ ///////////////////////////////////////////////////////////////////////////////
25
+ // Stream
26
+
27
+ /*! \class rapidjson::Stream
28
+ \brief Concept for reading and writing characters.
29
+
30
+ For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd().
31
+
32
+ For write-only stream, only need to implement Put() and Flush().
33
+
34
+ \code
35
+ concept Stream {
36
+ typename Ch; //!< Character type of the stream.
37
+
38
+ //! Read the current character from stream without moving the read cursor.
39
+ Ch Peek() const;
40
+
41
+ //! Read the current character from stream and moving the read cursor to next character.
42
+ Ch Take();
43
+
44
+ //! Get the current read cursor.
45
+ //! \return Number of characters read from start.
46
+ size_t Tell();
47
+
48
+ //! Begin writing operation at the current read pointer.
49
+ //! \return The begin writer pointer.
50
+ Ch* PutBegin();
51
+
52
+ //! Write a character.
53
+ void Put(Ch c);
54
+
55
+ //! Flush the buffer.
56
+ void Flush();
57
+
58
+ //! End the writing operation.
59
+ //! \param begin The begin write pointer returned by PutBegin().
60
+ //! \return Number of characters written.
61
+ size_t PutEnd(Ch* begin);
62
+ }
63
+ \endcode
64
+ */
65
+
66
+ //! Provides additional information for stream.
67
+ /*!
68
+ By using traits pattern, this type provides a default configuration for stream.
69
+ For custom stream, this type can be specialized for other configuration.
70
+ See TEST(Reader, CustomStringStream) in readertest.cpp for example.
71
+ */
72
+ template<typename Stream>
73
+ struct StreamTraits {
74
+ //! Whether to make local copy of stream for optimization during parsing.
75
+ /*!
76
+ By default, for safety, streams do not use local copy optimization.
77
+ Stream that can be copied fast should specialize this, like StreamTraits<StringStream>.
78
+ */
79
+ enum { copyOptimization = 0 };
80
+ };
81
+
82
+ //! Reserve n characters for writing to a stream.
83
+ template<typename Stream>
84
+ inline void PutReserve(Stream& stream, size_t count) {
85
+ (void)stream;
86
+ (void)count;
87
+ }
88
+
89
+ //! Write character to a stream, presuming buffer is reserved.
90
+ template<typename Stream>
91
+ inline void PutUnsafe(Stream& stream, typename Stream::Ch c) {
92
+ stream.Put(c);
93
+ }
94
+
95
+ //! Put N copies of a character to a stream.
96
+ template<typename Stream, typename Ch>
97
+ inline void PutN(Stream& stream, Ch c, size_t n) {
98
+ PutReserve(stream, n);
99
+ for (size_t i = 0; i < n; i++)
100
+ PutUnsafe(stream, c);
101
+ }
102
+
103
+ ///////////////////////////////////////////////////////////////////////////////
104
+ // GenericStreamWrapper
105
+
106
+ //! A Stream Wrapper
107
+ /*! \tThis string stream is a wrapper for any stream by just forwarding any
108
+ \treceived message to the origin stream.
109
+ \note implements Stream concept
110
+ */
111
+
112
+ #if defined(_MSC_VER) && _MSC_VER <= 1800
113
+ RAPIDJSON_DIAG_PUSH
114
+ RAPIDJSON_DIAG_OFF(4702) // unreachable code
115
+ RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
116
+ #endif
117
+
118
+ template <typename InputStream, typename Encoding = UTF8<> >
119
+ class GenericStreamWrapper {
120
+ public:
121
+ typedef typename Encoding::Ch Ch;
122
+ GenericStreamWrapper(InputStream& is): is_(is) {}
123
+
124
+ Ch Peek() const { return is_.Peek(); }
125
+ Ch Take() { return is_.Take(); }
126
+ size_t Tell() { return is_.Tell(); }
127
+ Ch* PutBegin() { return is_.PutBegin(); }
128
+ void Put(Ch ch) { is_.Put(ch); }
129
+ void Flush() { is_.Flush(); }
130
+ size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); }
131
+
132
+ // wrapper for MemoryStream
133
+ const Ch* Peek4() const { return is_.Peek4(); }
134
+
135
+ // wrapper for AutoUTFInputStream
136
+ UTFType GetType() const { return is_.GetType(); }
137
+ bool HasBOM() const { return is_.HasBOM(); }
138
+
139
+ protected:
140
+ InputStream& is_;
141
+ };
142
+
143
+ #if defined(_MSC_VER) && _MSC_VER <= 1800
144
+ RAPIDJSON_DIAG_POP
145
+ #endif
146
+
147
+ ///////////////////////////////////////////////////////////////////////////////
148
+ // StringStream
149
+
150
+ //! Read-only string stream.
151
+ /*! \note implements Stream concept
152
+ */
153
+ template <typename Encoding>
154
+ struct GenericStringStream {
155
+ typedef typename Encoding::Ch Ch;
156
+
157
+ GenericStringStream(const Ch *src) : src_(src), head_(src) {}
158
+
159
+ Ch Peek() const { return *src_; }
160
+ Ch Take() { return *src_++; }
161
+ size_t Tell() const { return static_cast<size_t>(src_ - head_); }
162
+
163
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
164
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
165
+ void Flush() { RAPIDJSON_ASSERT(false); }
166
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
167
+
168
+ const Ch* src_; //!< Current read position.
169
+ const Ch* head_; //!< Original head of the string.
170
+ };
171
+
172
+ template <typename Encoding>
173
+ struct StreamTraits<GenericStringStream<Encoding> > {
174
+ enum { copyOptimization = 1 };
175
+ };
176
+
177
+ //! String stream with UTF8 encoding.
178
+ typedef GenericStringStream<UTF8<> > StringStream;
179
+
180
+ ///////////////////////////////////////////////////////////////////////////////
181
+ // InsituStringStream
182
+
183
+ //! A read-write string stream.
184
+ /*! This string stream is particularly designed for in-situ parsing.
185
+ \note implements Stream concept
186
+ */
187
+ template <typename Encoding>
188
+ struct GenericInsituStringStream {
189
+ typedef typename Encoding::Ch Ch;
190
+
191
+ GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {}
192
+
193
+ // Read
194
+ Ch Peek() { return *src_; }
195
+ Ch Take() { return *src_++; }
196
+ size_t Tell() { return static_cast<size_t>(src_ - head_); }
197
+
198
+ // Write
199
+ void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; }
200
+
201
+ Ch* PutBegin() { return dst_ = src_; }
202
+ size_t PutEnd(Ch* begin) { return static_cast<size_t>(dst_ - begin); }
203
+ void Flush() {}
204
+
205
+ Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; }
206
+ void Pop(size_t count) { dst_ -= count; }
207
+
208
+ Ch* src_;
209
+ Ch* dst_;
210
+ Ch* head_;
211
+ };
212
+
213
+ template <typename Encoding>
214
+ struct StreamTraits<GenericInsituStringStream<Encoding> > {
215
+ enum { copyOptimization = 1 };
216
+ };
217
+
218
+ //! Insitu string stream with UTF8 encoding.
219
+ typedef GenericInsituStringStream<UTF8<> > InsituStringStream;
220
+
221
+ RAPIDJSON_NAMESPACE_END
222
+
223
+ #endif // RAPIDJSON_STREAM_H_
@@ -0,0 +1,121 @@
1
+ // Tencent is pleased to support the open source community by making RapidJSON available.
2
+ //
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
+ //
5
+ // Licensed under the MIT License (the "License"); you may not use this file except
6
+ // in compliance with the License. You may obtain a copy of the License at
7
+ //
8
+ // http://opensource.org/licenses/MIT
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software distributed
11
+ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
+ // specific language governing permissions and limitations under the License.
14
+
15
+ #ifndef RAPIDJSON_STRINGBUFFER_H_
16
+ #define RAPIDJSON_STRINGBUFFER_H_
17
+
18
+ #include "stream.h"
19
+ #include "internal/stack.h"
20
+
21
+ #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
22
+ #include <utility> // std::move
23
+ #endif
24
+
25
+ #include "internal/stack.h"
26
+
27
+ #if defined(__clang__)
28
+ RAPIDJSON_DIAG_PUSH
29
+ RAPIDJSON_DIAG_OFF(c++98-compat)
30
+ #endif
31
+
32
+ RAPIDJSON_NAMESPACE_BEGIN
33
+
34
+ //! Represents an in-memory output stream.
35
+ /*!
36
+ \tparam Encoding Encoding of the stream.
37
+ \tparam Allocator type for allocating memory buffer.
38
+ \note implements Stream concept
39
+ */
40
+ template <typename Encoding, typename Allocator = CrtAllocator>
41
+ class GenericStringBuffer {
42
+ public:
43
+ typedef typename Encoding::Ch Ch;
44
+
45
+ GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
46
+
47
+ #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
48
+ GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {}
49
+ GenericStringBuffer& operator=(GenericStringBuffer&& rhs) {
50
+ if (&rhs != this)
51
+ stack_ = std::move(rhs.stack_);
52
+ return *this;
53
+ }
54
+ #endif
55
+
56
+ void Put(Ch c) { *stack_.template Push<Ch>() = c; }
57
+ void PutUnsafe(Ch c) { *stack_.template PushUnsafe<Ch>() = c; }
58
+ void Flush() {}
59
+
60
+ void Clear() { stack_.Clear(); }
61
+ void ShrinkToFit() {
62
+ // Push and pop a null terminator. This is safe.
63
+ *stack_.template Push<Ch>() = '\0';
64
+ stack_.ShrinkToFit();
65
+ stack_.template Pop<Ch>(1);
66
+ }
67
+
68
+ void Reserve(size_t count) { stack_.template Reserve<Ch>(count); }
69
+ Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
70
+ Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe<Ch>(count); }
71
+ void Pop(size_t count) { stack_.template Pop<Ch>(count); }
72
+
73
+ const Ch* GetString() const {
74
+ // Push and pop a null terminator. This is safe.
75
+ *stack_.template Push<Ch>() = '\0';
76
+ stack_.template Pop<Ch>(1);
77
+
78
+ return stack_.template Bottom<Ch>();
79
+ }
80
+
81
+ //! Get the size of string in bytes in the string buffer.
82
+ size_t GetSize() const { return stack_.GetSize(); }
83
+
84
+ //! Get the length of string in Ch in the string buffer.
85
+ size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); }
86
+
87
+ static const size_t kDefaultCapacity = 256;
88
+ mutable internal::Stack<Allocator> stack_;
89
+
90
+ private:
91
+ // Prohibit copy constructor & assignment operator.
92
+ GenericStringBuffer(const GenericStringBuffer&);
93
+ GenericStringBuffer& operator=(const GenericStringBuffer&);
94
+ };
95
+
96
+ //! String buffer with UTF8 encoding
97
+ typedef GenericStringBuffer<UTF8<> > StringBuffer;
98
+
99
+ template<typename Encoding, typename Allocator>
100
+ inline void PutReserve(GenericStringBuffer<Encoding, Allocator>& stream, size_t count) {
101
+ stream.Reserve(count);
102
+ }
103
+
104
+ template<typename Encoding, typename Allocator>
105
+ inline void PutUnsafe(GenericStringBuffer<Encoding, Allocator>& stream, typename Encoding::Ch c) {
106
+ stream.PutUnsafe(c);
107
+ }
108
+
109
+ //! Implement specialized version of PutN() with memset() for better performance.
110
+ template<>
111
+ inline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {
112
+ std::memset(stream.stack_.Push<char>(n), c, n * sizeof(c));
113
+ }
114
+
115
+ RAPIDJSON_NAMESPACE_END
116
+
117
+ #if defined(__clang__)
118
+ RAPIDJSON_DIAG_POP
119
+ #endif
120
+
121
+ #endif // RAPIDJSON_STRINGBUFFER_H_
@@ -0,0 +1,710 @@
1
+ // Tencent is pleased to support the open source community by making RapidJSON available.
2
+ //
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
+ //
5
+ // Licensed under the MIT License (the "License"); you may not use this file except
6
+ // in compliance with the License. You may obtain a copy of the License at
7
+ //
8
+ // http://opensource.org/licenses/MIT
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software distributed
11
+ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
+ // specific language governing permissions and limitations under the License.
14
+
15
+ #ifndef RAPIDJSON_WRITER_H_
16
+ #define RAPIDJSON_WRITER_H_
17
+
18
+ #include "stream.h"
19
+ #include "internal/clzll.h"
20
+ #include "internal/meta.h"
21
+ #include "internal/stack.h"
22
+ #include "internal/strfunc.h"
23
+ #include "internal/dtoa.h"
24
+ #include "internal/itoa.h"
25
+ #include "stringbuffer.h"
26
+ #include <new> // placement new
27
+
28
+ #if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
29
+ #include <intrin.h>
30
+ #pragma intrinsic(_BitScanForward)
31
+ #endif
32
+ #ifdef RAPIDJSON_SSE42
33
+ #include <nmmintrin.h>
34
+ #elif defined(RAPIDJSON_SSE2)
35
+ #include <emmintrin.h>
36
+ #elif defined(RAPIDJSON_NEON)
37
+ #include <arm_neon.h>
38
+ #endif
39
+
40
+ #ifdef __clang__
41
+ RAPIDJSON_DIAG_PUSH
42
+ RAPIDJSON_DIAG_OFF(padded)
43
+ RAPIDJSON_DIAG_OFF(unreachable-code)
44
+ RAPIDJSON_DIAG_OFF(c++98-compat)
45
+ #elif defined(_MSC_VER)
46
+ RAPIDJSON_DIAG_PUSH
47
+ RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
48
+ #endif
49
+
50
+ RAPIDJSON_NAMESPACE_BEGIN
51
+
52
+ ///////////////////////////////////////////////////////////////////////////////
53
+ // WriteFlag
54
+
55
+ /*! \def RAPIDJSON_WRITE_DEFAULT_FLAGS
56
+ \ingroup RAPIDJSON_CONFIG
57
+ \brief User-defined kWriteDefaultFlags definition.
58
+
59
+ User can define this as any \c WriteFlag combinations.
60
+ */
61
+ #ifndef RAPIDJSON_WRITE_DEFAULT_FLAGS
62
+ #define RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags
63
+ #endif
64
+
65
+ //! Combination of writeFlags
66
+ enum WriteFlag {
67
+ kWriteNoFlags = 0, //!< No flags are set.
68
+ kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings.
69
+ kWriteNanAndInfFlag = 2, //!< Allow writing of Infinity, -Infinity and NaN.
70
+ kWriteDefaultFlags = RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining RAPIDJSON_WRITE_DEFAULT_FLAGS
71
+ };
72
+
73
+ //! JSON writer
74
+ /*! Writer implements the concept Handler.
75
+ It generates JSON text by events to an output os.
76
+
77
+ User may programmatically calls the functions of a writer to generate JSON text.
78
+
79
+ On the other side, a writer can also be passed to objects that generates events,
80
+
81
+ for example Reader::Parse() and Document::Accept().
82
+
83
+ \tparam OutputStream Type of output stream.
84
+ \tparam SourceEncoding Encoding of source string.
85
+ \tparam TargetEncoding Encoding of output stream.
86
+ \tparam StackAllocator Type of allocator for allocating memory of stack.
87
+ \note implements Handler concept
88
+ */
89
+ template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>
90
+ class Writer {
91
+ public:
92
+ typedef typename SourceEncoding::Ch Ch;
93
+
94
+ static const int kDefaultMaxDecimalPlaces = 324;
95
+
96
+ //! Constructor
97
+ /*! \param os Output stream.
98
+ \param stackAllocator User supplied allocator. If it is null, it will create a private one.
99
+ \param levelDepth Initial capacity of stack.
100
+ */
101
+ explicit
102
+ Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) :
103
+ os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
104
+
105
+ explicit
106
+ Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) :
107
+ os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
108
+
109
+ #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
110
+ Writer(Writer&& rhs) :
111
+ os_(rhs.os_), level_stack_(std::move(rhs.level_stack_)), maxDecimalPlaces_(rhs.maxDecimalPlaces_), hasRoot_(rhs.hasRoot_) {
112
+ rhs.os_ = 0;
113
+ }
114
+ #endif
115
+
116
+ //! Reset the writer with a new stream.
117
+ /*!
118
+ This function reset the writer with a new stream and default settings,
119
+ in order to make a Writer object reusable for output multiple JSONs.
120
+
121
+ \param os New output stream.
122
+ \code
123
+ Writer<OutputStream> writer(os1);
124
+ writer.StartObject();
125
+ // ...
126
+ writer.EndObject();
127
+
128
+ writer.Reset(os2);
129
+ writer.StartObject();
130
+ // ...
131
+ writer.EndObject();
132
+ \endcode
133
+ */
134
+ void Reset(OutputStream& os) {
135
+ os_ = &os;
136
+ hasRoot_ = false;
137
+ level_stack_.Clear();
138
+ }
139
+
140
+ //! Checks whether the output is a complete JSON.
141
+ /*!
142
+ A complete JSON has a complete root object or array.
143
+ */
144
+ bool IsComplete() const {
145
+ return hasRoot_ && level_stack_.Empty();
146
+ }
147
+
148
+ int GetMaxDecimalPlaces() const {
149
+ return maxDecimalPlaces_;
150
+ }
151
+
152
+ //! Sets the maximum number of decimal places for double output.
153
+ /*!
154
+ This setting truncates the output with specified number of decimal places.
155
+
156
+ For example,
157
+
158
+ \code
159
+ writer.SetMaxDecimalPlaces(3);
160
+ writer.StartArray();
161
+ writer.Double(0.12345); // "0.123"
162
+ writer.Double(0.0001); // "0.0"
163
+ writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent)
164
+ writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent)
165
+ writer.EndArray();
166
+ \endcode
167
+
168
+ The default setting does not truncate any decimal places. You can restore to this setting by calling
169
+ \code
170
+ writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces);
171
+ \endcode
172
+ */
173
+ void SetMaxDecimalPlaces(int maxDecimalPlaces) {
174
+ maxDecimalPlaces_ = maxDecimalPlaces;
175
+ }
176
+
177
+ /*!@name Implementation of Handler
178
+ \see Handler
179
+ */
180
+ //@{
181
+
182
+ bool Null() { Prefix(kNullType); return EndValue(WriteNull()); }
183
+ bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return EndValue(WriteBool(b)); }
184
+ bool Int(int i) { Prefix(kNumberType); return EndValue(WriteInt(i)); }
185
+ bool Uint(unsigned u) { Prefix(kNumberType); return EndValue(WriteUint(u)); }
186
+ bool Int64(int64_t i64) { Prefix(kNumberType); return EndValue(WriteInt64(i64)); }
187
+ bool Uint64(uint64_t u64) { Prefix(kNumberType); return EndValue(WriteUint64(u64)); }
188
+
189
+ //! Writes the given \c double value to the stream
190
+ /*!
191
+ \param d The value to be written.
192
+ \return Whether it is succeed.
193
+ */
194
+ bool Double(double d) { Prefix(kNumberType); return EndValue(WriteDouble(d)); }
195
+
196
+ bool RawNumber(const Ch* str, SizeType length, bool copy = false) {
197
+ RAPIDJSON_ASSERT(str != 0);
198
+ (void)copy;
199
+ Prefix(kNumberType);
200
+ return EndValue(WriteString(str, length));
201
+ }
202
+
203
+ bool String(const Ch* str, SizeType length, bool copy = false) {
204
+ RAPIDJSON_ASSERT(str != 0);
205
+ (void)copy;
206
+ Prefix(kStringType);
207
+ return EndValue(WriteString(str, length));
208
+ }
209
+
210
+ #if RAPIDJSON_HAS_STDSTRING
211
+ bool String(const std::basic_string<Ch>& str) {
212
+ return String(str.data(), SizeType(str.size()));
213
+ }
214
+ #endif
215
+
216
+ bool StartObject() {
217
+ Prefix(kObjectType);
218
+ new (level_stack_.template Push<Level>()) Level(false);
219
+ return WriteStartObject();
220
+ }
221
+
222
+ bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }
223
+
224
+ #if RAPIDJSON_HAS_STDSTRING
225
+ bool Key(const std::basic_string<Ch>& str)
226
+ {
227
+ return Key(str.data(), SizeType(str.size()));
228
+ }
229
+ #endif
230
+
231
+ bool EndObject(SizeType memberCount = 0) {
232
+ (void)memberCount;
233
+ RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); // not inside an Object
234
+ RAPIDJSON_ASSERT(!level_stack_.template Top<Level>()->inArray); // currently inside an Array, not Object
235
+ RAPIDJSON_ASSERT(0 == level_stack_.template Top<Level>()->valueCount % 2); // Object has a Key without a Value
236
+ level_stack_.template Pop<Level>(1);
237
+ return EndValue(WriteEndObject());
238
+ }
239
+
240
+ bool StartArray() {
241
+ Prefix(kArrayType);
242
+ new (level_stack_.template Push<Level>()) Level(true);
243
+ return WriteStartArray();
244
+ }
245
+
246
+ bool EndArray(SizeType elementCount = 0) {
247
+ (void)elementCount;
248
+ RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));
249
+ RAPIDJSON_ASSERT(level_stack_.template Top<Level>()->inArray);
250
+ level_stack_.template Pop<Level>(1);
251
+ return EndValue(WriteEndArray());
252
+ }
253
+ //@}
254
+
255
+ /*! @name Convenience extensions */
256
+ //@{
257
+
258
+ //! Simpler but slower overload.
259
+ bool String(const Ch* const& str) { return String(str, internal::StrLen(str)); }
260
+ bool Key(const Ch* const& str) { return Key(str, internal::StrLen(str)); }
261
+
262
+ //@}
263
+
264
+ //! Write a raw JSON value.
265
+ /*!
266
+ For user to write a stringified JSON as a value.
267
+
268
+ \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range.
269
+ \param length Length of the json.
270
+ \param type Type of the root of json.
271
+ */
272
+ bool RawValue(const Ch* json, size_t length, Type type) {
273
+ RAPIDJSON_ASSERT(json != 0);
274
+ Prefix(type);
275
+ return EndValue(WriteRawValue(json, length));
276
+ }
277
+
278
+ //! Flush the output stream.
279
+ /*!
280
+ Allows the user to flush the output stream immediately.
281
+ */
282
+ void Flush() {
283
+ os_->Flush();
284
+ }
285
+
286
+ protected:
287
+ //! Information for each nested level
288
+ struct Level {
289
+ Level(bool inArray_) : valueCount(0), inArray(inArray_) {}
290
+ size_t valueCount; //!< number of values in this level
291
+ bool inArray; //!< true if in array, otherwise in object
292
+ };
293
+
294
+ static const size_t kDefaultLevelDepth = 32;
295
+
296
+ bool WriteNull() {
297
+ PutReserve(*os_, 4);
298
+ PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true;
299
+ }
300
+
301
+ bool WriteBool(bool b) {
302
+ if (b) {
303
+ PutReserve(*os_, 4);
304
+ PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e');
305
+ }
306
+ else {
307
+ PutReserve(*os_, 5);
308
+ PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e');
309
+ }
310
+ return true;
311
+ }
312
+
313
+ bool WriteInt(int i) {
314
+ char buffer[11];
315
+ const char* end = internal::i32toa(i, buffer);
316
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
317
+ for (const char* p = buffer; p != end; ++p)
318
+ PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
319
+ return true;
320
+ }
321
+
322
+ bool WriteUint(unsigned u) {
323
+ char buffer[10];
324
+ const char* end = internal::u32toa(u, buffer);
325
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
326
+ for (const char* p = buffer; p != end; ++p)
327
+ PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
328
+ return true;
329
+ }
330
+
331
+ bool WriteInt64(int64_t i64) {
332
+ char buffer[21];
333
+ const char* end = internal::i64toa(i64, buffer);
334
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
335
+ for (const char* p = buffer; p != end; ++p)
336
+ PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
337
+ return true;
338
+ }
339
+
340
+ bool WriteUint64(uint64_t u64) {
341
+ char buffer[20];
342
+ char* end = internal::u64toa(u64, buffer);
343
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
344
+ for (char* p = buffer; p != end; ++p)
345
+ PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
346
+ return true;
347
+ }
348
+
349
+ bool WriteDouble(double d) {
350
+ if (internal::Double(d).IsNanOrInf()) {
351
+ if (!(writeFlags & kWriteNanAndInfFlag))
352
+ return false;
353
+ if (internal::Double(d).IsNan()) {
354
+ PutReserve(*os_, 3);
355
+ PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N');
356
+ return true;
357
+ }
358
+ if (internal::Double(d).Sign()) {
359
+ PutReserve(*os_, 9);
360
+ PutUnsafe(*os_, '-');
361
+ }
362
+ else
363
+ PutReserve(*os_, 8);
364
+ PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f');
365
+ PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y');
366
+ return true;
367
+ }
368
+
369
+ char buffer[25];
370
+ char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
371
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
372
+ for (char* p = buffer; p != end; ++p)
373
+ PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
374
+ return true;
375
+ }
376
+
377
+ bool WriteString(const Ch* str, SizeType length) {
378
+ static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
379
+ static const char escape[256] = {
380
+ #define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
381
+ //0 1 2 3 4 5 6 7 8 9 A B C D E F
382
+ 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00
383
+ 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10
384
+ 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20
385
+ Z16, Z16, // 30~4F
386
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50
387
+ Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF
388
+ #undef Z16
389
+ };
390
+
391
+ if (TargetEncoding::supportUnicode)
392
+ PutReserve(*os_, 2 + length * 6); // "\uxxxx..."
393
+ else
394
+ PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..."
395
+
396
+ PutUnsafe(*os_, '\"');
397
+ GenericStringStream<SourceEncoding> is(str);
398
+ while (ScanWriteUnescapedString(is, length)) {
399
+ const Ch c = is.Peek();
400
+ if (!TargetEncoding::supportUnicode && static_cast<unsigned>(c) >= 0x80) {
401
+ // Unicode escaping
402
+ unsigned codepoint;
403
+ if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint)))
404
+ return false;
405
+ PutUnsafe(*os_, '\\');
406
+ PutUnsafe(*os_, 'u');
407
+ if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) {
408
+ PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]);
409
+ PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]);
410
+ PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]);
411
+ PutUnsafe(*os_, hexDigits[(codepoint ) & 15]);
412
+ }
413
+ else {
414
+ RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF);
415
+ // Surrogate pair
416
+ unsigned s = codepoint - 0x010000;
417
+ unsigned lead = (s >> 10) + 0xD800;
418
+ unsigned trail = (s & 0x3FF) + 0xDC00;
419
+ PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]);
420
+ PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]);
421
+ PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]);
422
+ PutUnsafe(*os_, hexDigits[(lead ) & 15]);
423
+ PutUnsafe(*os_, '\\');
424
+ PutUnsafe(*os_, 'u');
425
+ PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]);
426
+ PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]);
427
+ PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]);
428
+ PutUnsafe(*os_, hexDigits[(trail ) & 15]);
429
+ }
430
+ }
431
+ else if ((sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast<unsigned char>(c)])) {
432
+ is.Take();
433
+ PutUnsafe(*os_, '\\');
434
+ PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(escape[static_cast<unsigned char>(c)]));
435
+ if (escape[static_cast<unsigned char>(c)] == 'u') {
436
+ PutUnsafe(*os_, '0');
437
+ PutUnsafe(*os_, '0');
438
+ PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) >> 4]);
439
+ PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) & 0xF]);
440
+ }
441
+ }
442
+ else if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ?
443
+ Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) :
444
+ Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_))))
445
+ return false;
446
+ }
447
+ PutUnsafe(*os_, '\"');
448
+ return true;
449
+ }
450
+
451
+ bool ScanWriteUnescapedString(GenericStringStream<SourceEncoding>& is, size_t length) {
452
+ return RAPIDJSON_LIKELY(is.Tell() < length);
453
+ }
454
+
455
+ bool WriteStartObject() { os_->Put('{'); return true; }
456
+ bool WriteEndObject() { os_->Put('}'); return true; }
457
+ bool WriteStartArray() { os_->Put('['); return true; }
458
+ bool WriteEndArray() { os_->Put(']'); return true; }
459
+
460
+ bool WriteRawValue(const Ch* json, size_t length) {
461
+ PutReserve(*os_, length);
462
+ GenericStringStream<SourceEncoding> is(json);
463
+ while (RAPIDJSON_LIKELY(is.Tell() < length)) {
464
+ RAPIDJSON_ASSERT(is.Peek() != '\0');
465
+ if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ?
466
+ Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) :
467
+ Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_))))
468
+ return false;
469
+ }
470
+ return true;
471
+ }
472
+
473
+ void Prefix(Type type) {
474
+ (void)type;
475
+ if (RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root
476
+ Level* level = level_stack_.template Top<Level>();
477
+ if (level->valueCount > 0) {
478
+ if (level->inArray)
479
+ os_->Put(','); // add comma if it is not the first element in array
480
+ else // in object
481
+ os_->Put((level->valueCount % 2 == 0) ? ',' : ':');
482
+ }
483
+ if (!level->inArray && level->valueCount % 2 == 0)
484
+ RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name
485
+ level->valueCount++;
486
+ }
487
+ else {
488
+ RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root.
489
+ hasRoot_ = true;
490
+ }
491
+ }
492
+
493
+ // Flush the value if it is the top level one.
494
+ bool EndValue(bool ret) {
495
+ if (RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text
496
+ Flush();
497
+ return ret;
498
+ }
499
+
500
+ OutputStream* os_;
501
+ internal::Stack<StackAllocator> level_stack_;
502
+ int maxDecimalPlaces_;
503
+ bool hasRoot_;
504
+
505
+ private:
506
+ // Prohibit copy constructor & assignment operator.
507
+ Writer(const Writer&);
508
+ Writer& operator=(const Writer&);
509
+ };
510
+
511
+ // Full specialization for StringStream to prevent memory copying
512
+
513
+ template<>
514
+ inline bool Writer<StringBuffer>::WriteInt(int i) {
515
+ char *buffer = os_->Push(11);
516
+ const char* end = internal::i32toa(i, buffer);
517
+ os_->Pop(static_cast<size_t>(11 - (end - buffer)));
518
+ return true;
519
+ }
520
+
521
+ template<>
522
+ inline bool Writer<StringBuffer>::WriteUint(unsigned u) {
523
+ char *buffer = os_->Push(10);
524
+ const char* end = internal::u32toa(u, buffer);
525
+ os_->Pop(static_cast<size_t>(10 - (end - buffer)));
526
+ return true;
527
+ }
528
+
529
+ template<>
530
+ inline bool Writer<StringBuffer>::WriteInt64(int64_t i64) {
531
+ char *buffer = os_->Push(21);
532
+ const char* end = internal::i64toa(i64, buffer);
533
+ os_->Pop(static_cast<size_t>(21 - (end - buffer)));
534
+ return true;
535
+ }
536
+
537
+ template<>
538
+ inline bool Writer<StringBuffer>::WriteUint64(uint64_t u) {
539
+ char *buffer = os_->Push(20);
540
+ const char* end = internal::u64toa(u, buffer);
541
+ os_->Pop(static_cast<size_t>(20 - (end - buffer)));
542
+ return true;
543
+ }
544
+
545
+ template<>
546
+ inline bool Writer<StringBuffer>::WriteDouble(double d) {
547
+ if (internal::Double(d).IsNanOrInf()) {
548
+ // Note: This code path can only be reached if (RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag).
549
+ if (!(kWriteDefaultFlags & kWriteNanAndInfFlag))
550
+ return false;
551
+ if (internal::Double(d).IsNan()) {
552
+ PutReserve(*os_, 3);
553
+ PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N');
554
+ return true;
555
+ }
556
+ if (internal::Double(d).Sign()) {
557
+ PutReserve(*os_, 9);
558
+ PutUnsafe(*os_, '-');
559
+ }
560
+ else
561
+ PutReserve(*os_, 8);
562
+ PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f');
563
+ PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y');
564
+ return true;
565
+ }
566
+
567
+ char *buffer = os_->Push(25);
568
+ char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
569
+ os_->Pop(static_cast<size_t>(25 - (end - buffer)));
570
+ return true;
571
+ }
572
+
573
+ #if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
574
+ template<>
575
+ inline bool Writer<StringBuffer>::ScanWriteUnescapedString(StringStream& is, size_t length) {
576
+ if (length < 16)
577
+ return RAPIDJSON_LIKELY(is.Tell() < length);
578
+
579
+ if (!RAPIDJSON_LIKELY(is.Tell() < length))
580
+ return false;
581
+
582
+ const char* p = is.src_;
583
+ const char* end = is.head_ + length;
584
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
585
+ const char* endAligned = reinterpret_cast<const char*>(reinterpret_cast<size_t>(end) & static_cast<size_t>(~15));
586
+ if (nextAligned > end)
587
+ return true;
588
+
589
+ while (p != nextAligned)
590
+ if (*p < 0x20 || *p == '\"' || *p == '\\') {
591
+ is.src_ = p;
592
+ return RAPIDJSON_LIKELY(is.Tell() < length);
593
+ }
594
+ else
595
+ os_->PutUnsafe(*p++);
596
+
597
+ // The rest of string using SIMD
598
+ static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
599
+ static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
600
+ static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F };
601
+ const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
602
+ const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
603
+ const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
604
+
605
+ for (; p != endAligned; p += 16) {
606
+ const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
607
+ const __m128i t1 = _mm_cmpeq_epi8(s, dq);
608
+ const __m128i t2 = _mm_cmpeq_epi8(s, bs);
609
+ const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F
610
+ const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
611
+ unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
612
+ if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
613
+ SizeType len;
614
+ #ifdef _MSC_VER // Find the index of first escaped
615
+ unsigned long offset;
616
+ _BitScanForward(&offset, r);
617
+ len = offset;
618
+ #else
619
+ len = static_cast<SizeType>(__builtin_ffs(r) - 1);
620
+ #endif
621
+ char* q = reinterpret_cast<char*>(os_->PushUnsafe(len));
622
+ for (size_t i = 0; i < len; i++)
623
+ q[i] = p[i];
624
+
625
+ p += len;
626
+ break;
627
+ }
628
+ _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s);
629
+ }
630
+
631
+ is.src_ = p;
632
+ return RAPIDJSON_LIKELY(is.Tell() < length);
633
+ }
634
+ #elif defined(RAPIDJSON_NEON)
635
+ template<>
636
+ inline bool Writer<StringBuffer>::ScanWriteUnescapedString(StringStream& is, size_t length) {
637
+ if (length < 16)
638
+ return RAPIDJSON_LIKELY(is.Tell() < length);
639
+
640
+ if (!RAPIDJSON_LIKELY(is.Tell() < length))
641
+ return false;
642
+
643
+ const char* p = is.src_;
644
+ const char* end = is.head_ + length;
645
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
646
+ const char* endAligned = reinterpret_cast<const char*>(reinterpret_cast<size_t>(end) & static_cast<size_t>(~15));
647
+ if (nextAligned > end)
648
+ return true;
649
+
650
+ while (p != nextAligned)
651
+ if (*p < 0x20 || *p == '\"' || *p == '\\') {
652
+ is.src_ = p;
653
+ return RAPIDJSON_LIKELY(is.Tell() < length);
654
+ }
655
+ else
656
+ os_->PutUnsafe(*p++);
657
+
658
+ // The rest of string using SIMD
659
+ const uint8x16_t s0 = vmovq_n_u8('"');
660
+ const uint8x16_t s1 = vmovq_n_u8('\\');
661
+ const uint8x16_t s2 = vmovq_n_u8('\b');
662
+ const uint8x16_t s3 = vmovq_n_u8(32);
663
+
664
+ for (; p != endAligned; p += 16) {
665
+ const uint8x16_t s = vld1q_u8(reinterpret_cast<const uint8_t *>(p));
666
+ uint8x16_t x = vceqq_u8(s, s0);
667
+ x = vorrq_u8(x, vceqq_u8(s, s1));
668
+ x = vorrq_u8(x, vceqq_u8(s, s2));
669
+ x = vorrq_u8(x, vcltq_u8(s, s3));
670
+
671
+ x = vrev64q_u8(x); // Rev in 64
672
+ uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
673
+ uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
674
+
675
+ SizeType len = 0;
676
+ bool escaped = false;
677
+ if (low == 0) {
678
+ if (high != 0) {
679
+ uint32_t lz = internal::clzll(high);
680
+ len = 8 + (lz >> 3);
681
+ escaped = true;
682
+ }
683
+ } else {
684
+ uint32_t lz = internal::clzll(low);
685
+ len = lz >> 3;
686
+ escaped = true;
687
+ }
688
+ if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped
689
+ char* q = reinterpret_cast<char*>(os_->PushUnsafe(len));
690
+ for (size_t i = 0; i < len; i++)
691
+ q[i] = p[i];
692
+
693
+ p += len;
694
+ break;
695
+ }
696
+ vst1q_u8(reinterpret_cast<uint8_t *>(os_->PushUnsafe(16)), s);
697
+ }
698
+
699
+ is.src_ = p;
700
+ return RAPIDJSON_LIKELY(is.Tell() < length);
701
+ }
702
+ #endif // RAPIDJSON_NEON
703
+
704
+ RAPIDJSON_NAMESPACE_END
705
+
706
+ #if defined(_MSC_VER) || defined(__clang__)
707
+ RAPIDJSON_DIAG_POP
708
+ #endif
709
+
710
+ #endif // RAPIDJSON_RAPIDJSON_H_