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,299 @@
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_ENCODEDSTREAM_H_
16
+ #define RAPIDJSON_ENCODEDSTREAM_H_
17
+
18
+ #include "stream.h"
19
+ #include "memorystream.h"
20
+
21
+ #ifdef __GNUC__
22
+ RAPIDJSON_DIAG_PUSH
23
+ RAPIDJSON_DIAG_OFF(effc++)
24
+ #endif
25
+
26
+ #ifdef __clang__
27
+ RAPIDJSON_DIAG_PUSH
28
+ RAPIDJSON_DIAG_OFF(padded)
29
+ #endif
30
+
31
+ RAPIDJSON_NAMESPACE_BEGIN
32
+
33
+ //! Input byte stream wrapper with a statically bound encoding.
34
+ /*!
35
+ \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.
36
+ \tparam InputByteStream Type of input byte stream. For example, FileReadStream.
37
+ */
38
+ template <typename Encoding, typename InputByteStream>
39
+ class EncodedInputStream {
40
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
41
+ public:
42
+ typedef typename Encoding::Ch Ch;
43
+
44
+ EncodedInputStream(InputByteStream& is) : is_(is) {
45
+ current_ = Encoding::TakeBOM(is_);
46
+ }
47
+
48
+ Ch Peek() const { return current_; }
49
+ Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; }
50
+ size_t Tell() const { return is_.Tell(); }
51
+
52
+ // Not implemented
53
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
54
+ void Flush() { RAPIDJSON_ASSERT(false); }
55
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
56
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
57
+
58
+ private:
59
+ EncodedInputStream(const EncodedInputStream&);
60
+ EncodedInputStream& operator=(const EncodedInputStream&);
61
+
62
+ InputByteStream& is_;
63
+ Ch current_;
64
+ };
65
+
66
+ //! Specialized for UTF8 MemoryStream.
67
+ template <>
68
+ class EncodedInputStream<UTF8<>, MemoryStream> {
69
+ public:
70
+ typedef UTF8<>::Ch Ch;
71
+
72
+ EncodedInputStream(MemoryStream& is) : is_(is) {
73
+ if (static_cast<unsigned char>(is_.Peek()) == 0xEFu) is_.Take();
74
+ if (static_cast<unsigned char>(is_.Peek()) == 0xBBu) is_.Take();
75
+ if (static_cast<unsigned char>(is_.Peek()) == 0xBFu) is_.Take();
76
+ }
77
+ Ch Peek() const { return is_.Peek(); }
78
+ Ch Take() { return is_.Take(); }
79
+ size_t Tell() const { return is_.Tell(); }
80
+
81
+ // Not implemented
82
+ void Put(Ch) {}
83
+ void Flush() {}
84
+ Ch* PutBegin() { return 0; }
85
+ size_t PutEnd(Ch*) { return 0; }
86
+
87
+ MemoryStream& is_;
88
+
89
+ private:
90
+ EncodedInputStream(const EncodedInputStream&);
91
+ EncodedInputStream& operator=(const EncodedInputStream&);
92
+ };
93
+
94
+ //! Output byte stream wrapper with statically bound encoding.
95
+ /*!
96
+ \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.
97
+ \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream.
98
+ */
99
+ template <typename Encoding, typename OutputByteStream>
100
+ class EncodedOutputStream {
101
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
102
+ public:
103
+ typedef typename Encoding::Ch Ch;
104
+
105
+ EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) {
106
+ if (putBOM)
107
+ Encoding::PutBOM(os_);
108
+ }
109
+
110
+ void Put(Ch c) { Encoding::Put(os_, c); }
111
+ void Flush() { os_.Flush(); }
112
+
113
+ // Not implemented
114
+ Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;}
115
+ Ch Take() { RAPIDJSON_ASSERT(false); return 0;}
116
+ size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
117
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
118
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
119
+
120
+ private:
121
+ EncodedOutputStream(const EncodedOutputStream&);
122
+ EncodedOutputStream& operator=(const EncodedOutputStream&);
123
+
124
+ OutputByteStream& os_;
125
+ };
126
+
127
+ #define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x
128
+
129
+ //! Input stream wrapper with dynamically bound encoding and automatic encoding detection.
130
+ /*!
131
+ \tparam CharType Type of character for reading.
132
+ \tparam InputByteStream type of input byte stream to be wrapped.
133
+ */
134
+ template <typename CharType, typename InputByteStream>
135
+ class AutoUTFInputStream {
136
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
137
+ public:
138
+ typedef CharType Ch;
139
+
140
+ //! Constructor.
141
+ /*!
142
+ \param is input stream to be wrapped.
143
+ \param type UTF encoding type if it is not detected from the stream.
144
+ */
145
+ AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) {
146
+ RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE);
147
+ DetectType();
148
+ static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) };
149
+ takeFunc_ = f[type_];
150
+ current_ = takeFunc_(*is_);
151
+ }
152
+
153
+ UTFType GetType() const { return type_; }
154
+ bool HasBOM() const { return hasBOM_; }
155
+
156
+ Ch Peek() const { return current_; }
157
+ Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; }
158
+ size_t Tell() const { return is_->Tell(); }
159
+
160
+ // Not implemented
161
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
162
+ void Flush() { RAPIDJSON_ASSERT(false); }
163
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
164
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
165
+
166
+ private:
167
+ AutoUTFInputStream(const AutoUTFInputStream&);
168
+ AutoUTFInputStream& operator=(const AutoUTFInputStream&);
169
+
170
+ // Detect encoding type with BOM or RFC 4627
171
+ void DetectType() {
172
+ // BOM (Byte Order Mark):
173
+ // 00 00 FE FF UTF-32BE
174
+ // FF FE 00 00 UTF-32LE
175
+ // FE FF UTF-16BE
176
+ // FF FE UTF-16LE
177
+ // EF BB BF UTF-8
178
+
179
+ const unsigned char* c = reinterpret_cast<const unsigned char *>(is_->Peek4());
180
+ if (!c)
181
+ return;
182
+
183
+ unsigned bom = static_cast<unsigned>(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24));
184
+ hasBOM_ = false;
185
+ if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }
186
+ else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }
187
+ else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); }
188
+ else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); }
189
+ else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); }
190
+
191
+ // RFC 4627: Section 3
192
+ // "Since the first two characters of a JSON text will always be ASCII
193
+ // characters [RFC0020], it is possible to determine whether an octet
194
+ // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking
195
+ // at the pattern of nulls in the first four octets."
196
+ // 00 00 00 xx UTF-32BE
197
+ // 00 xx 00 xx UTF-16BE
198
+ // xx 00 00 00 UTF-32LE
199
+ // xx 00 xx 00 UTF-16LE
200
+ // xx xx xx xx UTF-8
201
+
202
+ if (!hasBOM_) {
203
+ unsigned pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0);
204
+ switch (pattern) {
205
+ case 0x08: type_ = kUTF32BE; break;
206
+ case 0x0A: type_ = kUTF16BE; break;
207
+ case 0x01: type_ = kUTF32LE; break;
208
+ case 0x05: type_ = kUTF16LE; break;
209
+ case 0x0F: type_ = kUTF8; break;
210
+ default: break; // Use type defined by user.
211
+ }
212
+ }
213
+
214
+ // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
215
+ if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
216
+ if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
217
+ }
218
+
219
+ typedef Ch (*TakeFunc)(InputByteStream& is);
220
+ InputByteStream* is_;
221
+ UTFType type_;
222
+ Ch current_;
223
+ TakeFunc takeFunc_;
224
+ bool hasBOM_;
225
+ };
226
+
227
+ //! Output stream wrapper with dynamically bound encoding and automatic encoding detection.
228
+ /*!
229
+ \tparam CharType Type of character for writing.
230
+ \tparam OutputByteStream type of output byte stream to be wrapped.
231
+ */
232
+ template <typename CharType, typename OutputByteStream>
233
+ class AutoUTFOutputStream {
234
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
235
+ public:
236
+ typedef CharType Ch;
237
+
238
+ //! Constructor.
239
+ /*!
240
+ \param os output stream to be wrapped.
241
+ \param type UTF encoding type.
242
+ \param putBOM Whether to write BOM at the beginning of the stream.
243
+ */
244
+ AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) {
245
+ RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE);
246
+
247
+ // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
248
+ if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
249
+ if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
250
+
251
+ static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) };
252
+ putFunc_ = f[type_];
253
+
254
+ if (putBOM)
255
+ PutBOM();
256
+ }
257
+
258
+ UTFType GetType() const { return type_; }
259
+
260
+ void Put(Ch c) { putFunc_(*os_, c); }
261
+ void Flush() { os_->Flush(); }
262
+
263
+ // Not implemented
264
+ Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;}
265
+ Ch Take() { RAPIDJSON_ASSERT(false); return 0;}
266
+ size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
267
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
268
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
269
+
270
+ private:
271
+ AutoUTFOutputStream(const AutoUTFOutputStream&);
272
+ AutoUTFOutputStream& operator=(const AutoUTFOutputStream&);
273
+
274
+ void PutBOM() {
275
+ typedef void (*PutBOMFunc)(OutputByteStream&);
276
+ static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) };
277
+ f[type_](*os_);
278
+ }
279
+
280
+ typedef void (*PutFunc)(OutputByteStream&, Ch);
281
+
282
+ OutputByteStream* os_;
283
+ UTFType type_;
284
+ PutFunc putFunc_;
285
+ };
286
+
287
+ #undef RAPIDJSON_ENCODINGS_FUNC
288
+
289
+ RAPIDJSON_NAMESPACE_END
290
+
291
+ #ifdef __clang__
292
+ RAPIDJSON_DIAG_POP
293
+ #endif
294
+
295
+ #ifdef __GNUC__
296
+ RAPIDJSON_DIAG_POP
297
+ #endif
298
+
299
+ #endif // RAPIDJSON_FILESTREAM_H_
@@ -0,0 +1,716 @@
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_ENCODINGS_H_
16
+ #define RAPIDJSON_ENCODINGS_H_
17
+
18
+ #include "rapidjson.h"
19
+
20
+ #ifdef _MSC_VER
21
+ RAPIDJSON_DIAG_PUSH
22
+ RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data
23
+ RAPIDJSON_DIAG_OFF(4702) // unreachable code
24
+ #elif defined(__GNUC__)
25
+ RAPIDJSON_DIAG_PUSH
26
+ RAPIDJSON_DIAG_OFF(effc++)
27
+ RAPIDJSON_DIAG_OFF(overflow)
28
+ #endif
29
+
30
+ RAPIDJSON_NAMESPACE_BEGIN
31
+
32
+ ///////////////////////////////////////////////////////////////////////////////
33
+ // Encoding
34
+
35
+ /*! \class rapidjson::Encoding
36
+ \brief Concept for encoding of Unicode characters.
37
+
38
+ \code
39
+ concept Encoding {
40
+ typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition.
41
+
42
+ enum { supportUnicode = 1 }; // or 0 if not supporting unicode
43
+
44
+ //! \brief Encode a Unicode codepoint to an output stream.
45
+ //! \param os Output stream.
46
+ //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively.
47
+ template<typename OutputStream>
48
+ static void Encode(OutputStream& os, unsigned codepoint);
49
+
50
+ //! \brief Decode a Unicode codepoint from an input stream.
51
+ //! \param is Input stream.
52
+ //! \param codepoint Output of the unicode codepoint.
53
+ //! \return true if a valid codepoint can be decoded from the stream.
54
+ template <typename InputStream>
55
+ static bool Decode(InputStream& is, unsigned* codepoint);
56
+
57
+ //! \brief Validate one Unicode codepoint from an encoded stream.
58
+ //! \param is Input stream to obtain codepoint.
59
+ //! \param os Output for copying one codepoint.
60
+ //! \return true if it is valid.
61
+ //! \note This function just validating and copying the codepoint without actually decode it.
62
+ template <typename InputStream, typename OutputStream>
63
+ static bool Validate(InputStream& is, OutputStream& os);
64
+
65
+ // The following functions are deal with byte streams.
66
+
67
+ //! Take a character from input byte stream, skip BOM if exist.
68
+ template <typename InputByteStream>
69
+ static CharType TakeBOM(InputByteStream& is);
70
+
71
+ //! Take a character from input byte stream.
72
+ template <typename InputByteStream>
73
+ static Ch Take(InputByteStream& is);
74
+
75
+ //! Put BOM to output byte stream.
76
+ template <typename OutputByteStream>
77
+ static void PutBOM(OutputByteStream& os);
78
+
79
+ //! Put a character to output byte stream.
80
+ template <typename OutputByteStream>
81
+ static void Put(OutputByteStream& os, Ch c);
82
+ };
83
+ \endcode
84
+ */
85
+
86
+ ///////////////////////////////////////////////////////////////////////////////
87
+ // UTF8
88
+
89
+ //! UTF-8 encoding.
90
+ /*! http://en.wikipedia.org/wiki/UTF-8
91
+ http://tools.ietf.org/html/rfc3629
92
+ \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char.
93
+ \note implements Encoding concept
94
+ */
95
+ template<typename CharType = char>
96
+ struct UTF8 {
97
+ typedef CharType Ch;
98
+
99
+ enum { supportUnicode = 1 };
100
+
101
+ template<typename OutputStream>
102
+ static void Encode(OutputStream& os, unsigned codepoint) {
103
+ if (codepoint <= 0x7F)
104
+ os.Put(static_cast<Ch>(codepoint & 0xFF));
105
+ else if (codepoint <= 0x7FF) {
106
+ os.Put(static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF)));
107
+ os.Put(static_cast<Ch>(0x80 | ((codepoint & 0x3F))));
108
+ }
109
+ else if (codepoint <= 0xFFFF) {
110
+ os.Put(static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF)));
111
+ os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
112
+ os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));
113
+ }
114
+ else {
115
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
116
+ os.Put(static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF)));
117
+ os.Put(static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F)));
118
+ os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
119
+ os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));
120
+ }
121
+ }
122
+
123
+ template<typename OutputStream>
124
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
125
+ if (codepoint <= 0x7F)
126
+ PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF));
127
+ else if (codepoint <= 0x7FF) {
128
+ PutUnsafe(os, static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF)));
129
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint & 0x3F))));
130
+ }
131
+ else if (codepoint <= 0xFFFF) {
132
+ PutUnsafe(os, static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF)));
133
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
134
+ PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F)));
135
+ }
136
+ else {
137
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
138
+ PutUnsafe(os, static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF)));
139
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F)));
140
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
141
+ PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F)));
142
+ }
143
+ }
144
+
145
+ template <typename InputStream>
146
+ static bool Decode(InputStream& is, unsigned* codepoint) {
147
+ #define COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast<unsigned char>(c) & 0x3Fu)
148
+ #define TRANS(mask) result &= ((GetRange(static_cast<unsigned char>(c)) & mask) != 0)
149
+ #define TAIL() COPY(); TRANS(0x70)
150
+ typename InputStream::Ch c = is.Take();
151
+ if (!(c & 0x80)) {
152
+ *codepoint = static_cast<unsigned char>(c);
153
+ return true;
154
+ }
155
+
156
+ unsigned char type = GetRange(static_cast<unsigned char>(c));
157
+ if (type >= 32) {
158
+ *codepoint = 0;
159
+ } else {
160
+ *codepoint = (0xFF >> type) & static_cast<unsigned char>(c);
161
+ }
162
+ bool result = true;
163
+ switch (type) {
164
+ case 2: TAIL(); return result;
165
+ case 3: TAIL(); TAIL(); return result;
166
+ case 4: COPY(); TRANS(0x50); TAIL(); return result;
167
+ case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result;
168
+ case 6: TAIL(); TAIL(); TAIL(); return result;
169
+ case 10: COPY(); TRANS(0x20); TAIL(); return result;
170
+ case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result;
171
+ default: return false;
172
+ }
173
+ #undef COPY
174
+ #undef TRANS
175
+ #undef TAIL
176
+ }
177
+
178
+ template <typename InputStream, typename OutputStream>
179
+ static bool Validate(InputStream& is, OutputStream& os) {
180
+ #define COPY() os.Put(c = is.Take())
181
+ #define TRANS(mask) result &= ((GetRange(static_cast<unsigned char>(c)) & mask) != 0)
182
+ #define TAIL() COPY(); TRANS(0x70)
183
+ Ch c;
184
+ COPY();
185
+ if (!(c & 0x80))
186
+ return true;
187
+
188
+ bool result = true;
189
+ switch (GetRange(static_cast<unsigned char>(c))) {
190
+ case 2: TAIL(); return result;
191
+ case 3: TAIL(); TAIL(); return result;
192
+ case 4: COPY(); TRANS(0x50); TAIL(); return result;
193
+ case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result;
194
+ case 6: TAIL(); TAIL(); TAIL(); return result;
195
+ case 10: COPY(); TRANS(0x20); TAIL(); return result;
196
+ case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result;
197
+ default: return false;
198
+ }
199
+ #undef COPY
200
+ #undef TRANS
201
+ #undef TAIL
202
+ }
203
+
204
+ static unsigned char GetRange(unsigned char c) {
205
+ // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
206
+ // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types.
207
+ static const unsigned char type[] = {
208
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
209
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
210
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
211
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
212
+ 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
213
+ 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
214
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
215
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
216
+ 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
217
+ 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
218
+ };
219
+ return type[c];
220
+ }
221
+
222
+ template <typename InputByteStream>
223
+ static CharType TakeBOM(InputByteStream& is) {
224
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
225
+ typename InputByteStream::Ch c = Take(is);
226
+ if (static_cast<unsigned char>(c) != 0xEFu) return c;
227
+ c = is.Take();
228
+ if (static_cast<unsigned char>(c) != 0xBBu) return c;
229
+ c = is.Take();
230
+ if (static_cast<unsigned char>(c) != 0xBFu) return c;
231
+ c = is.Take();
232
+ return c;
233
+ }
234
+
235
+ template <typename InputByteStream>
236
+ static Ch Take(InputByteStream& is) {
237
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
238
+ return static_cast<Ch>(is.Take());
239
+ }
240
+
241
+ template <typename OutputByteStream>
242
+ static void PutBOM(OutputByteStream& os) {
243
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
244
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xEFu));
245
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xBBu));
246
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xBFu));
247
+ }
248
+
249
+ template <typename OutputByteStream>
250
+ static void Put(OutputByteStream& os, Ch c) {
251
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
252
+ os.Put(static_cast<typename OutputByteStream::Ch>(c));
253
+ }
254
+ };
255
+
256
+ ///////////////////////////////////////////////////////////////////////////////
257
+ // UTF16
258
+
259
+ //! UTF-16 encoding.
260
+ /*! http://en.wikipedia.org/wiki/UTF-16
261
+ http://tools.ietf.org/html/rfc2781
262
+ \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead.
263
+ \note implements Encoding concept
264
+
265
+ \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.
266
+ For streaming, use UTF16LE and UTF16BE, which handle endianness.
267
+ */
268
+ template<typename CharType = wchar_t>
269
+ struct UTF16 {
270
+ typedef CharType Ch;
271
+ RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2);
272
+
273
+ enum { supportUnicode = 1 };
274
+
275
+ template<typename OutputStream>
276
+ static void Encode(OutputStream& os, unsigned codepoint) {
277
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
278
+ if (codepoint <= 0xFFFF) {
279
+ RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair
280
+ os.Put(static_cast<typename OutputStream::Ch>(codepoint));
281
+ }
282
+ else {
283
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
284
+ unsigned v = codepoint - 0x10000;
285
+ os.Put(static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));
286
+ os.Put((v & 0x3FF) | 0xDC00);
287
+ }
288
+ }
289
+
290
+
291
+ template<typename OutputStream>
292
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
293
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
294
+ if (codepoint <= 0xFFFF) {
295
+ RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair
296
+ PutUnsafe(os, static_cast<typename OutputStream::Ch>(codepoint));
297
+ }
298
+ else {
299
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
300
+ unsigned v = codepoint - 0x10000;
301
+ PutUnsafe(os, static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));
302
+ PutUnsafe(os, (v & 0x3FF) | 0xDC00);
303
+ }
304
+ }
305
+
306
+ template <typename InputStream>
307
+ static bool Decode(InputStream& is, unsigned* codepoint) {
308
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);
309
+ typename InputStream::Ch c = is.Take();
310
+ if (c < 0xD800 || c > 0xDFFF) {
311
+ *codepoint = static_cast<unsigned>(c);
312
+ return true;
313
+ }
314
+ else if (c <= 0xDBFF) {
315
+ *codepoint = (static_cast<unsigned>(c) & 0x3FF) << 10;
316
+ c = is.Take();
317
+ *codepoint |= (static_cast<unsigned>(c) & 0x3FF);
318
+ *codepoint += 0x10000;
319
+ return c >= 0xDC00 && c <= 0xDFFF;
320
+ }
321
+ return false;
322
+ }
323
+
324
+ template <typename InputStream, typename OutputStream>
325
+ static bool Validate(InputStream& is, OutputStream& os) {
326
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);
327
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
328
+ typename InputStream::Ch c;
329
+ os.Put(static_cast<typename OutputStream::Ch>(c = is.Take()));
330
+ if (c < 0xD800 || c > 0xDFFF)
331
+ return true;
332
+ else if (c <= 0xDBFF) {
333
+ os.Put(c = is.Take());
334
+ return c >= 0xDC00 && c <= 0xDFFF;
335
+ }
336
+ return false;
337
+ }
338
+ };
339
+
340
+ //! UTF-16 little endian encoding.
341
+ template<typename CharType = wchar_t>
342
+ struct UTF16LE : UTF16<CharType> {
343
+ template <typename InputByteStream>
344
+ static CharType TakeBOM(InputByteStream& is) {
345
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
346
+ CharType c = Take(is);
347
+ return static_cast<uint16_t>(c) == 0xFEFFu ? Take(is) : c;
348
+ }
349
+
350
+ template <typename InputByteStream>
351
+ static CharType Take(InputByteStream& is) {
352
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
353
+ unsigned c = static_cast<uint8_t>(is.Take());
354
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
355
+ return static_cast<CharType>(c);
356
+ }
357
+
358
+ template <typename OutputByteStream>
359
+ static void PutBOM(OutputByteStream& os) {
360
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
361
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
362
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
363
+ }
364
+
365
+ template <typename OutputByteStream>
366
+ static void Put(OutputByteStream& os, CharType c) {
367
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
368
+ os.Put(static_cast<typename OutputByteStream::Ch>(static_cast<unsigned>(c) & 0xFFu));
369
+ os.Put(static_cast<typename OutputByteStream::Ch>((static_cast<unsigned>(c) >> 8) & 0xFFu));
370
+ }
371
+ };
372
+
373
+ //! UTF-16 big endian encoding.
374
+ template<typename CharType = wchar_t>
375
+ struct UTF16BE : UTF16<CharType> {
376
+ template <typename InputByteStream>
377
+ static CharType TakeBOM(InputByteStream& is) {
378
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
379
+ CharType c = Take(is);
380
+ return static_cast<uint16_t>(c) == 0xFEFFu ? Take(is) : c;
381
+ }
382
+
383
+ template <typename InputByteStream>
384
+ static CharType Take(InputByteStream& is) {
385
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
386
+ unsigned c = static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
387
+ c |= static_cast<uint8_t>(is.Take());
388
+ return static_cast<CharType>(c);
389
+ }
390
+
391
+ template <typename OutputByteStream>
392
+ static void PutBOM(OutputByteStream& os) {
393
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
394
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
395
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
396
+ }
397
+
398
+ template <typename OutputByteStream>
399
+ static void Put(OutputByteStream& os, CharType c) {
400
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
401
+ os.Put(static_cast<typename OutputByteStream::Ch>((static_cast<unsigned>(c) >> 8) & 0xFFu));
402
+ os.Put(static_cast<typename OutputByteStream::Ch>(static_cast<unsigned>(c) & 0xFFu));
403
+ }
404
+ };
405
+
406
+ ///////////////////////////////////////////////////////////////////////////////
407
+ // UTF32
408
+
409
+ //! UTF-32 encoding.
410
+ /*! http://en.wikipedia.org/wiki/UTF-32
411
+ \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead.
412
+ \note implements Encoding concept
413
+
414
+ \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.
415
+ For streaming, use UTF32LE and UTF32BE, which handle endianness.
416
+ */
417
+ template<typename CharType = unsigned>
418
+ struct UTF32 {
419
+ typedef CharType Ch;
420
+ RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4);
421
+
422
+ enum { supportUnicode = 1 };
423
+
424
+ template<typename OutputStream>
425
+ static void Encode(OutputStream& os, unsigned codepoint) {
426
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);
427
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
428
+ os.Put(codepoint);
429
+ }
430
+
431
+ template<typename OutputStream>
432
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
433
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);
434
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
435
+ PutUnsafe(os, codepoint);
436
+ }
437
+
438
+ template <typename InputStream>
439
+ static bool Decode(InputStream& is, unsigned* codepoint) {
440
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
441
+ Ch c = is.Take();
442
+ *codepoint = c;
443
+ return c <= 0x10FFFF;
444
+ }
445
+
446
+ template <typename InputStream, typename OutputStream>
447
+ static bool Validate(InputStream& is, OutputStream& os) {
448
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
449
+ Ch c;
450
+ os.Put(c = is.Take());
451
+ return c <= 0x10FFFF;
452
+ }
453
+ };
454
+
455
+ //! UTF-32 little endian enocoding.
456
+ template<typename CharType = unsigned>
457
+ struct UTF32LE : UTF32<CharType> {
458
+ template <typename InputByteStream>
459
+ static CharType TakeBOM(InputByteStream& is) {
460
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
461
+ CharType c = Take(is);
462
+ return static_cast<uint32_t>(c) == 0x0000FEFFu ? Take(is) : c;
463
+ }
464
+
465
+ template <typename InputByteStream>
466
+ static CharType Take(InputByteStream& is) {
467
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
468
+ unsigned c = static_cast<uint8_t>(is.Take());
469
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
470
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 16;
471
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 24;
472
+ return static_cast<CharType>(c);
473
+ }
474
+
475
+ template <typename OutputByteStream>
476
+ static void PutBOM(OutputByteStream& os) {
477
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
478
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
479
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
480
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
481
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
482
+ }
483
+
484
+ template <typename OutputByteStream>
485
+ static void Put(OutputByteStream& os, CharType c) {
486
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
487
+ os.Put(static_cast<typename OutputByteStream::Ch>(c & 0xFFu));
488
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 8) & 0xFFu));
489
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 16) & 0xFFu));
490
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 24) & 0xFFu));
491
+ }
492
+ };
493
+
494
+ //! UTF-32 big endian encoding.
495
+ template<typename CharType = unsigned>
496
+ struct UTF32BE : UTF32<CharType> {
497
+ template <typename InputByteStream>
498
+ static CharType TakeBOM(InputByteStream& is) {
499
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
500
+ CharType c = Take(is);
501
+ return static_cast<uint32_t>(c) == 0x0000FEFFu ? Take(is) : c;
502
+ }
503
+
504
+ template <typename InputByteStream>
505
+ static CharType Take(InputByteStream& is) {
506
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
507
+ unsigned c = static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 24;
508
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 16;
509
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
510
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take()));
511
+ return static_cast<CharType>(c);
512
+ }
513
+
514
+ template <typename OutputByteStream>
515
+ static void PutBOM(OutputByteStream& os) {
516
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
517
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
518
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
519
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
520
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
521
+ }
522
+
523
+ template <typename OutputByteStream>
524
+ static void Put(OutputByteStream& os, CharType c) {
525
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
526
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 24) & 0xFFu));
527
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 16) & 0xFFu));
528
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 8) & 0xFFu));
529
+ os.Put(static_cast<typename OutputByteStream::Ch>(c & 0xFFu));
530
+ }
531
+ };
532
+
533
+ ///////////////////////////////////////////////////////////////////////////////
534
+ // ASCII
535
+
536
+ //! ASCII encoding.
537
+ /*! http://en.wikipedia.org/wiki/ASCII
538
+ \tparam CharType Code unit for storing 7-bit ASCII data. Default is char.
539
+ \note implements Encoding concept
540
+ */
541
+ template<typename CharType = char>
542
+ struct ASCII {
543
+ typedef CharType Ch;
544
+
545
+ enum { supportUnicode = 0 };
546
+
547
+ template<typename OutputStream>
548
+ static void Encode(OutputStream& os, unsigned codepoint) {
549
+ RAPIDJSON_ASSERT(codepoint <= 0x7F);
550
+ os.Put(static_cast<Ch>(codepoint & 0xFF));
551
+ }
552
+
553
+ template<typename OutputStream>
554
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
555
+ RAPIDJSON_ASSERT(codepoint <= 0x7F);
556
+ PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF));
557
+ }
558
+
559
+ template <typename InputStream>
560
+ static bool Decode(InputStream& is, unsigned* codepoint) {
561
+ uint8_t c = static_cast<uint8_t>(is.Take());
562
+ *codepoint = c;
563
+ return c <= 0X7F;
564
+ }
565
+
566
+ template <typename InputStream, typename OutputStream>
567
+ static bool Validate(InputStream& is, OutputStream& os) {
568
+ uint8_t c = static_cast<uint8_t>(is.Take());
569
+ os.Put(static_cast<typename OutputStream::Ch>(c));
570
+ return c <= 0x7F;
571
+ }
572
+
573
+ template <typename InputByteStream>
574
+ static CharType TakeBOM(InputByteStream& is) {
575
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
576
+ uint8_t c = static_cast<uint8_t>(Take(is));
577
+ return static_cast<Ch>(c);
578
+ }
579
+
580
+ template <typename InputByteStream>
581
+ static Ch Take(InputByteStream& is) {
582
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
583
+ return static_cast<Ch>(is.Take());
584
+ }
585
+
586
+ template <typename OutputByteStream>
587
+ static void PutBOM(OutputByteStream& os) {
588
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
589
+ (void)os;
590
+ }
591
+
592
+ template <typename OutputByteStream>
593
+ static void Put(OutputByteStream& os, Ch c) {
594
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
595
+ os.Put(static_cast<typename OutputByteStream::Ch>(c));
596
+ }
597
+ };
598
+
599
+ ///////////////////////////////////////////////////////////////////////////////
600
+ // AutoUTF
601
+
602
+ //! Runtime-specified UTF encoding type of a stream.
603
+ enum UTFType {
604
+ kUTF8 = 0, //!< UTF-8.
605
+ kUTF16LE = 1, //!< UTF-16 little endian.
606
+ kUTF16BE = 2, //!< UTF-16 big endian.
607
+ kUTF32LE = 3, //!< UTF-32 little endian.
608
+ kUTF32BE = 4 //!< UTF-32 big endian.
609
+ };
610
+
611
+ //! Dynamically select encoding according to stream's runtime-specified UTF encoding type.
612
+ /*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType().
613
+ */
614
+ template<typename CharType>
615
+ struct AutoUTF {
616
+ typedef CharType Ch;
617
+
618
+ enum { supportUnicode = 1 };
619
+
620
+ #define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x
621
+
622
+ template<typename OutputStream>
623
+ RAPIDJSON_FORCEINLINE static void Encode(OutputStream& os, unsigned codepoint) {
624
+ typedef void (*EncodeFunc)(OutputStream&, unsigned);
625
+ static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) };
626
+ (*f[os.GetType()])(os, codepoint);
627
+ }
628
+
629
+ template<typename OutputStream>
630
+ RAPIDJSON_FORCEINLINE static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
631
+ typedef void (*EncodeFunc)(OutputStream&, unsigned);
632
+ static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) };
633
+ (*f[os.GetType()])(os, codepoint);
634
+ }
635
+
636
+ template <typename InputStream>
637
+ RAPIDJSON_FORCEINLINE static bool Decode(InputStream& is, unsigned* codepoint) {
638
+ typedef bool (*DecodeFunc)(InputStream&, unsigned*);
639
+ static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) };
640
+ return (*f[is.GetType()])(is, codepoint);
641
+ }
642
+
643
+ template <typename InputStream, typename OutputStream>
644
+ RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
645
+ typedef bool (*ValidateFunc)(InputStream&, OutputStream&);
646
+ static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) };
647
+ return (*f[is.GetType()])(is, os);
648
+ }
649
+
650
+ #undef RAPIDJSON_ENCODINGS_FUNC
651
+ };
652
+
653
+ ///////////////////////////////////////////////////////////////////////////////
654
+ // Transcoder
655
+
656
+ //! Encoding conversion.
657
+ template<typename SourceEncoding, typename TargetEncoding>
658
+ struct Transcoder {
659
+ //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream.
660
+ template<typename InputStream, typename OutputStream>
661
+ RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {
662
+ unsigned codepoint;
663
+ if (!SourceEncoding::Decode(is, &codepoint))
664
+ return false;
665
+ TargetEncoding::Encode(os, codepoint);
666
+ return true;
667
+ }
668
+
669
+ template<typename InputStream, typename OutputStream>
670
+ RAPIDJSON_FORCEINLINE static bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
671
+ unsigned codepoint;
672
+ if (!SourceEncoding::Decode(is, &codepoint))
673
+ return false;
674
+ TargetEncoding::EncodeUnsafe(os, codepoint);
675
+ return true;
676
+ }
677
+
678
+ //! Validate one Unicode codepoint from an encoded stream.
679
+ template<typename InputStream, typename OutputStream>
680
+ RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
681
+ return Transcode(is, os); // Since source/target encoding is different, must transcode.
682
+ }
683
+ };
684
+
685
+ // Forward declaration.
686
+ template<typename Stream>
687
+ inline void PutUnsafe(Stream& stream, typename Stream::Ch c);
688
+
689
+ //! Specialization of Transcoder with same source and target encoding.
690
+ template<typename Encoding>
691
+ struct Transcoder<Encoding, Encoding> {
692
+ template<typename InputStream, typename OutputStream>
693
+ RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {
694
+ os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class.
695
+ return true;
696
+ }
697
+
698
+ template<typename InputStream, typename OutputStream>
699
+ RAPIDJSON_FORCEINLINE static bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
700
+ PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class.
701
+ return true;
702
+ }
703
+
704
+ template<typename InputStream, typename OutputStream>
705
+ RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
706
+ return Encoding::Validate(is, os); // source/target encoding are the same
707
+ }
708
+ };
709
+
710
+ RAPIDJSON_NAMESPACE_END
711
+
712
+ #if defined(__GNUC__) || defined(_MSC_VER)
713
+ RAPIDJSON_DIAG_POP
714
+ #endif
715
+
716
+ #endif // RAPIDJSON_ENCODINGS_H_