rroonga 9.0.3-x86-mingw32 → 9.0.7-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (769) hide show
  1. checksums.yaml +4 -4
  2. data/doc/text/news.md +30 -0
  3. data/ext/groonga/rb-grn-context.c +27 -0
  4. data/ext/groonga/rb-grn-flushable.c +7 -0
  5. data/ext/groonga/rb-grn-index-column.c +28 -0
  6. data/ext/groonga/rb-grn-index-cursor.c +19 -0
  7. data/ext/groonga/rb-grn-logger.c +17 -3
  8. data/ext/groonga/rb-grn-object.c +236 -22
  9. data/ext/groonga/rb-grn-table.c +68 -42
  10. data/ext/groonga/rb-grn.h +1 -1
  11. data/lib/2.3/groonga.so +0 -0
  12. data/lib/2.4/groonga.so +0 -0
  13. data/lib/2.5/groonga.so +0 -0
  14. data/lib/2.6/groonga.so +0 -0
  15. data/lib/groonga/dumper.rb +3 -0
  16. data/lib/groonga/record.rb +2 -2
  17. data/test/groonga-test-utils.rb +28 -5
  18. data/test/run-test.rb +0 -2
  19. data/test/test-accessor.rb +63 -7
  20. data/test/test-context.rb +25 -0
  21. data/test/test-exception.rb +5 -0
  22. data/test/test-flushable.rb +51 -6
  23. data/test/test-index-column.rb +67 -6
  24. data/test/test-index-cursor.rb +26 -0
  25. data/test/test-logger.rb +56 -11
  26. data/test/test-plugin.rb +1 -0
  27. data/test/test-query-logger.rb +4 -3
  28. data/test/test-record.rb +2 -1
  29. data/test/test-remote.rb +40 -10
  30. data/test/test-schema-dumper.rb +13 -0
  31. data/test/test-table.rb +21 -1
  32. data/test/test-variable.rb +23 -7
  33. data/vendor/local/bin/generate-pdb.bat +21 -21
  34. data/vendor/local/bin/grndb.exe +0 -0
  35. data/vendor/local/bin/groonga-benchmark.exe +0 -0
  36. data/vendor/local/bin/groonga-suggest-create-dataset.exe +0 -0
  37. data/vendor/local/bin/groonga.exe +0 -0
  38. data/vendor/local/bin/libgroonga-0.dll +0 -0
  39. data/vendor/local/bin/libmecab-2.dll +0 -0
  40. data/vendor/local/bin/libmsgpackc.dll +0 -0
  41. data/vendor/local/bin/libonigmo-6.dll +0 -0
  42. data/vendor/local/bin/libpcre-1.dll +0 -0
  43. data/vendor/local/bin/libpcrecpp-0.dll +0 -0
  44. data/vendor/local/bin/libpcreposix-0.dll +0 -0
  45. data/vendor/local/bin/lz4.exe +0 -0
  46. data/vendor/local/bin/lz4c.exe +0 -0
  47. data/vendor/local/bin/lz4cat.exe +0 -0
  48. data/vendor/local/bin/mecab.exe +0 -0
  49. data/vendor/local/bin/pcregrep.exe +0 -0
  50. data/vendor/local/bin/pcretest.exe +0 -0
  51. data/vendor/local/bin/unlz4.exe +0 -0
  52. data/vendor/local/bin/zlib1.dll +0 -0
  53. data/vendor/local/cmake/RapidJSONConfig.cmake +3 -0
  54. data/vendor/local/cmake/RapidJSONConfigVersion.cmake +10 -0
  55. data/vendor/local/include/groonga/groonga/expr.h +16 -0
  56. data/vendor/local/include/groonga/groonga/obj.h +8 -0
  57. data/vendor/local/include/groonga/groonga/output.h +5 -0
  58. data/vendor/local/include/groonga/groonga/version.h +2 -2
  59. data/vendor/local/include/rapidjson/allocators.h +271 -0
  60. data/vendor/local/include/rapidjson/document.h +2575 -0
  61. data/vendor/local/include/rapidjson/encodedstream.h +299 -0
  62. data/vendor/local/include/rapidjson/encodings.h +716 -0
  63. data/vendor/local/include/rapidjson/error/en.h +74 -0
  64. data/vendor/local/include/rapidjson/error/error.h +155 -0
  65. data/vendor/local/include/rapidjson/filereadstream.h +99 -0
  66. data/vendor/local/include/rapidjson/filewritestream.h +104 -0
  67. data/vendor/local/include/rapidjson/fwd.h +151 -0
  68. data/vendor/local/include/rapidjson/internal/biginteger.h +290 -0
  69. data/vendor/local/include/rapidjson/internal/diyfp.h +258 -0
  70. data/vendor/local/include/rapidjson/internal/dtoa.h +245 -0
  71. data/vendor/local/include/rapidjson/internal/ieee754.h +78 -0
  72. data/vendor/local/include/rapidjson/internal/itoa.h +304 -0
  73. data/vendor/local/include/rapidjson/internal/meta.h +181 -0
  74. data/vendor/local/include/rapidjson/internal/pow10.h +55 -0
  75. data/vendor/local/include/rapidjson/internal/regex.h +701 -0
  76. data/vendor/local/include/rapidjson/internal/stack.h +230 -0
  77. data/vendor/local/include/rapidjson/internal/strfunc.h +55 -0
  78. data/vendor/local/include/rapidjson/internal/strtod.h +269 -0
  79. data/vendor/local/include/rapidjson/internal/swap.h +46 -0
  80. data/vendor/local/include/rapidjson/istreamwrapper.h +115 -0
  81. data/vendor/local/include/rapidjson/memorybuffer.h +70 -0
  82. data/vendor/local/include/rapidjson/memorystream.h +71 -0
  83. data/vendor/local/include/rapidjson/msinttypes/inttypes.h +316 -0
  84. data/vendor/local/include/rapidjson/msinttypes/stdint.h +300 -0
  85. data/vendor/local/include/rapidjson/ostreamwrapper.h +81 -0
  86. data/vendor/local/include/rapidjson/pointer.h +1358 -0
  87. data/vendor/local/include/rapidjson/prettywriter.h +255 -0
  88. data/vendor/local/include/rapidjson/rapidjson.h +615 -0
  89. data/vendor/local/include/rapidjson/reader.h +1879 -0
  90. data/vendor/local/include/rapidjson/schema.h +2006 -0
  91. data/vendor/local/include/rapidjson/stream.h +179 -0
  92. data/vendor/local/include/rapidjson/stringbuffer.h +117 -0
  93. data/vendor/local/include/rapidjson/writer.h +610 -0
  94. data/vendor/local/lib/groonga/plugins/functions/index_column.a +0 -0
  95. data/vendor/local/lib/groonga/plugins/functions/index_column.dll +0 -0
  96. data/vendor/local/lib/groonga/plugins/functions/index_column.dll.a +0 -0
  97. data/vendor/local/lib/groonga/plugins/functions/index_column.la +1 -1
  98. data/vendor/local/lib/groonga/plugins/functions/math.a +0 -0
  99. data/vendor/local/lib/groonga/plugins/functions/math.dll +0 -0
  100. data/vendor/local/lib/groonga/plugins/functions/math.dll.a +0 -0
  101. data/vendor/local/lib/groonga/plugins/functions/math.la +1 -1
  102. data/vendor/local/lib/groonga/plugins/functions/number.a +0 -0
  103. data/vendor/local/lib/groonga/plugins/functions/number.dll +0 -0
  104. data/vendor/local/lib/groonga/plugins/functions/number.dll.a +0 -0
  105. data/vendor/local/lib/groonga/plugins/functions/number.la +1 -1
  106. data/vendor/local/lib/groonga/plugins/functions/string.a +0 -0
  107. data/vendor/local/lib/groonga/plugins/functions/string.dll +0 -0
  108. data/vendor/local/lib/groonga/plugins/functions/string.dll.a +0 -0
  109. data/vendor/local/lib/groonga/plugins/functions/string.la +1 -1
  110. data/vendor/local/lib/groonga/plugins/functions/time.a +0 -0
  111. data/vendor/local/lib/groonga/plugins/functions/time.dll +0 -0
  112. data/vendor/local/lib/groonga/plugins/functions/time.dll.a +0 -0
  113. data/vendor/local/lib/groonga/plugins/functions/time.la +1 -1
  114. data/vendor/local/lib/groonga/plugins/functions/vector.a +0 -0
  115. data/vendor/local/lib/groonga/plugins/functions/vector.dll +0 -0
  116. data/vendor/local/lib/groonga/plugins/functions/vector.dll.a +0 -0
  117. data/vendor/local/lib/groonga/plugins/functions/vector.la +1 -1
  118. data/vendor/local/lib/groonga/plugins/normalizers/mysql.a +0 -0
  119. data/vendor/local/lib/groonga/plugins/normalizers/mysql.dll +0 -0
  120. data/vendor/local/lib/groonga/plugins/normalizers/mysql.dll.a +0 -0
  121. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
  122. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
  123. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
  124. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.la +1 -1
  125. data/vendor/local/lib/groonga/plugins/sharding/dynamic_columns.rb +44 -18
  126. data/vendor/local/lib/groonga/plugins/sharding/logical_count.rb +9 -8
  127. data/vendor/local/lib/groonga/plugins/sharding/logical_range_filter.rb +48 -15
  128. data/vendor/local/lib/groonga/plugins/sharding/logical_select.rb +84 -58
  129. data/vendor/local/lib/groonga/plugins/sharding/range_expression_builder.rb +1 -1
  130. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  131. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  132. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  133. data/vendor/local/lib/groonga/plugins/suggest/suggest.la +1 -1
  134. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.a +0 -0
  135. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.dll +0 -0
  136. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.dll.a +0 -0
  137. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.la +1 -1
  138. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
  139. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
  140. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
  141. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.la +1 -1
  142. data/vendor/local/lib/groonga/scripts/ruby/command.rb +3 -4
  143. data/vendor/local/lib/groonga/scripts/ruby/command_line/grndb.rb +267 -77
  144. data/vendor/local/lib/groonga/scripts/ruby/command_line_parser.rb +96 -0
  145. data/vendor/local/lib/groonga/scripts/ruby/expression_rewriters/optimizer.rb +1 -1
  146. data/vendor/local/lib/groonga/scripts/ruby/expression_tree/binary_operation.rb +30 -7
  147. data/vendor/local/lib/groonga/scripts/ruby/initialize/pre.rb +5 -0
  148. data/vendor/local/lib/groonga/scripts/ruby/loggable.rb +8 -0
  149. data/vendor/local/lib/groonga/scripts/ruby/logger/flags.rb +70 -0
  150. data/vendor/local/lib/groonga/scripts/ruby/query_loggable.rb +8 -0
  151. data/vendor/local/lib/groonga/scripts/ruby/scan_info_builder.rb +1 -1
  152. data/vendor/local/lib/groonga/scripts/ruby/scan_info_data.rb +2 -2
  153. data/vendor/local/lib/groonga/scripts/ruby/time.rb +9 -0
  154. data/vendor/local/lib/libgroonga.a +0 -0
  155. data/vendor/local/lib/libgroonga.dll.a +0 -0
  156. data/vendor/local/lib/libgroonga.la +1 -1
  157. data/vendor/local/lib/liblz4.dll +0 -0
  158. data/vendor/local/lib/liblz4.dll.1 +0 -0
  159. data/vendor/local/lib/liblz4.dll.1.8.2 +0 -0
  160. data/vendor/local/lib/libmecab.dll.a +0 -0
  161. data/vendor/local/lib/libmsgpackc.dll.a +0 -0
  162. data/vendor/local/lib/libonigmo.a +0 -0
  163. data/vendor/local/lib/libonigmo.dll.a +0 -0
  164. data/vendor/local/lib/libonigmo.la +1 -1
  165. data/vendor/local/lib/libpcre.dll.a +0 -0
  166. data/vendor/local/lib/libpcrecpp.dll.a +0 -0
  167. data/vendor/local/lib/libpcreposix.dll.a +0 -0
  168. data/vendor/local/lib/libz.dll.a +0 -0
  169. data/vendor/local/lib/pkgconfig/groonga.pc +2 -2
  170. data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
  171. data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
  172. data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
  173. data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
  174. data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
  175. data/vendor/local/share/doc/RapidJSON/examples/CMakeLists.txt +42 -0
  176. data/vendor/local/share/doc/RapidJSON/examples/capitalize/capitalize.cpp +67 -0
  177. data/vendor/local/share/doc/RapidJSON/examples/condense/condense.cpp +32 -0
  178. data/vendor/local/share/doc/RapidJSON/examples/filterkey/filterkey.cpp +135 -0
  179. data/vendor/local/share/doc/RapidJSON/examples/filterkeydom/filterkeydom.cpp +170 -0
  180. data/vendor/local/share/doc/RapidJSON/examples/jsonx/jsonx.cpp +207 -0
  181. data/vendor/local/share/doc/RapidJSON/examples/messagereader/messagereader.cpp +105 -0
  182. data/vendor/local/share/doc/RapidJSON/examples/parsebyparts/parsebyparts.cpp +173 -0
  183. data/vendor/local/share/doc/RapidJSON/examples/pretty/pretty.cpp +30 -0
  184. data/vendor/local/share/doc/RapidJSON/examples/prettyauto/prettyauto.cpp +56 -0
  185. data/vendor/local/share/doc/RapidJSON/examples/schemavalidator/schemavalidator.cpp +72 -0
  186. data/vendor/local/share/doc/RapidJSON/examples/serialize/serialize.cpp +173 -0
  187. data/vendor/local/share/doc/RapidJSON/examples/simpledom/simpledom.cpp +29 -0
  188. data/vendor/local/share/doc/RapidJSON/examples/simplereader/simplereader.cpp +42 -0
  189. data/vendor/local/share/doc/RapidJSON/examples/simplewriter/simplewriter.cpp +36 -0
  190. data/vendor/local/share/doc/RapidJSON/examples/tutorial/tutorial.cpp +151 -0
  191. data/vendor/local/share/doc/RapidJSON/readme.md +160 -0
  192. data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
  193. data/vendor/local/share/doc/groonga/en/html/_static/documentation_options.js +1 -1
  194. data/vendor/local/share/doc/groonga/en/html/characteristic.html +3 -3
  195. data/vendor/local/share/doc/groonga/en/html/client.html +3 -3
  196. data/vendor/local/share/doc/groonga/en/html/community.html +3 -3
  197. data/vendor/local/share/doc/groonga/en/html/contribution.html +3 -3
  198. data/vendor/local/share/doc/groonga/en/html/contribution/development.html +3 -3
  199. data/vendor/local/share/doc/groonga/en/html/contribution/development/build.html +3 -3
  200. data/vendor/local/share/doc/groonga/en/html/contribution/development/build/unix_autotools.html +3 -3
  201. data/vendor/local/share/doc/groonga/en/html/contribution/development/build/unix_cmake.html +3 -3
  202. data/vendor/local/share/doc/groonga/en/html/contribution/development/build/windows_cmake.html +3 -3
  203. data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +3 -3
  204. data/vendor/local/share/doc/groonga/en/html/contribution/development/cooperation.html +3 -3
  205. data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +3 -3
  206. data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +3 -3
  207. data/vendor/local/share/doc/groonga/en/html/contribution/development/repository.html +3 -3
  208. data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +3 -3
  209. data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +3 -3
  210. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +3 -3
  211. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +3 -3
  212. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/introduction.html +3 -3
  213. data/vendor/local/share/doc/groonga/en/html/contribution/report.html +3 -3
  214. data/vendor/local/share/doc/groonga/en/html/development.html +3 -3
  215. data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +3 -3
  216. data/vendor/local/share/doc/groonga/en/html/genindex.html +3 -3
  217. data/vendor/local/share/doc/groonga/en/html/index.html +11 -7
  218. data/vendor/local/share/doc/groonga/en/html/install.html +5 -4
  219. data/vendor/local/share/doc/groonga/en/html/install/centos.html +6 -6
  220. data/vendor/local/share/doc/groonga/en/html/install/debian.html +79 -8
  221. data/vendor/local/share/doc/groonga/en/html/install/docker.html +3 -3
  222. data/vendor/local/share/doc/groonga/en/html/install/fedora.html +6 -6
  223. data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +6 -6
  224. data/vendor/local/share/doc/groonga/en/html/install/others.html +6 -6
  225. data/vendor/local/share/doc/groonga/en/html/install/solaris.html +6 -6
  226. data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +6 -6
  227. data/vendor/local/share/doc/groonga/en/html/install/windows.html +12 -12
  228. data/vendor/local/share/doc/groonga/en/html/limitations.html +3 -3
  229. data/vendor/local/share/doc/groonga/en/html/news.html +498 -206
  230. data/vendor/local/share/doc/groonga/en/html/news/0.x.html +3 -3
  231. data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +3 -3
  232. data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +3 -3
  233. data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +3 -3
  234. data/vendor/local/share/doc/groonga/en/html/news/1.3.x.html +3 -3
  235. data/vendor/local/share/doc/groonga/en/html/news/2.x.html +3 -3
  236. data/vendor/local/share/doc/groonga/en/html/news/3.x.html +3 -3
  237. data/vendor/local/share/doc/groonga/en/html/news/4.x.html +3 -3
  238. data/vendor/local/share/doc/groonga/en/html/news/5.x.html +3 -3
  239. data/vendor/local/share/doc/groonga/en/html/news/6.x.html +3 -3
  240. data/vendor/local/share/doc/groonga/en/html/news/senna.html +3 -3
  241. data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
  242. data/vendor/local/share/doc/groonga/en/html/reference.html +9 -6
  243. data/vendor/local/share/doc/groonga/en/html/reference/alias.html +3 -3
  244. data/vendor/local/share/doc/groonga/en/html/reference/api.html +3 -3
  245. data/vendor/local/share/doc/groonga/en/html/reference/api/global_configurations.html +3 -3
  246. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_cache.html +3 -3
  247. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_column.html +3 -3
  248. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_command_version.html +3 -3
  249. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_content_type.html +3 -3
  250. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +3 -3
  251. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_db.html +3 -3
  252. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_encoding.html +3 -3
  253. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +3 -3
  254. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_geo.html +3 -3
  255. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_hook.html +3 -3
  256. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ii.html +3 -3
  257. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_index_cursor.html +3 -3
  258. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_info.html +3 -3
  259. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_inspect.html +3 -3
  260. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_match_escalation.html +3 -3
  261. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_obj.html +3 -3
  262. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_proc.html +3 -3
  263. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_search.html +3 -3
  264. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table.html +3 -3
  265. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table_cursor.html +3 -3
  266. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_thread.html +3 -3
  267. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_type.html +3 -3
  268. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_user_data.html +3 -3
  269. data/vendor/local/share/doc/groonga/en/html/reference/api/overview.html +3 -3
  270. data/vendor/local/share/doc/groonga/en/html/reference/api/plugin.html +3 -3
  271. data/vendor/local/share/doc/groonga/en/html/reference/cast.html +3 -3
  272. data/vendor/local/share/doc/groonga/en/html/reference/column.html +3 -3
  273. data/vendor/local/share/doc/groonga/en/html/reference/columns/index.html +3 -3
  274. data/vendor/local/share/doc/groonga/en/html/reference/columns/pseudo.html +3 -3
  275. data/vendor/local/share/doc/groonga/en/html/reference/columns/scalar.html +3 -3
  276. data/vendor/local/share/doc/groonga/en/html/reference/columns/vector.html +3 -3
  277. data/vendor/local/share/doc/groonga/en/html/reference/command.html +3 -3
  278. data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +3 -3
  279. data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +3 -3
  280. data/vendor/local/share/doc/groonga/en/html/reference/command/pretty_print.html +3 -3
  281. data/vendor/local/share/doc/groonga/en/html/reference/command/request_id.html +3 -3
  282. data/vendor/local/share/doc/groonga/en/html/reference/command/request_timeout.html +3 -3
  283. data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +3 -3
  284. data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +3 -3
  285. data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +3 -3
  286. data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +3 -3
  287. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_copy.html +3 -3
  288. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +3 -3
  289. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +3 -3
  290. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +3 -3
  291. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +3 -3
  292. data/vendor/local/share/doc/groonga/en/html/reference/commands/config_delete.html +3 -3
  293. data/vendor/local/share/doc/groonga/en/html/reference/commands/config_get.html +3 -3
  294. data/vendor/local/share/doc/groonga/en/html/reference/commands/config_set.html +3 -3
  295. data/vendor/local/share/doc/groonga/en/html/reference/commands/database_unmap.html +3 -3
  296. data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +3 -3
  297. data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +3 -3
  298. data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +3 -3
  299. data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +3 -3
  300. data/vendor/local/share/doc/groonga/en/html/reference/commands/io_flush.html +3 -3
  301. data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +3 -3
  302. data/vendor/local/share/doc/groonga/en/html/reference/commands/lock_acquire.html +3 -3
  303. data/vendor/local/share/doc/groonga/en/html/reference/commands/lock_clear.html +3 -3
  304. data/vendor/local/share/doc/groonga/en/html/reference/commands/lock_release.html +3 -3
  305. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +3 -3
  306. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +3 -3
  307. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +3 -3
  308. data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_count.html +3 -3
  309. data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_parameters.html +3 -3
  310. data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_range_filter.html +77 -4
  311. data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_select.html +3 -3
  312. data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_shard_list.html +3 -3
  313. data/vendor/local/share/doc/groonga/en/html/reference/commands/logical_table_remove.html +3 -3
  314. data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +3 -3
  315. data/vendor/local/share/doc/groonga/en/html/reference/commands/normalizer_list.html +3 -3
  316. data/vendor/local/share/doc/groonga/en/html/reference/commands/object_exist.html +3 -3
  317. data/vendor/local/share/doc/groonga/en/html/reference/commands/object_inspect.html +78 -54
  318. data/vendor/local/share/doc/groonga/en/html/reference/commands/object_list.html +3 -3
  319. data/vendor/local/share/doc/groonga/en/html/reference/commands/object_remove.html +3 -3
  320. data/vendor/local/share/doc/groonga/en/html/reference/commands/plugin_register.html +3 -3
  321. data/vendor/local/share/doc/groonga/en/html/reference/commands/plugin_unregister.html +3 -3
  322. data/vendor/local/share/doc/groonga/en/html/reference/commands/query_expand.html +3 -3
  323. data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +3 -3
  324. data/vendor/local/share/doc/groonga/en/html/reference/commands/range_filter.html +3 -3
  325. data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +3 -3
  326. data/vendor/local/share/doc/groonga/en/html/reference/commands/reindex.html +3 -3
  327. data/vendor/local/share/doc/groonga/en/html/reference/commands/request_cancel.html +3 -3
  328. data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_eval.html +3 -3
  329. data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_load.html +3 -3
  330. data/vendor/local/share/doc/groonga/en/html/reference/commands/schema.html +3 -3
  331. data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +3 -3
  332. data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +3 -3
  333. data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +3 -3
  334. data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +3 -3
  335. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_copy.html +3 -3
  336. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +3 -3
  337. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +3 -3
  338. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +3 -3
  339. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_rename.html +3 -3
  340. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_tokenize.html +3 -3
  341. data/vendor/local/share/doc/groonga/en/html/reference/commands/thread_limit.html +3 -3
  342. data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +3 -3
  343. data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenizer_list.html +3 -3
  344. data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +3 -3
  345. data/vendor/local/share/doc/groonga/en/html/reference/configuration.html +6 -6
  346. data/vendor/local/share/doc/groonga/en/html/reference/executables.html +3 -3
  347. data/vendor/local/share/doc/groonga/en/html/reference/executables/grndb.html +58 -4
  348. data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +3 -3
  349. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-benchmark.html +3 -3
  350. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +3 -3
  351. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +3 -3
  352. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +3 -3
  353. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-httpd.html +3 -3
  354. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-learner.html +3 -3
  355. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +3 -3
  356. data/vendor/local/share/doc/groonga/en/html/reference/function.html +3 -3
  357. data/vendor/local/share/doc/groonga/en/html/reference/functions/between.html +3 -3
  358. data/vendor/local/share/doc/groonga/en/html/reference/functions/cast_loose.html +3 -3
  359. data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +3 -3
  360. data/vendor/local/share/doc/groonga/en/html/reference/functions/fuzzy_search.html +3 -3
  361. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +11 -19
  362. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +3 -3
  363. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +3 -3
  364. data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_full.html +3 -3
  365. data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_html.html +3 -3
  366. data/vendor/local/share/doc/groonga/en/html/reference/functions/html_untag.html +3 -3
  367. data/vendor/local/share/doc/groonga/en/html/reference/functions/in_records.html +3 -3
  368. data/vendor/local/share/doc/groonga/en/html/reference/functions/in_values.html +3 -3
  369. data/vendor/local/share/doc/groonga/en/html/reference/functions/math_abs.html +3 -3
  370. data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +3 -3
  371. data/vendor/local/share/doc/groonga/en/html/reference/functions/number_classify.html +3 -3
  372. data/vendor/local/share/doc/groonga/en/html/reference/functions/prefix_rk_search.html +3 -3
  373. data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +3 -3
  374. data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +3 -3
  375. data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +3 -3
  376. data/vendor/local/share/doc/groonga/en/html/reference/functions/string_length.html +3 -3
  377. data/vendor/local/share/doc/groonga/en/html/reference/functions/string_substring.html +3 -3
  378. data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +3 -3
  379. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_day.html +3 -3
  380. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_day_of_week.html +3 -3
  381. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_hour.html +3 -3
  382. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_minute.html +3 -3
  383. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_month.html +3 -3
  384. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_second.html +3 -3
  385. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_week.html +3 -3
  386. data/vendor/local/share/doc/groonga/en/html/reference/functions/time_classify_year.html +3 -3
  387. data/vendor/local/share/doc/groonga/en/html/reference/functions/vector_find.html +3 -3
  388. data/vendor/local/share/doc/groonga/en/html/reference/functions/vector_new.html +3 -3
  389. data/vendor/local/share/doc/groonga/en/html/reference/functions/vector_size.html +3 -3
  390. data/vendor/local/share/doc/groonga/en/html/reference/functions/vector_slice.html +3 -3
  391. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +3 -3
  392. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +3 -3
  393. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +3 -3
  394. data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +3 -3
  395. data/vendor/local/share/doc/groonga/en/html/reference/log.html +3 -3
  396. data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +3 -3
  397. data/vendor/local/share/doc/groonga/en/html/reference/normalizers/normalizer_auto.html +3 -3
  398. data/vendor/local/share/doc/groonga/en/html/reference/normalizers/normalizer_nfkc100.html +3 -3
  399. data/vendor/local/share/doc/groonga/en/html/reference/normalizers/normalizer_nfkc51.html +3 -3
  400. data/vendor/local/share/doc/groonga/en/html/reference/operations.html +3 -3
  401. data/vendor/local/share/doc/groonga/en/html/reference/operations/geolocation_search.html +3 -3
  402. data/vendor/local/share/doc/groonga/en/html/reference/operations/prefix_rk_search.html +3 -3
  403. data/vendor/local/share/doc/groonga/en/html/reference/output.html +3 -3
  404. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +3 -3
  405. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +3 -3
  406. data/vendor/local/share/doc/groonga/en/html/reference/regular_expression.html +3 -3
  407. data/vendor/local/share/doc/groonga/en/html/reference/scorer.html +3 -3
  408. data/vendor/local/share/doc/groonga/en/html/reference/scorers/scorer_tf_at_most.html +3 -3
  409. data/vendor/local/share/doc/groonga/en/html/reference/scorers/scorer_tf_idf.html +3 -3
  410. data/vendor/local/share/doc/groonga/en/html/reference/sharding.html +3 -3
  411. data/vendor/local/share/doc/groonga/en/html/reference/suggest.html +3 -3
  412. data/vendor/local/share/doc/groonga/en/html/reference/suggest/completion.html +3 -3
  413. data/vendor/local/share/doc/groonga/en/html/reference/suggest/correction.html +3 -3
  414. data/vendor/local/share/doc/groonga/en/html/reference/suggest/introduction.html +3 -3
  415. data/vendor/local/share/doc/groonga/en/html/reference/suggest/suggestion.html +3 -3
  416. data/vendor/local/share/doc/groonga/en/html/reference/tables.html +3 -3
  417. data/vendor/local/share/doc/groonga/en/html/reference/token_filter/summary.html +3 -3
  418. data/vendor/local/share/doc/groonga/en/html/reference/token_filters.html +7 -7
  419. data/vendor/local/share/doc/groonga/en/html/reference/token_filters/token_filter_nfkc100.html +3 -3
  420. data/vendor/local/share/doc/groonga/en/html/reference/token_filters/token_filter_stem.html +3 -3
  421. data/vendor/local/share/doc/groonga/en/html/reference/token_filters/token_filter_stop_word.html +3 -3
  422. data/vendor/local/share/doc/groonga/en/html/reference/tokenizer/summary.html +3 -3
  423. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +9 -6
  424. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram.html +3 -3
  425. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram_ignore_blank.html +3 -3
  426. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram_ignore_blank_split_symbol.html +3 -3
  427. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram_ignore_blank_split_symbol_alpha.html +3 -3
  428. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram_ignore_blank_split_symbol_alpha_digit.html +3 -3
  429. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram_split_symbol.html +3 -3
  430. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram_split_symbol_alpha.html +3 -3
  431. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_bigram_split_symbol_alpha_digit.html +3 -3
  432. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_delimit.html +3 -3
  433. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_delimit_null.html +3 -3
  434. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_mecab.html +8 -8
  435. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_ngram.html +1005 -0
  436. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_pattern.html +240 -0
  437. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_regexp.html +21 -21
  438. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_table.html +246 -0
  439. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_trigram.html +20 -20
  440. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers/token_unigram.html +15 -15
  441. data/vendor/local/share/doc/groonga/en/html/reference/tuning.html +3 -3
  442. data/vendor/local/share/doc/groonga/en/html/reference/types.html +3 -3
  443. data/vendor/local/share/doc/groonga/en/html/reference/window_function.html +3 -3
  444. data/vendor/local/share/doc/groonga/en/html/reference/window_functions/record_number.html +3 -3
  445. data/vendor/local/share/doc/groonga/en/html/reference/window_functions/window_count.html +3 -3
  446. data/vendor/local/share/doc/groonga/en/html/reference/window_functions/window_record_number.html +3 -3
  447. data/vendor/local/share/doc/groonga/en/html/reference/window_functions/window_sum.html +3 -3
  448. data/vendor/local/share/doc/groonga/en/html/search.html +3 -3
  449. data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
  450. data/vendor/local/share/doc/groonga/en/html/server.html +3 -3
  451. data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +3 -3
  452. data/vendor/local/share/doc/groonga/en/html/server/http.html +3 -3
  453. data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +3 -3
  454. data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +3 -3
  455. data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +3 -3
  456. data/vendor/local/share/doc/groonga/en/html/server/memcached.html +3 -3
  457. data/vendor/local/share/doc/groonga/en/html/server/package.html +3 -3
  458. data/vendor/local/share/doc/groonga/en/html/spec.html +3 -3
  459. data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +3 -3
  460. data/vendor/local/share/doc/groonga/en/html/spec/search.html +3 -3
  461. data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +3 -3
  462. data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +3 -3
  463. data/vendor/local/share/doc/groonga/en/html/troubleshooting/how_to_analyze_error_message.html +3 -3
  464. data/vendor/local/share/doc/groonga/en/html/troubleshooting/mmap_cannot_allocate_memory.html +3 -3
  465. data/vendor/local/share/doc/groonga/en/html/tutorial.html +3 -3
  466. data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +3 -3
  467. data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +3 -3
  468. data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +3 -3
  469. data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +3 -3
  470. data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +3 -3
  471. data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +68 -6
  472. data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +37 -4
  473. data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +3 -3
  474. data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +3 -3
  475. data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +3 -3
  476. data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +3 -3
  477. data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
  478. data/vendor/local/share/doc/groonga/ja/html/_static/documentation_options.js +1 -1
  479. data/vendor/local/share/doc/groonga/ja/html/characteristic.html +3 -3
  480. data/vendor/local/share/doc/groonga/ja/html/client.html +3 -3
  481. data/vendor/local/share/doc/groonga/ja/html/community.html +3 -3
  482. data/vendor/local/share/doc/groonga/ja/html/contribution.html +3 -3
  483. data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +3 -3
  484. data/vendor/local/share/doc/groonga/ja/html/contribution/development/build.html +3 -3
  485. data/vendor/local/share/doc/groonga/ja/html/contribution/development/build/unix_autotools.html +3 -3
  486. data/vendor/local/share/doc/groonga/ja/html/contribution/development/build/unix_cmake.html +3 -3
  487. data/vendor/local/share/doc/groonga/ja/html/contribution/development/build/windows_cmake.html +3 -3
  488. data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +3 -3
  489. data/vendor/local/share/doc/groonga/ja/html/contribution/development/cooperation.html +3 -3
  490. data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +3 -3
  491. data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +3 -3
  492. data/vendor/local/share/doc/groonga/ja/html/contribution/development/repository.html +3 -3
  493. data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +3 -3
  494. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +3 -3
  495. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +3 -3
  496. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +3 -3
  497. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/introduction.html +3 -3
  498. data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +3 -3
  499. data/vendor/local/share/doc/groonga/ja/html/development.html +3 -3
  500. data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +3 -3
  501. data/vendor/local/share/doc/groonga/ja/html/genindex.html +3 -3
  502. data/vendor/local/share/doc/groonga/ja/html/index.html +11 -7
  503. data/vendor/local/share/doc/groonga/ja/html/install.html +5 -4
  504. data/vendor/local/share/doc/groonga/ja/html/install/centos.html +6 -6
  505. data/vendor/local/share/doc/groonga/ja/html/install/debian.html +69 -8
  506. data/vendor/local/share/doc/groonga/ja/html/install/docker.html +3 -3
  507. data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +6 -6
  508. data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +6 -6
  509. data/vendor/local/share/doc/groonga/ja/html/install/others.html +6 -6
  510. data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +6 -6
  511. data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +6 -6
  512. data/vendor/local/share/doc/groonga/ja/html/install/windows.html +12 -12
  513. data/vendor/local/share/doc/groonga/ja/html/limitations.html +3 -3
  514. data/vendor/local/share/doc/groonga/ja/html/news.html +494 -206
  515. data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +3 -3
  516. data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +3 -3
  517. data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +3 -3
  518. data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +3 -3
  519. data/vendor/local/share/doc/groonga/ja/html/news/1.3.x.html +3 -3
  520. data/vendor/local/share/doc/groonga/ja/html/news/2.x.html +3 -3
  521. data/vendor/local/share/doc/groonga/ja/html/news/3.x.html +3 -3
  522. data/vendor/local/share/doc/groonga/ja/html/news/4.x.html +3 -3
  523. data/vendor/local/share/doc/groonga/ja/html/news/5.x.html +3 -3
  524. data/vendor/local/share/doc/groonga/ja/html/news/6.x.html +3 -3
  525. data/vendor/local/share/doc/groonga/ja/html/news/senna.html +3 -3
  526. data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
  527. data/vendor/local/share/doc/groonga/ja/html/reference.html +9 -6
  528. data/vendor/local/share/doc/groonga/ja/html/reference/alias.html +3 -3
  529. data/vendor/local/share/doc/groonga/ja/html/reference/api.html +3 -3
  530. data/vendor/local/share/doc/groonga/ja/html/reference/api/global_configurations.html +3 -3
  531. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_cache.html +3 -3
  532. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_column.html +3 -3
  533. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_command_version.html +3 -3
  534. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_content_type.html +3 -3
  535. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +3 -3
  536. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_db.html +3 -3
  537. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_encoding.html +3 -3
  538. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +3 -3
  539. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_geo.html +3 -3
  540. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_hook.html +3 -3
  541. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ii.html +3 -3
  542. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_index_cursor.html +3 -3
  543. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_info.html +3 -3
  544. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_inspect.html +3 -3
  545. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_match_escalation.html +3 -3
  546. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_obj.html +3 -3
  547. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_proc.html +3 -3
  548. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_search.html +3 -3
  549. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table.html +3 -3
  550. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table_cursor.html +3 -3
  551. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_thread.html +3 -3
  552. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_type.html +3 -3
  553. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_user_data.html +3 -3
  554. data/vendor/local/share/doc/groonga/ja/html/reference/api/overview.html +3 -3
  555. data/vendor/local/share/doc/groonga/ja/html/reference/api/plugin.html +3 -3
  556. data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +3 -3
  557. data/vendor/local/share/doc/groonga/ja/html/reference/column.html +3 -3
  558. data/vendor/local/share/doc/groonga/ja/html/reference/columns/index.html +3 -3
  559. data/vendor/local/share/doc/groonga/ja/html/reference/columns/pseudo.html +3 -3
  560. data/vendor/local/share/doc/groonga/ja/html/reference/columns/scalar.html +3 -3
  561. data/vendor/local/share/doc/groonga/ja/html/reference/columns/vector.html +3 -3
  562. data/vendor/local/share/doc/groonga/ja/html/reference/command.html +3 -3
  563. data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +3 -3
  564. data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +3 -3
  565. data/vendor/local/share/doc/groonga/ja/html/reference/command/pretty_print.html +3 -3
  566. data/vendor/local/share/doc/groonga/ja/html/reference/command/request_id.html +3 -3
  567. data/vendor/local/share/doc/groonga/ja/html/reference/command/request_timeout.html +3 -3
  568. data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +3 -3
  569. data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +3 -3
  570. data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +3 -3
  571. data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +3 -3
  572. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_copy.html +3 -3
  573. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +3 -3
  574. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +3 -3
  575. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +3 -3
  576. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_rename.html +3 -3
  577. data/vendor/local/share/doc/groonga/ja/html/reference/commands/config_delete.html +3 -3
  578. data/vendor/local/share/doc/groonga/ja/html/reference/commands/config_get.html +3 -3
  579. data/vendor/local/share/doc/groonga/ja/html/reference/commands/config_set.html +3 -3
  580. data/vendor/local/share/doc/groonga/ja/html/reference/commands/database_unmap.html +3 -3
  581. data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +3 -3
  582. data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +3 -3
  583. data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +3 -3
  584. data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +3 -3
  585. data/vendor/local/share/doc/groonga/ja/html/reference/commands/io_flush.html +3 -3
  586. data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +3 -3
  587. data/vendor/local/share/doc/groonga/ja/html/reference/commands/lock_acquire.html +3 -3
  588. data/vendor/local/share/doc/groonga/ja/html/reference/commands/lock_clear.html +3 -3
  589. data/vendor/local/share/doc/groonga/ja/html/reference/commands/lock_release.html +3 -3
  590. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +3 -3
  591. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +3 -3
  592. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +3 -3
  593. data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_count.html +3 -3
  594. data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_parameters.html +3 -3
  595. data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_range_filter.html +75 -4
  596. data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_select.html +7 -7
  597. data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_shard_list.html +3 -3
  598. data/vendor/local/share/doc/groonga/ja/html/reference/commands/logical_table_remove.html +3 -3
  599. data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalize.html +3 -3
  600. data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalizer_list.html +3 -3
  601. data/vendor/local/share/doc/groonga/ja/html/reference/commands/object_exist.html +3 -3
  602. data/vendor/local/share/doc/groonga/ja/html/reference/commands/object_inspect.html +73 -54
  603. data/vendor/local/share/doc/groonga/ja/html/reference/commands/object_list.html +3 -3
  604. data/vendor/local/share/doc/groonga/ja/html/reference/commands/object_remove.html +3 -3
  605. data/vendor/local/share/doc/groonga/ja/html/reference/commands/plugin_register.html +3 -3
  606. data/vendor/local/share/doc/groonga/ja/html/reference/commands/plugin_unregister.html +3 -3
  607. data/vendor/local/share/doc/groonga/ja/html/reference/commands/query_expand.html +3 -3
  608. data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +3 -3
  609. data/vendor/local/share/doc/groonga/ja/html/reference/commands/range_filter.html +3 -3
  610. data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +3 -3
  611. data/vendor/local/share/doc/groonga/ja/html/reference/commands/reindex.html +3 -3
  612. data/vendor/local/share/doc/groonga/ja/html/reference/commands/request_cancel.html +3 -3
  613. data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_eval.html +3 -3
  614. data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_load.html +3 -3
  615. data/vendor/local/share/doc/groonga/ja/html/reference/commands/schema.html +3 -3
  616. data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +7 -7
  617. data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +3 -3
  618. data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +3 -3
  619. data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +3 -3
  620. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_copy.html +3 -3
  621. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +3 -3
  622. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +3 -3
  623. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +3 -3
  624. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_rename.html +3 -3
  625. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_tokenize.html +3 -3
  626. data/vendor/local/share/doc/groonga/ja/html/reference/commands/thread_limit.html +3 -3
  627. data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenize.html +3 -3
  628. data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenizer_list.html +3 -3
  629. data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +3 -3
  630. data/vendor/local/share/doc/groonga/ja/html/reference/configuration.html +6 -6
  631. data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +3 -3
  632. data/vendor/local/share/doc/groonga/ja/html/reference/executables/grndb.html +57 -4
  633. data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +3 -3
  634. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-benchmark.html +3 -3
  635. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +3 -3
  636. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +3 -3
  637. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +3 -3
  638. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-httpd.html +3 -3
  639. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-learner.html +3 -3
  640. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +3 -3
  641. data/vendor/local/share/doc/groonga/ja/html/reference/function.html +3 -3
  642. data/vendor/local/share/doc/groonga/ja/html/reference/functions/between.html +3 -3
  643. data/vendor/local/share/doc/groonga/ja/html/reference/functions/cast_loose.html +3 -3
  644. data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +3 -3
  645. data/vendor/local/share/doc/groonga/ja/html/reference/functions/fuzzy_search.html +3 -3
  646. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +11 -19
  647. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +3 -3
  648. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +3 -3
  649. data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_full.html +3 -3
  650. data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_html.html +3 -3
  651. data/vendor/local/share/doc/groonga/ja/html/reference/functions/html_untag.html +3 -3
  652. data/vendor/local/share/doc/groonga/ja/html/reference/functions/in_records.html +3 -3
  653. data/vendor/local/share/doc/groonga/ja/html/reference/functions/in_values.html +3 -3
  654. data/vendor/local/share/doc/groonga/ja/html/reference/functions/math_abs.html +3 -3
  655. data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +3 -3
  656. data/vendor/local/share/doc/groonga/ja/html/reference/functions/number_classify.html +3 -3
  657. data/vendor/local/share/doc/groonga/ja/html/reference/functions/prefix_rk_search.html +3 -3
  658. data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +3 -3
  659. data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +3 -3
  660. data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +3 -3
  661. data/vendor/local/share/doc/groonga/ja/html/reference/functions/string_length.html +3 -3
  662. data/vendor/local/share/doc/groonga/ja/html/reference/functions/string_substring.html +3 -3
  663. data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +3 -3
  664. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_day.html +3 -3
  665. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_day_of_week.html +3 -3
  666. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_hour.html +3 -3
  667. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_minute.html +3 -3
  668. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_month.html +3 -3
  669. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_second.html +3 -3
  670. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_week.html +3 -3
  671. data/vendor/local/share/doc/groonga/ja/html/reference/functions/time_classify_year.html +3 -3
  672. data/vendor/local/share/doc/groonga/ja/html/reference/functions/vector_find.html +3 -3
  673. data/vendor/local/share/doc/groonga/ja/html/reference/functions/vector_new.html +3 -3
  674. data/vendor/local/share/doc/groonga/ja/html/reference/functions/vector_size.html +3 -3
  675. data/vendor/local/share/doc/groonga/ja/html/reference/functions/vector_slice.html +3 -3
  676. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +3 -3
  677. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +3 -3
  678. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +3 -3
  679. data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +3 -3
  680. data/vendor/local/share/doc/groonga/ja/html/reference/log.html +3 -3
  681. data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +3 -3
  682. data/vendor/local/share/doc/groonga/ja/html/reference/normalizers/normalizer_auto.html +3 -3
  683. data/vendor/local/share/doc/groonga/ja/html/reference/normalizers/normalizer_nfkc100.html +3 -3
  684. data/vendor/local/share/doc/groonga/ja/html/reference/normalizers/normalizer_nfkc51.html +3 -3
  685. data/vendor/local/share/doc/groonga/ja/html/reference/operations.html +3 -3
  686. data/vendor/local/share/doc/groonga/ja/html/reference/operations/geolocation_search.html +3 -3
  687. data/vendor/local/share/doc/groonga/ja/html/reference/operations/prefix_rk_search.html +3 -3
  688. data/vendor/local/share/doc/groonga/ja/html/reference/output.html +3 -3
  689. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +3 -3
  690. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +3 -3
  691. data/vendor/local/share/doc/groonga/ja/html/reference/regular_expression.html +3 -3
  692. data/vendor/local/share/doc/groonga/ja/html/reference/scorer.html +3 -3
  693. data/vendor/local/share/doc/groonga/ja/html/reference/scorers/scorer_tf_at_most.html +3 -3
  694. data/vendor/local/share/doc/groonga/ja/html/reference/scorers/scorer_tf_idf.html +3 -3
  695. data/vendor/local/share/doc/groonga/ja/html/reference/sharding.html +3 -3
  696. data/vendor/local/share/doc/groonga/ja/html/reference/suggest.html +3 -3
  697. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/completion.html +3 -3
  698. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/correction.html +3 -3
  699. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/introduction.html +3 -3
  700. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/suggestion.html +3 -3
  701. data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +3 -3
  702. data/vendor/local/share/doc/groonga/ja/html/reference/token_filter/summary.html +3 -3
  703. data/vendor/local/share/doc/groonga/ja/html/reference/token_filters.html +7 -7
  704. data/vendor/local/share/doc/groonga/ja/html/reference/token_filters/token_filter_nfkc100.html +3 -3
  705. data/vendor/local/share/doc/groonga/ja/html/reference/token_filters/token_filter_stem.html +3 -3
  706. data/vendor/local/share/doc/groonga/ja/html/reference/token_filters/token_filter_stop_word.html +3 -3
  707. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizer/summary.html +3 -3
  708. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +9 -6
  709. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram.html +3 -3
  710. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram_ignore_blank.html +3 -3
  711. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram_ignore_blank_split_symbol.html +3 -3
  712. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram_ignore_blank_split_symbol_alpha.html +3 -3
  713. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram_ignore_blank_split_symbol_alpha_digit.html +3 -3
  714. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram_split_symbol.html +3 -3
  715. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram_split_symbol_alpha.html +3 -3
  716. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_bigram_split_symbol_alpha_digit.html +3 -3
  717. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_delimit.html +3 -3
  718. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_delimit_null.html +3 -3
  719. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_mecab.html +8 -8
  720. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_ngram.html +998 -0
  721. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_pattern.html +240 -0
  722. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_regexp.html +21 -21
  723. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_table.html +242 -0
  724. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_trigram.html +20 -20
  725. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers/token_unigram.html +15 -15
  726. data/vendor/local/share/doc/groonga/ja/html/reference/tuning.html +3 -3
  727. data/vendor/local/share/doc/groonga/ja/html/reference/types.html +3 -3
  728. data/vendor/local/share/doc/groonga/ja/html/reference/window_function.html +3 -3
  729. data/vendor/local/share/doc/groonga/ja/html/reference/window_functions/record_number.html +3 -3
  730. data/vendor/local/share/doc/groonga/ja/html/reference/window_functions/window_count.html +3 -3
  731. data/vendor/local/share/doc/groonga/ja/html/reference/window_functions/window_record_number.html +3 -3
  732. data/vendor/local/share/doc/groonga/ja/html/reference/window_functions/window_sum.html +3 -3
  733. data/vendor/local/share/doc/groonga/ja/html/search.html +3 -3
  734. data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
  735. data/vendor/local/share/doc/groonga/ja/html/server.html +3 -3
  736. data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +3 -3
  737. data/vendor/local/share/doc/groonga/ja/html/server/http.html +3 -3
  738. data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +3 -3
  739. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +3 -3
  740. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +3 -3
  741. data/vendor/local/share/doc/groonga/ja/html/server/memcached.html +3 -3
  742. data/vendor/local/share/doc/groonga/ja/html/server/package.html +3 -3
  743. data/vendor/local/share/doc/groonga/ja/html/spec.html +3 -3
  744. data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +3 -3
  745. data/vendor/local/share/doc/groonga/ja/html/spec/search.html +3 -3
  746. data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +3 -3
  747. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +3 -3
  748. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/how_to_analyze_error_message.html +3 -3
  749. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/mmap_cannot_allocate_memory.html +3 -3
  750. data/vendor/local/share/doc/groonga/ja/html/tutorial.html +3 -3
  751. data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +3 -3
  752. data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +3 -3
  753. data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +3 -3
  754. data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +3 -3
  755. data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +3 -3
  756. data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +64 -6
  757. data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +37 -4
  758. data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +3 -3
  759. data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +3 -3
  760. data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +3 -3
  761. data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +3 -3
  762. data/vendor/local/share/groonga/COPYING +502 -0
  763. data/vendor/local/share/groonga/mruby/LEGAL +58 -54
  764. data/vendor/local/share/license/mruby/AUTHORS +6 -2
  765. data/vendor/local/share/license/mruby/LEGAL +1 -1
  766. data/vendor/local/share/license/mruby/{MITL → LICENSE} +1 -1
  767. data/vendor/local/share/license/mruby/README.md +3 -3
  768. data/vendor/local/share/license/rapidjson/license.txt +57 -0
  769. metadata +126 -60
@@ -0,0 +1,300 @@
1
+ // ISO C9x compliant stdint.h for Microsoft Visual Studio
2
+ // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
3
+ //
4
+ // Copyright (c) 2006-2013 Alexander Chemeris
5
+ //
6
+ // Redistribution and use in source and binary forms, with or without
7
+ // modification, are permitted provided that the following conditions are met:
8
+ //
9
+ // 1. Redistributions of source code must retain the above copyright notice,
10
+ // this list of conditions and the following disclaimer.
11
+ //
12
+ // 2. Redistributions in binary form must reproduce the above copyright
13
+ // notice, this list of conditions and the following disclaimer in the
14
+ // documentation and/or other materials provided with the distribution.
15
+ //
16
+ // 3. Neither the name of the product nor the names of its contributors may
17
+ // be used to endorse or promote products derived from this software
18
+ // without specific prior written permission.
19
+ //
20
+ // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
21
+ // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22
+ // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
23
+ // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
+ // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26
+ // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27
+ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28
+ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29
+ // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ //
31
+ ///////////////////////////////////////////////////////////////////////////////
32
+
33
+ // The above software in this distribution may have been modified by
34
+ // THL A29 Limited ("Tencent Modifications").
35
+ // All Tencent Modifications are Copyright (C) 2015 THL A29 Limited.
36
+
37
+ #ifndef _MSC_VER // [
38
+ #error "Use this header only with Microsoft Visual C++ compilers!"
39
+ #endif // _MSC_VER ]
40
+
41
+ #ifndef _MSC_STDINT_H_ // [
42
+ #define _MSC_STDINT_H_
43
+
44
+ #if _MSC_VER > 1000
45
+ #pragma once
46
+ #endif
47
+
48
+ // miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010.
49
+ #if _MSC_VER >= 1600 // [
50
+ #include <stdint.h>
51
+
52
+ #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
53
+
54
+ #undef INT8_C
55
+ #undef INT16_C
56
+ #undef INT32_C
57
+ #undef INT64_C
58
+ #undef UINT8_C
59
+ #undef UINT16_C
60
+ #undef UINT32_C
61
+ #undef UINT64_C
62
+
63
+ // 7.18.4.1 Macros for minimum-width integer constants
64
+
65
+ #define INT8_C(val) val##i8
66
+ #define INT16_C(val) val##i16
67
+ #define INT32_C(val) val##i32
68
+ #define INT64_C(val) val##i64
69
+
70
+ #define UINT8_C(val) val##ui8
71
+ #define UINT16_C(val) val##ui16
72
+ #define UINT32_C(val) val##ui32
73
+ #define UINT64_C(val) val##ui64
74
+
75
+ // 7.18.4.2 Macros for greatest-width integer constants
76
+ // These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
77
+ // Check out Issue 9 for the details.
78
+ #ifndef INTMAX_C // [
79
+ # define INTMAX_C INT64_C
80
+ #endif // INTMAX_C ]
81
+ #ifndef UINTMAX_C // [
82
+ # define UINTMAX_C UINT64_C
83
+ #endif // UINTMAX_C ]
84
+
85
+ #endif // __STDC_CONSTANT_MACROS ]
86
+
87
+ #else // ] _MSC_VER >= 1700 [
88
+
89
+ #include <limits.h>
90
+
91
+ // For Visual Studio 6 in C++ mode and for many Visual Studio versions when
92
+ // compiling for ARM we have to wrap <wchar.h> include with 'extern "C++" {}'
93
+ // or compiler would give many errors like this:
94
+ // error C2733: second C linkage of overloaded function 'wmemchr' not allowed
95
+ #if defined(__cplusplus) && !defined(_M_ARM)
96
+ extern "C" {
97
+ #endif
98
+ # include <wchar.h>
99
+ #if defined(__cplusplus) && !defined(_M_ARM)
100
+ }
101
+ #endif
102
+
103
+ // Define _W64 macros to mark types changing their size, like intptr_t.
104
+ #ifndef _W64
105
+ # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
106
+ # define _W64 __w64
107
+ # else
108
+ # define _W64
109
+ # endif
110
+ #endif
111
+
112
+
113
+ // 7.18.1 Integer types
114
+
115
+ // 7.18.1.1 Exact-width integer types
116
+
117
+ // Visual Studio 6 and Embedded Visual C++ 4 doesn't
118
+ // realize that, e.g. char has the same size as __int8
119
+ // so we give up on __intX for them.
120
+ #if (_MSC_VER < 1300)
121
+ typedef signed char int8_t;
122
+ typedef signed short int16_t;
123
+ typedef signed int int32_t;
124
+ typedef unsigned char uint8_t;
125
+ typedef unsigned short uint16_t;
126
+ typedef unsigned int uint32_t;
127
+ #else
128
+ typedef signed __int8 int8_t;
129
+ typedef signed __int16 int16_t;
130
+ typedef signed __int32 int32_t;
131
+ typedef unsigned __int8 uint8_t;
132
+ typedef unsigned __int16 uint16_t;
133
+ typedef unsigned __int32 uint32_t;
134
+ #endif
135
+ typedef signed __int64 int64_t;
136
+ typedef unsigned __int64 uint64_t;
137
+
138
+
139
+ // 7.18.1.2 Minimum-width integer types
140
+ typedef int8_t int_least8_t;
141
+ typedef int16_t int_least16_t;
142
+ typedef int32_t int_least32_t;
143
+ typedef int64_t int_least64_t;
144
+ typedef uint8_t uint_least8_t;
145
+ typedef uint16_t uint_least16_t;
146
+ typedef uint32_t uint_least32_t;
147
+ typedef uint64_t uint_least64_t;
148
+
149
+ // 7.18.1.3 Fastest minimum-width integer types
150
+ typedef int8_t int_fast8_t;
151
+ typedef int16_t int_fast16_t;
152
+ typedef int32_t int_fast32_t;
153
+ typedef int64_t int_fast64_t;
154
+ typedef uint8_t uint_fast8_t;
155
+ typedef uint16_t uint_fast16_t;
156
+ typedef uint32_t uint_fast32_t;
157
+ typedef uint64_t uint_fast64_t;
158
+
159
+ // 7.18.1.4 Integer types capable of holding object pointers
160
+ #ifdef _WIN64 // [
161
+ typedef signed __int64 intptr_t;
162
+ typedef unsigned __int64 uintptr_t;
163
+ #else // _WIN64 ][
164
+ typedef _W64 signed int intptr_t;
165
+ typedef _W64 unsigned int uintptr_t;
166
+ #endif // _WIN64 ]
167
+
168
+ // 7.18.1.5 Greatest-width integer types
169
+ typedef int64_t intmax_t;
170
+ typedef uint64_t uintmax_t;
171
+
172
+
173
+ // 7.18.2 Limits of specified-width integer types
174
+
175
+ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
176
+
177
+ // 7.18.2.1 Limits of exact-width integer types
178
+ #define INT8_MIN ((int8_t)_I8_MIN)
179
+ #define INT8_MAX _I8_MAX
180
+ #define INT16_MIN ((int16_t)_I16_MIN)
181
+ #define INT16_MAX _I16_MAX
182
+ #define INT32_MIN ((int32_t)_I32_MIN)
183
+ #define INT32_MAX _I32_MAX
184
+ #define INT64_MIN ((int64_t)_I64_MIN)
185
+ #define INT64_MAX _I64_MAX
186
+ #define UINT8_MAX _UI8_MAX
187
+ #define UINT16_MAX _UI16_MAX
188
+ #define UINT32_MAX _UI32_MAX
189
+ #define UINT64_MAX _UI64_MAX
190
+
191
+ // 7.18.2.2 Limits of minimum-width integer types
192
+ #define INT_LEAST8_MIN INT8_MIN
193
+ #define INT_LEAST8_MAX INT8_MAX
194
+ #define INT_LEAST16_MIN INT16_MIN
195
+ #define INT_LEAST16_MAX INT16_MAX
196
+ #define INT_LEAST32_MIN INT32_MIN
197
+ #define INT_LEAST32_MAX INT32_MAX
198
+ #define INT_LEAST64_MIN INT64_MIN
199
+ #define INT_LEAST64_MAX INT64_MAX
200
+ #define UINT_LEAST8_MAX UINT8_MAX
201
+ #define UINT_LEAST16_MAX UINT16_MAX
202
+ #define UINT_LEAST32_MAX UINT32_MAX
203
+ #define UINT_LEAST64_MAX UINT64_MAX
204
+
205
+ // 7.18.2.3 Limits of fastest minimum-width integer types
206
+ #define INT_FAST8_MIN INT8_MIN
207
+ #define INT_FAST8_MAX INT8_MAX
208
+ #define INT_FAST16_MIN INT16_MIN
209
+ #define INT_FAST16_MAX INT16_MAX
210
+ #define INT_FAST32_MIN INT32_MIN
211
+ #define INT_FAST32_MAX INT32_MAX
212
+ #define INT_FAST64_MIN INT64_MIN
213
+ #define INT_FAST64_MAX INT64_MAX
214
+ #define UINT_FAST8_MAX UINT8_MAX
215
+ #define UINT_FAST16_MAX UINT16_MAX
216
+ #define UINT_FAST32_MAX UINT32_MAX
217
+ #define UINT_FAST64_MAX UINT64_MAX
218
+
219
+ // 7.18.2.4 Limits of integer types capable of holding object pointers
220
+ #ifdef _WIN64 // [
221
+ # define INTPTR_MIN INT64_MIN
222
+ # define INTPTR_MAX INT64_MAX
223
+ # define UINTPTR_MAX UINT64_MAX
224
+ #else // _WIN64 ][
225
+ # define INTPTR_MIN INT32_MIN
226
+ # define INTPTR_MAX INT32_MAX
227
+ # define UINTPTR_MAX UINT32_MAX
228
+ #endif // _WIN64 ]
229
+
230
+ // 7.18.2.5 Limits of greatest-width integer types
231
+ #define INTMAX_MIN INT64_MIN
232
+ #define INTMAX_MAX INT64_MAX
233
+ #define UINTMAX_MAX UINT64_MAX
234
+
235
+ // 7.18.3 Limits of other integer types
236
+
237
+ #ifdef _WIN64 // [
238
+ # define PTRDIFF_MIN _I64_MIN
239
+ # define PTRDIFF_MAX _I64_MAX
240
+ #else // _WIN64 ][
241
+ # define PTRDIFF_MIN _I32_MIN
242
+ # define PTRDIFF_MAX _I32_MAX
243
+ #endif // _WIN64 ]
244
+
245
+ #define SIG_ATOMIC_MIN INT_MIN
246
+ #define SIG_ATOMIC_MAX INT_MAX
247
+
248
+ #ifndef SIZE_MAX // [
249
+ # ifdef _WIN64 // [
250
+ # define SIZE_MAX _UI64_MAX
251
+ # else // _WIN64 ][
252
+ # define SIZE_MAX _UI32_MAX
253
+ # endif // _WIN64 ]
254
+ #endif // SIZE_MAX ]
255
+
256
+ // WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
257
+ #ifndef WCHAR_MIN // [
258
+ # define WCHAR_MIN 0
259
+ #endif // WCHAR_MIN ]
260
+ #ifndef WCHAR_MAX // [
261
+ # define WCHAR_MAX _UI16_MAX
262
+ #endif // WCHAR_MAX ]
263
+
264
+ #define WINT_MIN 0
265
+ #define WINT_MAX _UI16_MAX
266
+
267
+ #endif // __STDC_LIMIT_MACROS ]
268
+
269
+
270
+ // 7.18.4 Limits of other integer types
271
+
272
+ #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
273
+
274
+ // 7.18.4.1 Macros for minimum-width integer constants
275
+
276
+ #define INT8_C(val) val##i8
277
+ #define INT16_C(val) val##i16
278
+ #define INT32_C(val) val##i32
279
+ #define INT64_C(val) val##i64
280
+
281
+ #define UINT8_C(val) val##ui8
282
+ #define UINT16_C(val) val##ui16
283
+ #define UINT32_C(val) val##ui32
284
+ #define UINT64_C(val) val##ui64
285
+
286
+ // 7.18.4.2 Macros for greatest-width integer constants
287
+ // These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
288
+ // Check out Issue 9 for the details.
289
+ #ifndef INTMAX_C // [
290
+ # define INTMAX_C INT64_C
291
+ #endif // INTMAX_C ]
292
+ #ifndef UINTMAX_C // [
293
+ # define UINTMAX_C UINT64_C
294
+ #endif // UINTMAX_C ]
295
+
296
+ #endif // __STDC_CONSTANT_MACROS ]
297
+
298
+ #endif // _MSC_VER >= 1600 ]
299
+
300
+ #endif // _MSC_STDINT_H_ ]
@@ -0,0 +1,81 @@
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_OSTREAMWRAPPER_H_
16
+ #define RAPIDJSON_OSTREAMWRAPPER_H_
17
+
18
+ #include "stream.h"
19
+ #include <iosfwd>
20
+
21
+ #ifdef __clang__
22
+ RAPIDJSON_DIAG_PUSH
23
+ RAPIDJSON_DIAG_OFF(padded)
24
+ #endif
25
+
26
+ RAPIDJSON_NAMESPACE_BEGIN
27
+
28
+ //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept.
29
+ /*!
30
+ The classes can be wrapped including but not limited to:
31
+
32
+ - \c std::ostringstream
33
+ - \c std::stringstream
34
+ - \c std::wpstringstream
35
+ - \c std::wstringstream
36
+ - \c std::ifstream
37
+ - \c std::fstream
38
+ - \c std::wofstream
39
+ - \c std::wfstream
40
+
41
+ \tparam StreamType Class derived from \c std::basic_ostream.
42
+ */
43
+
44
+ template <typename StreamType>
45
+ class BasicOStreamWrapper {
46
+ public:
47
+ typedef typename StreamType::char_type Ch;
48
+ BasicOStreamWrapper(StreamType& stream) : stream_(stream) {}
49
+
50
+ void Put(Ch c) {
51
+ stream_.put(c);
52
+ }
53
+
54
+ void Flush() {
55
+ stream_.flush();
56
+ }
57
+
58
+ // Not implemented
59
+ char Peek() const { RAPIDJSON_ASSERT(false); return 0; }
60
+ char Take() { RAPIDJSON_ASSERT(false); return 0; }
61
+ size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
62
+ char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
63
+ size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
64
+
65
+ private:
66
+ BasicOStreamWrapper(const BasicOStreamWrapper&);
67
+ BasicOStreamWrapper& operator=(const BasicOStreamWrapper&);
68
+
69
+ StreamType& stream_;
70
+ };
71
+
72
+ typedef BasicOStreamWrapper<std::ostream> OStreamWrapper;
73
+ typedef BasicOStreamWrapper<std::wostream> WOStreamWrapper;
74
+
75
+ #ifdef __clang__
76
+ RAPIDJSON_DIAG_POP
77
+ #endif
78
+
79
+ RAPIDJSON_NAMESPACE_END
80
+
81
+ #endif // RAPIDJSON_OSTREAMWRAPPER_H_
@@ -0,0 +1,1358 @@
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_POINTER_H_
16
+ #define RAPIDJSON_POINTER_H_
17
+
18
+ #include "document.h"
19
+ #include "internal/itoa.h"
20
+
21
+ #ifdef __clang__
22
+ RAPIDJSON_DIAG_PUSH
23
+ RAPIDJSON_DIAG_OFF(switch-enum)
24
+ #endif
25
+
26
+ #ifdef _MSC_VER
27
+ RAPIDJSON_DIAG_PUSH
28
+ RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
29
+ #endif
30
+
31
+ RAPIDJSON_NAMESPACE_BEGIN
32
+
33
+ static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token
34
+
35
+ //! Error code of parsing.
36
+ /*! \ingroup RAPIDJSON_ERRORS
37
+ \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode
38
+ */
39
+ enum PointerParseErrorCode {
40
+ kPointerParseErrorNone = 0, //!< The parse is successful
41
+
42
+ kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/'
43
+ kPointerParseErrorInvalidEscape, //!< Invalid escape
44
+ kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment
45
+ kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment
46
+ };
47
+
48
+ ///////////////////////////////////////////////////////////////////////////////
49
+ // GenericPointer
50
+
51
+ //! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator.
52
+ /*!
53
+ This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer"
54
+ (https://tools.ietf.org/html/rfc6901).
55
+
56
+ A JSON pointer is for identifying a specific value in a JSON document
57
+ (GenericDocument). It can simplify coding of DOM tree manipulation, because it
58
+ can access multiple-level depth of DOM tree with single API call.
59
+
60
+ After it parses a string representation (e.g. "/foo/0" or URI fragment
61
+ representation (e.g. "#/foo/0") into its internal representation (tokens),
62
+ it can be used to resolve a specific value in multiple documents, or sub-tree
63
+ of documents.
64
+
65
+ Contrary to GenericValue, Pointer can be copy constructed and copy assigned.
66
+ Apart from assignment, a Pointer cannot be modified after construction.
67
+
68
+ Although Pointer is very convenient, please aware that constructing Pointer
69
+ involves parsing and dynamic memory allocation. A special constructor with user-
70
+ supplied tokens eliminates these.
71
+
72
+ GenericPointer depends on GenericDocument and GenericValue.
73
+
74
+ \tparam ValueType The value type of the DOM tree. E.g. GenericValue<UTF8<> >
75
+ \tparam Allocator The allocator type for allocating memory for internal representation.
76
+
77
+ \note GenericPointer uses same encoding of ValueType.
78
+ However, Allocator of GenericPointer is independent of Allocator of Value.
79
+ */
80
+ template <typename ValueType, typename Allocator = CrtAllocator>
81
+ class GenericPointer {
82
+ public:
83
+ typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value
84
+ typedef typename ValueType::Ch Ch; //!< Character type from Value
85
+
86
+ //! A token is the basic units of internal representation.
87
+ /*!
88
+ A JSON pointer string representation "/foo/123" is parsed to two tokens:
89
+ "foo" and 123. 123 will be represented in both numeric form and string form.
90
+ They are resolved according to the actual value type (object or array).
91
+
92
+ For token that are not numbers, or the numeric value is out of bound
93
+ (greater than limits of SizeType), they are only treated as string form
94
+ (i.e. the token's index will be equal to kPointerInvalidIndex).
95
+
96
+ This struct is public so that user can create a Pointer without parsing and
97
+ allocation, using a special constructor.
98
+ */
99
+ struct Token {
100
+ const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character.
101
+ SizeType length; //!< Length of the name.
102
+ SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex.
103
+ };
104
+
105
+ //!@name Constructors and destructor.
106
+ //@{
107
+
108
+ //! Default constructor.
109
+ GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {}
110
+
111
+ //! Constructor that parses a string or URI fragment representation.
112
+ /*!
113
+ \param source A null-terminated, string or URI fragment representation of JSON pointer.
114
+ \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
115
+ */
116
+ explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
117
+ Parse(source, internal::StrLen(source));
118
+ }
119
+
120
+ #if RAPIDJSON_HAS_STDSTRING
121
+ //! Constructor that parses a string or URI fragment representation.
122
+ /*!
123
+ \param source A string or URI fragment representation of JSON pointer.
124
+ \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
125
+ \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
126
+ */
127
+ explicit GenericPointer(const std::basic_string<Ch>& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
128
+ Parse(source.c_str(), source.size());
129
+ }
130
+ #endif
131
+
132
+ //! Constructor that parses a string or URI fragment representation, with length of the source string.
133
+ /*!
134
+ \param source A string or URI fragment representation of JSON pointer.
135
+ \param length Length of source.
136
+ \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
137
+ \note Slightly faster than the overload without length.
138
+ */
139
+ GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
140
+ Parse(source, length);
141
+ }
142
+
143
+ //! Constructor with user-supplied tokens.
144
+ /*!
145
+ This constructor let user supplies const array of tokens.
146
+ This prevents the parsing process and eliminates allocation.
147
+ This is preferred for memory constrained environments.
148
+
149
+ \param tokens An constant array of tokens representing the JSON pointer.
150
+ \param tokenCount Number of tokens.
151
+
152
+ \b Example
153
+ \code
154
+ #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
155
+ #define INDEX(i) { #i, sizeof(#i) - 1, i }
156
+
157
+ static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) };
158
+ static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
159
+ // Equivalent to static const Pointer p("/foo/123");
160
+
161
+ #undef NAME
162
+ #undef INDEX
163
+ \endcode
164
+ */
165
+ GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast<Token*>(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {}
166
+
167
+ //! Copy constructor.
168
+ GenericPointer(const GenericPointer& rhs, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
169
+ *this = rhs;
170
+ }
171
+
172
+ //! Destructor.
173
+ ~GenericPointer() {
174
+ if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated.
175
+ Allocator::Free(tokens_);
176
+ RAPIDJSON_DELETE(ownAllocator_);
177
+ }
178
+
179
+ //! Assignment operator.
180
+ GenericPointer& operator=(const GenericPointer& rhs) {
181
+ if (this != &rhs) {
182
+ // Do not delete ownAllcator
183
+ if (nameBuffer_)
184
+ Allocator::Free(tokens_);
185
+
186
+ tokenCount_ = rhs.tokenCount_;
187
+ parseErrorOffset_ = rhs.parseErrorOffset_;
188
+ parseErrorCode_ = rhs.parseErrorCode_;
189
+
190
+ if (rhs.nameBuffer_)
191
+ CopyFromRaw(rhs); // Normally parsed tokens.
192
+ else {
193
+ tokens_ = rhs.tokens_; // User supplied const tokens.
194
+ nameBuffer_ = 0;
195
+ }
196
+ }
197
+ return *this;
198
+ }
199
+
200
+ //@}
201
+
202
+ //!@name Append token
203
+ //@{
204
+
205
+ //! Append a token and return a new Pointer
206
+ /*!
207
+ \param token Token to be appended.
208
+ \param allocator Allocator for the newly return Pointer.
209
+ \return A new Pointer with appended token.
210
+ */
211
+ GenericPointer Append(const Token& token, Allocator* allocator = 0) const {
212
+ GenericPointer r;
213
+ r.allocator_ = allocator;
214
+ Ch *p = r.CopyFromRaw(*this, 1, token.length + 1);
215
+ std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch));
216
+ r.tokens_[tokenCount_].name = p;
217
+ r.tokens_[tokenCount_].length = token.length;
218
+ r.tokens_[tokenCount_].index = token.index;
219
+ return r;
220
+ }
221
+
222
+ //! Append a name token with length, and return a new Pointer
223
+ /*!
224
+ \param name Name to be appended.
225
+ \param length Length of name.
226
+ \param allocator Allocator for the newly return Pointer.
227
+ \return A new Pointer with appended token.
228
+ */
229
+ GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const {
230
+ Token token = { name, length, kPointerInvalidIndex };
231
+ return Append(token, allocator);
232
+ }
233
+
234
+ //! Append a name token without length, and return a new Pointer
235
+ /*!
236
+ \param name Name (const Ch*) to be appended.
237
+ \param allocator Allocator for the newly return Pointer.
238
+ \return A new Pointer with appended token.
239
+ */
240
+ template <typename T>
241
+ RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr<internal::IsSame<typename internal::RemoveConst<T>::Type, Ch> >), (GenericPointer))
242
+ Append(T* name, Allocator* allocator = 0) const {
243
+ return Append(name, StrLen(name), allocator);
244
+ }
245
+
246
+ #if RAPIDJSON_HAS_STDSTRING
247
+ //! Append a name token, and return a new Pointer
248
+ /*!
249
+ \param name Name to be appended.
250
+ \param allocator Allocator for the newly return Pointer.
251
+ \return A new Pointer with appended token.
252
+ */
253
+ GenericPointer Append(const std::basic_string<Ch>& name, Allocator* allocator = 0) const {
254
+ return Append(name.c_str(), static_cast<SizeType>(name.size()), allocator);
255
+ }
256
+ #endif
257
+
258
+ //! Append a index token, and return a new Pointer
259
+ /*!
260
+ \param index Index to be appended.
261
+ \param allocator Allocator for the newly return Pointer.
262
+ \return A new Pointer with appended token.
263
+ */
264
+ GenericPointer Append(SizeType index, Allocator* allocator = 0) const {
265
+ char buffer[21];
266
+ char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer);
267
+ SizeType length = static_cast<SizeType>(end - buffer);
268
+ buffer[length] = '\0';
269
+
270
+ if (sizeof(Ch) == 1) {
271
+ Token token = { reinterpret_cast<Ch*>(buffer), length, index };
272
+ return Append(token, allocator);
273
+ }
274
+ else {
275
+ Ch name[21];
276
+ for (size_t i = 0; i <= length; i++)
277
+ name[i] = buffer[i];
278
+ Token token = { name, length, index };
279
+ return Append(token, allocator);
280
+ }
281
+ }
282
+
283
+ //! Append a token by value, and return a new Pointer
284
+ /*!
285
+ \param token token to be appended.
286
+ \param allocator Allocator for the newly return Pointer.
287
+ \return A new Pointer with appended token.
288
+ */
289
+ GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const {
290
+ if (token.IsString())
291
+ return Append(token.GetString(), token.GetStringLength(), allocator);
292
+ else {
293
+ RAPIDJSON_ASSERT(token.IsUint64());
294
+ RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0));
295
+ return Append(static_cast<SizeType>(token.GetUint64()), allocator);
296
+ }
297
+ }
298
+
299
+ //!@name Handling Parse Error
300
+ //@{
301
+
302
+ //! Check whether this is a valid pointer.
303
+ bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; }
304
+
305
+ //! Get the parsing error offset in code unit.
306
+ size_t GetParseErrorOffset() const { return parseErrorOffset_; }
307
+
308
+ //! Get the parsing error code.
309
+ PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; }
310
+
311
+ //@}
312
+
313
+ //! Get the allocator of this pointer.
314
+ Allocator& GetAllocator() { return *allocator_; }
315
+
316
+ //!@name Tokens
317
+ //@{
318
+
319
+ //! Get the token array (const version only).
320
+ const Token* GetTokens() const { return tokens_; }
321
+
322
+ //! Get the number of tokens.
323
+ size_t GetTokenCount() const { return tokenCount_; }
324
+
325
+ //@}
326
+
327
+ //!@name Equality/inequality operators
328
+ //@{
329
+
330
+ //! Equality operator.
331
+ /*!
332
+ \note When any pointers are invalid, always returns false.
333
+ */
334
+ bool operator==(const GenericPointer& rhs) const {
335
+ if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_)
336
+ return false;
337
+
338
+ for (size_t i = 0; i < tokenCount_; i++) {
339
+ if (tokens_[i].index != rhs.tokens_[i].index ||
340
+ tokens_[i].length != rhs.tokens_[i].length ||
341
+ (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0))
342
+ {
343
+ return false;
344
+ }
345
+ }
346
+
347
+ return true;
348
+ }
349
+
350
+ //! Inequality operator.
351
+ /*!
352
+ \note When any pointers are invalid, always returns true.
353
+ */
354
+ bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); }
355
+
356
+ //@}
357
+
358
+ //!@name Stringify
359
+ //@{
360
+
361
+ //! Stringify the pointer into string representation.
362
+ /*!
363
+ \tparam OutputStream Type of output stream.
364
+ \param os The output stream.
365
+ */
366
+ template<typename OutputStream>
367
+ bool Stringify(OutputStream& os) const {
368
+ return Stringify<false, OutputStream>(os);
369
+ }
370
+
371
+ //! Stringify the pointer into URI fragment representation.
372
+ /*!
373
+ \tparam OutputStream Type of output stream.
374
+ \param os The output stream.
375
+ */
376
+ template<typename OutputStream>
377
+ bool StringifyUriFragment(OutputStream& os) const {
378
+ return Stringify<true, OutputStream>(os);
379
+ }
380
+
381
+ //@}
382
+
383
+ //!@name Create value
384
+ //@{
385
+
386
+ //! Create a value in a subtree.
387
+ /*!
388
+ If the value is not exist, it creates all parent values and a JSON Null value.
389
+ So it always succeed and return the newly created or existing value.
390
+
391
+ Remind that it may change types of parents according to tokens, so it
392
+ potentially removes previously stored values. For example, if a document
393
+ was an array, and "/foo" is used to create a value, then the document
394
+ will be changed to an object, and all existing array elements are lost.
395
+
396
+ \param root Root value of a DOM subtree to be resolved. It can be any value other than document root.
397
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
398
+ \param alreadyExist If non-null, it stores whether the resolved value is already exist.
399
+ \return The resolved newly created (a JSON Null value), or already exists value.
400
+ */
401
+ ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const {
402
+ RAPIDJSON_ASSERT(IsValid());
403
+ ValueType* v = &root;
404
+ bool exist = true;
405
+ for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
406
+ if (v->IsArray() && t->name[0] == '-' && t->length == 1) {
407
+ v->PushBack(ValueType().Move(), allocator);
408
+ v = &((*v)[v->Size() - 1]);
409
+ exist = false;
410
+ }
411
+ else {
412
+ if (t->index == kPointerInvalidIndex) { // must be object name
413
+ if (!v->IsObject())
414
+ v->SetObject(); // Change to Object
415
+ }
416
+ else { // object name or array index
417
+ if (!v->IsArray() && !v->IsObject())
418
+ v->SetArray(); // Change to Array
419
+ }
420
+
421
+ if (v->IsArray()) {
422
+ if (t->index >= v->Size()) {
423
+ v->Reserve(t->index + 1, allocator);
424
+ while (t->index >= v->Size())
425
+ v->PushBack(ValueType().Move(), allocator);
426
+ exist = false;
427
+ }
428
+ v = &((*v)[t->index]);
429
+ }
430
+ else {
431
+ typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
432
+ if (m == v->MemberEnd()) {
433
+ v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator);
434
+ v = &(--v->MemberEnd())->value; // Assumes AddMember() appends at the end
435
+ exist = false;
436
+ }
437
+ else
438
+ v = &m->value;
439
+ }
440
+ }
441
+ }
442
+
443
+ if (alreadyExist)
444
+ *alreadyExist = exist;
445
+
446
+ return *v;
447
+ }
448
+
449
+ //! Creates a value in a document.
450
+ /*!
451
+ \param document A document to be resolved.
452
+ \param alreadyExist If non-null, it stores whether the resolved value is already exist.
453
+ \return The resolved newly created, or already exists value.
454
+ */
455
+ template <typename stackAllocator>
456
+ ValueType& Create(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, bool* alreadyExist = 0) const {
457
+ return Create(document, document.GetAllocator(), alreadyExist);
458
+ }
459
+
460
+ //@}
461
+
462
+ //!@name Query value
463
+ //@{
464
+
465
+ //! Query a value in a subtree.
466
+ /*!
467
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
468
+ \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token.
469
+ \return Pointer to the value if it can be resolved. Otherwise null.
470
+
471
+ \note
472
+ There are only 3 situations when a value cannot be resolved:
473
+ 1. A value in the path is not an array nor object.
474
+ 2. An object value does not contain the token.
475
+ 3. A token is out of range of an array value.
476
+
477
+ Use unresolvedTokenIndex to retrieve the token index.
478
+ */
479
+ ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const {
480
+ RAPIDJSON_ASSERT(IsValid());
481
+ ValueType* v = &root;
482
+ for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
483
+ switch (v->GetType()) {
484
+ case kObjectType:
485
+ {
486
+ typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
487
+ if (m == v->MemberEnd())
488
+ break;
489
+ v = &m->value;
490
+ }
491
+ continue;
492
+ case kArrayType:
493
+ if (t->index == kPointerInvalidIndex || t->index >= v->Size())
494
+ break;
495
+ v = &((*v)[t->index]);
496
+ continue;
497
+ default:
498
+ break;
499
+ }
500
+
501
+ // Error: unresolved token
502
+ if (unresolvedTokenIndex)
503
+ *unresolvedTokenIndex = static_cast<size_t>(t - tokens_);
504
+ return 0;
505
+ }
506
+ return v;
507
+ }
508
+
509
+ //! Query a const value in a const subtree.
510
+ /*!
511
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
512
+ \return Pointer to the value if it can be resolved. Otherwise null.
513
+ */
514
+ const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const {
515
+ return Get(const_cast<ValueType&>(root), unresolvedTokenIndex);
516
+ }
517
+
518
+ //@}
519
+
520
+ //!@name Query a value with default
521
+ //@{
522
+
523
+ //! Query a value in a subtree with default value.
524
+ /*!
525
+ Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value.
526
+ So that this function always succeed.
527
+
528
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
529
+ \param defaultValue Default value to be cloned if the value was not exists.
530
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
531
+ \see Create()
532
+ */
533
+ ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const {
534
+ bool alreadyExist;
535
+ Value& v = Create(root, allocator, &alreadyExist);
536
+ return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
537
+ }
538
+
539
+ //! Query a value in a subtree with default null-terminated string.
540
+ ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const {
541
+ bool alreadyExist;
542
+ Value& v = Create(root, allocator, &alreadyExist);
543
+ return alreadyExist ? v : v.SetString(defaultValue, allocator);
544
+ }
545
+
546
+ #if RAPIDJSON_HAS_STDSTRING
547
+ //! Query a value in a subtree with default std::basic_string.
548
+ ValueType& GetWithDefault(ValueType& root, const std::basic_string<Ch>& defaultValue, typename ValueType::AllocatorType& allocator) const {
549
+ bool alreadyExist;
550
+ Value& v = Create(root, allocator, &alreadyExist);
551
+ return alreadyExist ? v : v.SetString(defaultValue, allocator);
552
+ }
553
+ #endif
554
+
555
+ //! Query a value in a subtree with default primitive value.
556
+ /*!
557
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
558
+ */
559
+ template <typename T>
560
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
561
+ GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const {
562
+ return GetWithDefault(root, ValueType(defaultValue).Move(), allocator);
563
+ }
564
+
565
+ //! Query a value in a document with default value.
566
+ template <typename stackAllocator>
567
+ ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const ValueType& defaultValue) const {
568
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
569
+ }
570
+
571
+ //! Query a value in a document with default null-terminated string.
572
+ template <typename stackAllocator>
573
+ ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const Ch* defaultValue) const {
574
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
575
+ }
576
+
577
+ #if RAPIDJSON_HAS_STDSTRING
578
+ //! Query a value in a document with default std::basic_string.
579
+ template <typename stackAllocator>
580
+ ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const std::basic_string<Ch>& defaultValue) const {
581
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
582
+ }
583
+ #endif
584
+
585
+ //! Query a value in a document with default primitive value.
586
+ /*!
587
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
588
+ */
589
+ template <typename T, typename stackAllocator>
590
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
591
+ GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, T defaultValue) const {
592
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
593
+ }
594
+
595
+ //@}
596
+
597
+ //!@name Set a value
598
+ //@{
599
+
600
+ //! Set a value in a subtree, with move semantics.
601
+ /*!
602
+ It creates all parents if they are not exist or types are different to the tokens.
603
+ So this function always succeeds but potentially remove existing values.
604
+
605
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
606
+ \param value Value to be set.
607
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
608
+ \see Create()
609
+ */
610
+ ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const {
611
+ return Create(root, allocator) = value;
612
+ }
613
+
614
+ //! Set a value in a subtree, with copy semantics.
615
+ ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const {
616
+ return Create(root, allocator).CopyFrom(value, allocator);
617
+ }
618
+
619
+ //! Set a null-terminated string in a subtree.
620
+ ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const {
621
+ return Create(root, allocator) = ValueType(value, allocator).Move();
622
+ }
623
+
624
+ #if RAPIDJSON_HAS_STDSTRING
625
+ //! Set a std::basic_string in a subtree.
626
+ ValueType& Set(ValueType& root, const std::basic_string<Ch>& value, typename ValueType::AllocatorType& allocator) const {
627
+ return Create(root, allocator) = ValueType(value, allocator).Move();
628
+ }
629
+ #endif
630
+
631
+ //! Set a primitive value in a subtree.
632
+ /*!
633
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
634
+ */
635
+ template <typename T>
636
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
637
+ Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const {
638
+ return Create(root, allocator) = ValueType(value).Move();
639
+ }
640
+
641
+ //! Set a value in a document, with move semantics.
642
+ template <typename stackAllocator>
643
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, ValueType& value) const {
644
+ return Create(document) = value;
645
+ }
646
+
647
+ //! Set a value in a document, with copy semantics.
648
+ template <typename stackAllocator>
649
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const ValueType& value) const {
650
+ return Create(document).CopyFrom(value, document.GetAllocator());
651
+ }
652
+
653
+ //! Set a null-terminated string in a document.
654
+ template <typename stackAllocator>
655
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const Ch* value) const {
656
+ return Create(document) = ValueType(value, document.GetAllocator()).Move();
657
+ }
658
+
659
+ #if RAPIDJSON_HAS_STDSTRING
660
+ //! Sets a std::basic_string in a document.
661
+ template <typename stackAllocator>
662
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const std::basic_string<Ch>& value) const {
663
+ return Create(document) = ValueType(value, document.GetAllocator()).Move();
664
+ }
665
+ #endif
666
+
667
+ //! Set a primitive value in a document.
668
+ /*!
669
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
670
+ */
671
+ template <typename T, typename stackAllocator>
672
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
673
+ Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, T value) const {
674
+ return Create(document) = value;
675
+ }
676
+
677
+ //@}
678
+
679
+ //!@name Swap a value
680
+ //@{
681
+
682
+ //! Swap a value with a value in a subtree.
683
+ /*!
684
+ It creates all parents if they are not exist or types are different to the tokens.
685
+ So this function always succeeds but potentially remove existing values.
686
+
687
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
688
+ \param value Value to be swapped.
689
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
690
+ \see Create()
691
+ */
692
+ ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const {
693
+ return Create(root, allocator).Swap(value);
694
+ }
695
+
696
+ //! Swap a value with a value in a document.
697
+ template <typename stackAllocator>
698
+ ValueType& Swap(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, ValueType& value) const {
699
+ return Create(document).Swap(value);
700
+ }
701
+
702
+ //@}
703
+
704
+ //! Erase a value in a subtree.
705
+ /*!
706
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
707
+ \return Whether the resolved value is found and erased.
708
+
709
+ \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false.
710
+ */
711
+ bool Erase(ValueType& root) const {
712
+ RAPIDJSON_ASSERT(IsValid());
713
+ if (tokenCount_ == 0) // Cannot erase the root
714
+ return false;
715
+
716
+ ValueType* v = &root;
717
+ const Token* last = tokens_ + (tokenCount_ - 1);
718
+ for (const Token *t = tokens_; t != last; ++t) {
719
+ switch (v->GetType()) {
720
+ case kObjectType:
721
+ {
722
+ typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
723
+ if (m == v->MemberEnd())
724
+ return false;
725
+ v = &m->value;
726
+ }
727
+ break;
728
+ case kArrayType:
729
+ if (t->index == kPointerInvalidIndex || t->index >= v->Size())
730
+ return false;
731
+ v = &((*v)[t->index]);
732
+ break;
733
+ default:
734
+ return false;
735
+ }
736
+ }
737
+
738
+ switch (v->GetType()) {
739
+ case kObjectType:
740
+ return v->EraseMember(GenericStringRef<Ch>(last->name, last->length));
741
+ case kArrayType:
742
+ if (last->index == kPointerInvalidIndex || last->index >= v->Size())
743
+ return false;
744
+ v->Erase(v->Begin() + last->index);
745
+ return true;
746
+ default:
747
+ return false;
748
+ }
749
+ }
750
+
751
+ private:
752
+ //! Clone the content from rhs to this.
753
+ /*!
754
+ \param rhs Source pointer.
755
+ \param extraToken Extra tokens to be allocated.
756
+ \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated.
757
+ \return Start of non-occupied name buffer, for storing extra names.
758
+ */
759
+ Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) {
760
+ if (!allocator_) // allocator is independently owned.
761
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
762
+
763
+ size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens
764
+ for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t)
765
+ nameBufferSize += t->length;
766
+
767
+ tokenCount_ = rhs.tokenCount_ + extraToken;
768
+ tokens_ = static_cast<Token *>(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch)));
769
+ nameBuffer_ = reinterpret_cast<Ch *>(tokens_ + tokenCount_);
770
+ if (rhs.tokenCount_ > 0) {
771
+ std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token));
772
+ }
773
+ if (nameBufferSize > 0) {
774
+ std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch));
775
+ }
776
+
777
+ // Adjust pointers to name buffer
778
+ std::ptrdiff_t diff = nameBuffer_ - rhs.nameBuffer_;
779
+ for (Token *t = tokens_; t != tokens_ + rhs.tokenCount_; ++t)
780
+ t->name += diff;
781
+
782
+ return nameBuffer_ + nameBufferSize;
783
+ }
784
+
785
+ //! Check whether a character should be percent-encoded.
786
+ /*!
787
+ According to RFC 3986 2.3 Unreserved Characters.
788
+ \param c The character (code unit) to be tested.
789
+ */
790
+ bool NeedPercentEncode(Ch c) const {
791
+ return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~');
792
+ }
793
+
794
+ //! Parse a JSON String or its URI fragment representation into tokens.
795
+ #ifndef __clang__ // -Wdocumentation
796
+ /*!
797
+ \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated.
798
+ \param length Length of the source string.
799
+ \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped.
800
+ */
801
+ #endif
802
+ void Parse(const Ch* source, size_t length) {
803
+ RAPIDJSON_ASSERT(source != NULL);
804
+ RAPIDJSON_ASSERT(nameBuffer_ == 0);
805
+ RAPIDJSON_ASSERT(tokens_ == 0);
806
+
807
+ // Create own allocator if user did not supply.
808
+ if (!allocator_)
809
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
810
+
811
+ // Count number of '/' as tokenCount
812
+ tokenCount_ = 0;
813
+ for (const Ch* s = source; s != source + length; s++)
814
+ if (*s == '/')
815
+ tokenCount_++;
816
+
817
+ Token* token = tokens_ = static_cast<Token *>(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch)));
818
+ Ch* name = nameBuffer_ = reinterpret_cast<Ch *>(tokens_ + tokenCount_);
819
+ size_t i = 0;
820
+
821
+ // Detect if it is a URI fragment
822
+ bool uriFragment = false;
823
+ if (source[i] == '#') {
824
+ uriFragment = true;
825
+ i++;
826
+ }
827
+
828
+ if (i != length && source[i] != '/') {
829
+ parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus;
830
+ goto error;
831
+ }
832
+
833
+ while (i < length) {
834
+ RAPIDJSON_ASSERT(source[i] == '/');
835
+ i++; // consumes '/'
836
+
837
+ token->name = name;
838
+ bool isNumber = true;
839
+
840
+ while (i < length && source[i] != '/') {
841
+ Ch c = source[i];
842
+ if (uriFragment) {
843
+ // Decoding percent-encoding for URI fragment
844
+ if (c == '%') {
845
+ PercentDecodeStream is(&source[i], source + length);
846
+ GenericInsituStringStream<EncodingType> os(name);
847
+ Ch* begin = os.PutBegin();
848
+ if (!Transcoder<UTF8<>, EncodingType>().Validate(is, os) || !is.IsValid()) {
849
+ parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding;
850
+ goto error;
851
+ }
852
+ size_t len = os.PutEnd(begin);
853
+ i += is.Tell() - 1;
854
+ if (len == 1)
855
+ c = *name;
856
+ else {
857
+ name += len;
858
+ isNumber = false;
859
+ i++;
860
+ continue;
861
+ }
862
+ }
863
+ else if (NeedPercentEncode(c)) {
864
+ parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode;
865
+ goto error;
866
+ }
867
+ }
868
+
869
+ i++;
870
+
871
+ // Escaping "~0" -> '~', "~1" -> '/'
872
+ if (c == '~') {
873
+ if (i < length) {
874
+ c = source[i];
875
+ if (c == '0') c = '~';
876
+ else if (c == '1') c = '/';
877
+ else {
878
+ parseErrorCode_ = kPointerParseErrorInvalidEscape;
879
+ goto error;
880
+ }
881
+ i++;
882
+ }
883
+ else {
884
+ parseErrorCode_ = kPointerParseErrorInvalidEscape;
885
+ goto error;
886
+ }
887
+ }
888
+
889
+ // First check for index: all of characters are digit
890
+ if (c < '0' || c > '9')
891
+ isNumber = false;
892
+
893
+ *name++ = c;
894
+ }
895
+ token->length = static_cast<SizeType>(name - token->name);
896
+ if (token->length == 0)
897
+ isNumber = false;
898
+ *name++ = '\0'; // Null terminator
899
+
900
+ // Second check for index: more than one digit cannot have leading zero
901
+ if (isNumber && token->length > 1 && token->name[0] == '0')
902
+ isNumber = false;
903
+
904
+ // String to SizeType conversion
905
+ SizeType n = 0;
906
+ if (isNumber) {
907
+ for (size_t j = 0; j < token->length; j++) {
908
+ SizeType m = n * 10 + static_cast<SizeType>(token->name[j] - '0');
909
+ if (m < n) { // overflow detection
910
+ isNumber = false;
911
+ break;
912
+ }
913
+ n = m;
914
+ }
915
+ }
916
+
917
+ token->index = isNumber ? n : kPointerInvalidIndex;
918
+ token++;
919
+ }
920
+
921
+ RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer
922
+ parseErrorCode_ = kPointerParseErrorNone;
923
+ return;
924
+
925
+ error:
926
+ Allocator::Free(tokens_);
927
+ nameBuffer_ = 0;
928
+ tokens_ = 0;
929
+ tokenCount_ = 0;
930
+ parseErrorOffset_ = i;
931
+ return;
932
+ }
933
+
934
+ //! Stringify to string or URI fragment representation.
935
+ /*!
936
+ \tparam uriFragment True for stringifying to URI fragment representation. False for string representation.
937
+ \tparam OutputStream type of output stream.
938
+ \param os The output stream.
939
+ */
940
+ template<bool uriFragment, typename OutputStream>
941
+ bool Stringify(OutputStream& os) const {
942
+ RAPIDJSON_ASSERT(IsValid());
943
+
944
+ if (uriFragment)
945
+ os.Put('#');
946
+
947
+ for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
948
+ os.Put('/');
949
+ for (size_t j = 0; j < t->length; j++) {
950
+ Ch c = t->name[j];
951
+ if (c == '~') {
952
+ os.Put('~');
953
+ os.Put('0');
954
+ }
955
+ else if (c == '/') {
956
+ os.Put('~');
957
+ os.Put('1');
958
+ }
959
+ else if (uriFragment && NeedPercentEncode(c)) {
960
+ // Transcode to UTF8 sequence
961
+ GenericStringStream<typename ValueType::EncodingType> source(&t->name[j]);
962
+ PercentEncodeStream<OutputStream> target(os);
963
+ if (!Transcoder<EncodingType, UTF8<> >().Validate(source, target))
964
+ return false;
965
+ j += source.Tell() - 1;
966
+ }
967
+ else
968
+ os.Put(c);
969
+ }
970
+ }
971
+ return true;
972
+ }
973
+
974
+ //! A helper stream for decoding a percent-encoded sequence into code unit.
975
+ /*!
976
+ This stream decodes %XY triplet into code unit (0-255).
977
+ If it encounters invalid characters, it sets output code unit as 0 and
978
+ mark invalid, and to be checked by IsValid().
979
+ */
980
+ class PercentDecodeStream {
981
+ public:
982
+ typedef typename ValueType::Ch Ch;
983
+
984
+ //! Constructor
985
+ /*!
986
+ \param source Start of the stream
987
+ \param end Past-the-end of the stream.
988
+ */
989
+ PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {}
990
+
991
+ Ch Take() {
992
+ if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet
993
+ valid_ = false;
994
+ return 0;
995
+ }
996
+ src_++;
997
+ Ch c = 0;
998
+ for (int j = 0; j < 2; j++) {
999
+ c = static_cast<Ch>(c << 4);
1000
+ Ch h = *src_;
1001
+ if (h >= '0' && h <= '9') c = static_cast<Ch>(c + h - '0');
1002
+ else if (h >= 'A' && h <= 'F') c = static_cast<Ch>(c + h - 'A' + 10);
1003
+ else if (h >= 'a' && h <= 'f') c = static_cast<Ch>(c + h - 'a' + 10);
1004
+ else {
1005
+ valid_ = false;
1006
+ return 0;
1007
+ }
1008
+ src_++;
1009
+ }
1010
+ return c;
1011
+ }
1012
+
1013
+ size_t Tell() const { return static_cast<size_t>(src_ - head_); }
1014
+ bool IsValid() const { return valid_; }
1015
+
1016
+ private:
1017
+ const Ch* src_; //!< Current read position.
1018
+ const Ch* head_; //!< Original head of the string.
1019
+ const Ch* end_; //!< Past-the-end position.
1020
+ bool valid_; //!< Whether the parsing is valid.
1021
+ };
1022
+
1023
+ //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence.
1024
+ template <typename OutputStream>
1025
+ class PercentEncodeStream {
1026
+ public:
1027
+ PercentEncodeStream(OutputStream& os) : os_(os) {}
1028
+ void Put(char c) { // UTF-8 must be byte
1029
+ unsigned char u = static_cast<unsigned char>(c);
1030
+ static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
1031
+ os_.Put('%');
1032
+ os_.Put(hexDigits[u >> 4]);
1033
+ os_.Put(hexDigits[u & 15]);
1034
+ }
1035
+ private:
1036
+ OutputStream& os_;
1037
+ };
1038
+
1039
+ Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_.
1040
+ Allocator* ownAllocator_; //!< Allocator owned by this Pointer.
1041
+ Ch* nameBuffer_; //!< A buffer containing all names in tokens.
1042
+ Token* tokens_; //!< A list of tokens.
1043
+ size_t tokenCount_; //!< Number of tokens in tokens_.
1044
+ size_t parseErrorOffset_; //!< Offset in code unit when parsing fail.
1045
+ PointerParseErrorCode parseErrorCode_; //!< Parsing error code.
1046
+ };
1047
+
1048
+ //! GenericPointer for Value (UTF-8, default allocator).
1049
+ typedef GenericPointer<Value> Pointer;
1050
+
1051
+ //!@name Helper functions for GenericPointer
1052
+ //@{
1053
+
1054
+ //////////////////////////////////////////////////////////////////////////////
1055
+
1056
+ template <typename T>
1057
+ typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::AllocatorType& a) {
1058
+ return pointer.Create(root, a);
1059
+ }
1060
+
1061
+ template <typename T, typename CharType, size_t N>
1062
+ typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) {
1063
+ return GenericPointer<typename T::ValueType>(source, N - 1).Create(root, a);
1064
+ }
1065
+
1066
+ // No allocator parameter
1067
+
1068
+ template <typename DocumentType>
1069
+ typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer) {
1070
+ return pointer.Create(document);
1071
+ }
1072
+
1073
+ template <typename DocumentType, typename CharType, size_t N>
1074
+ typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) {
1075
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Create(document);
1076
+ }
1077
+
1078
+ //////////////////////////////////////////////////////////////////////////////
1079
+
1080
+ template <typename T>
1081
+ typename T::ValueType* GetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, size_t* unresolvedTokenIndex = 0) {
1082
+ return pointer.Get(root, unresolvedTokenIndex);
1083
+ }
1084
+
1085
+ template <typename T>
1086
+ const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer<typename T::ValueType>& pointer, size_t* unresolvedTokenIndex = 0) {
1087
+ return pointer.Get(root, unresolvedTokenIndex);
1088
+ }
1089
+
1090
+ template <typename T, typename CharType, size_t N>
1091
+ typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) {
1092
+ return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
1093
+ }
1094
+
1095
+ template <typename T, typename CharType, size_t N>
1096
+ const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) {
1097
+ return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
1098
+ }
1099
+
1100
+ //////////////////////////////////////////////////////////////////////////////
1101
+
1102
+ template <typename T>
1103
+ typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) {
1104
+ return pointer.GetWithDefault(root, defaultValue, a);
1105
+ }
1106
+
1107
+ template <typename T>
1108
+ typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) {
1109
+ return pointer.GetWithDefault(root, defaultValue, a);
1110
+ }
1111
+
1112
+ #if RAPIDJSON_HAS_STDSTRING
1113
+ template <typename T>
1114
+ typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const std::basic_string<typename T::Ch>& defaultValue, typename T::AllocatorType& a) {
1115
+ return pointer.GetWithDefault(root, defaultValue, a);
1116
+ }
1117
+ #endif
1118
+
1119
+ template <typename T, typename T2>
1120
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
1121
+ GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, T2 defaultValue, typename T::AllocatorType& a) {
1122
+ return pointer.GetWithDefault(root, defaultValue, a);
1123
+ }
1124
+
1125
+ template <typename T, typename CharType, size_t N>
1126
+ typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) {
1127
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
1128
+ }
1129
+
1130
+ template <typename T, typename CharType, size_t N>
1131
+ typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) {
1132
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
1133
+ }
1134
+
1135
+ #if RAPIDJSON_HAS_STDSTRING
1136
+ template <typename T, typename CharType, size_t N>
1137
+ typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string<typename T::Ch>& defaultValue, typename T::AllocatorType& a) {
1138
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
1139
+ }
1140
+ #endif
1141
+
1142
+ template <typename T, typename CharType, size_t N, typename T2>
1143
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
1144
+ GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) {
1145
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
1146
+ }
1147
+
1148
+ // No allocator parameter
1149
+
1150
+ template <typename DocumentType>
1151
+ typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::ValueType& defaultValue) {
1152
+ return pointer.GetWithDefault(document, defaultValue);
1153
+ }
1154
+
1155
+ template <typename DocumentType>
1156
+ typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::Ch* defaultValue) {
1157
+ return pointer.GetWithDefault(document, defaultValue);
1158
+ }
1159
+
1160
+ #if RAPIDJSON_HAS_STDSTRING
1161
+ template <typename DocumentType>
1162
+ typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const std::basic_string<typename DocumentType::Ch>& defaultValue) {
1163
+ return pointer.GetWithDefault(document, defaultValue);
1164
+ }
1165
+ #endif
1166
+
1167
+ template <typename DocumentType, typename T2>
1168
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
1169
+ GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, T2 defaultValue) {
1170
+ return pointer.GetWithDefault(document, defaultValue);
1171
+ }
1172
+
1173
+ template <typename DocumentType, typename CharType, size_t N>
1174
+ typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) {
1175
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
1176
+ }
1177
+
1178
+ template <typename DocumentType, typename CharType, size_t N>
1179
+ typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) {
1180
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
1181
+ }
1182
+
1183
+ #if RAPIDJSON_HAS_STDSTRING
1184
+ template <typename DocumentType, typename CharType, size_t N>
1185
+ typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string<typename DocumentType::Ch>& defaultValue) {
1186
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
1187
+ }
1188
+ #endif
1189
+
1190
+ template <typename DocumentType, typename CharType, size_t N, typename T2>
1191
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
1192
+ GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) {
1193
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
1194
+ }
1195
+
1196
+ //////////////////////////////////////////////////////////////////////////////
1197
+
1198
+ template <typename T>
1199
+ typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::ValueType& value, typename T::AllocatorType& a) {
1200
+ return pointer.Set(root, value, a);
1201
+ }
1202
+
1203
+ template <typename T>
1204
+ typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) {
1205
+ return pointer.Set(root, value, a);
1206
+ }
1207
+
1208
+ template <typename T>
1209
+ typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::Ch* value, typename T::AllocatorType& a) {
1210
+ return pointer.Set(root, value, a);
1211
+ }
1212
+
1213
+ #if RAPIDJSON_HAS_STDSTRING
1214
+ template <typename T>
1215
+ typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const std::basic_string<typename T::Ch>& value, typename T::AllocatorType& a) {
1216
+ return pointer.Set(root, value, a);
1217
+ }
1218
+ #endif
1219
+
1220
+ template <typename T, typename T2>
1221
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
1222
+ SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, T2 value, typename T::AllocatorType& a) {
1223
+ return pointer.Set(root, value, a);
1224
+ }
1225
+
1226
+ template <typename T, typename CharType, size_t N>
1227
+ typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) {
1228
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1229
+ }
1230
+
1231
+ template <typename T, typename CharType, size_t N>
1232
+ typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) {
1233
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1234
+ }
1235
+
1236
+ template <typename T, typename CharType, size_t N>
1237
+ typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) {
1238
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1239
+ }
1240
+
1241
+ #if RAPIDJSON_HAS_STDSTRING
1242
+ template <typename T, typename CharType, size_t N>
1243
+ typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string<typename T::Ch>& value, typename T::AllocatorType& a) {
1244
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1245
+ }
1246
+ #endif
1247
+
1248
+ template <typename T, typename CharType, size_t N, typename T2>
1249
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
1250
+ SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) {
1251
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1252
+ }
1253
+
1254
+ // No allocator parameter
1255
+
1256
+ template <typename DocumentType>
1257
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, typename DocumentType::ValueType& value) {
1258
+ return pointer.Set(document, value);
1259
+ }
1260
+
1261
+ template <typename DocumentType>
1262
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::ValueType& value) {
1263
+ return pointer.Set(document, value);
1264
+ }
1265
+
1266
+ template <typename DocumentType>
1267
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::Ch* value) {
1268
+ return pointer.Set(document, value);
1269
+ }
1270
+
1271
+ #if RAPIDJSON_HAS_STDSTRING
1272
+ template <typename DocumentType>
1273
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const std::basic_string<typename DocumentType::Ch>& value) {
1274
+ return pointer.Set(document, value);
1275
+ }
1276
+ #endif
1277
+
1278
+ template <typename DocumentType, typename T2>
1279
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
1280
+ SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, T2 value) {
1281
+ return pointer.Set(document, value);
1282
+ }
1283
+
1284
+ template <typename DocumentType, typename CharType, size_t N>
1285
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) {
1286
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
1287
+ }
1288
+
1289
+ template <typename DocumentType, typename CharType, size_t N>
1290
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) {
1291
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
1292
+ }
1293
+
1294
+ template <typename DocumentType, typename CharType, size_t N>
1295
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) {
1296
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
1297
+ }
1298
+
1299
+ #if RAPIDJSON_HAS_STDSTRING
1300
+ template <typename DocumentType, typename CharType, size_t N>
1301
+ typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string<typename DocumentType::Ch>& value) {
1302
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
1303
+ }
1304
+ #endif
1305
+
1306
+ template <typename DocumentType, typename CharType, size_t N, typename T2>
1307
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
1308
+ SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) {
1309
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
1310
+ }
1311
+
1312
+ //////////////////////////////////////////////////////////////////////////////
1313
+
1314
+ template <typename T>
1315
+ typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::ValueType& value, typename T::AllocatorType& a) {
1316
+ return pointer.Swap(root, value, a);
1317
+ }
1318
+
1319
+ template <typename T, typename CharType, size_t N>
1320
+ typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) {
1321
+ return GenericPointer<typename T::ValueType>(source, N - 1).Swap(root, value, a);
1322
+ }
1323
+
1324
+ template <typename DocumentType>
1325
+ typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, typename DocumentType::ValueType& value) {
1326
+ return pointer.Swap(document, value);
1327
+ }
1328
+
1329
+ template <typename DocumentType, typename CharType, size_t N>
1330
+ typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) {
1331
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Swap(document, value);
1332
+ }
1333
+
1334
+ //////////////////////////////////////////////////////////////////////////////
1335
+
1336
+ template <typename T>
1337
+ bool EraseValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer) {
1338
+ return pointer.Erase(root);
1339
+ }
1340
+
1341
+ template <typename T, typename CharType, size_t N>
1342
+ bool EraseValueByPointer(T& root, const CharType(&source)[N]) {
1343
+ return GenericPointer<typename T::ValueType>(source, N - 1).Erase(root);
1344
+ }
1345
+
1346
+ //@}
1347
+
1348
+ RAPIDJSON_NAMESPACE_END
1349
+
1350
+ #ifdef __clang__
1351
+ RAPIDJSON_DIAG_POP
1352
+ #endif
1353
+
1354
+ #ifdef _MSC_VER
1355
+ RAPIDJSON_DIAG_POP
1356
+ #endif
1357
+
1358
+ #endif // RAPIDJSON_POINTER_H_