couchbase 1.3.15 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1897) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.txt +202 -0
  3. data/README.md +130 -0
  4. data/ext/CMakeLists.txt +66 -0
  5. data/ext/couchbase/CMakeLists.txt +142 -0
  6. data/ext/couchbase/LICENSE.txt +202 -0
  7. data/ext/couchbase/cmake/Backtrace.cmake +35 -0
  8. data/ext/couchbase/cmake/BuildTracing.cmake +6 -0
  9. data/ext/couchbase/cmake/Cache.cmake +29 -0
  10. data/ext/couchbase/cmake/CompilerWarnings.cmake +83 -0
  11. data/ext/couchbase/cmake/DetectStandardFilesystem.cmake +30 -0
  12. data/ext/couchbase/cmake/OpenSSL.cmake +24 -0
  13. data/ext/couchbase/cmake/PreventInSourceBuilds.cmake +21 -0
  14. data/ext/couchbase/cmake/Sanitizers.cmake +67 -0
  15. data/ext/couchbase/cmake/StandardProjectSettings.cmake +45 -0
  16. data/ext/couchbase/cmake/StaticAnalyzers.cmake +37 -0
  17. data/ext/couchbase/cmake/Testing.cmake +63 -0
  18. data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +44 -0
  19. data/ext/couchbase/cmake/VersionInfo.cmake +46 -0
  20. data/ext/couchbase/cmake/build_config.hxx.in +20 -0
  21. data/ext/couchbase/cmake/build_version.hxx.in +32 -0
  22. data/ext/couchbase/cmake/test_filesystem.cpp.in +22 -0
  23. data/ext/couchbase/couchbase/analytics_scan_consistency.hxx +26 -0
  24. data/ext/couchbase/couchbase/bucket.hxx +536 -0
  25. data/ext/couchbase/couchbase/capella_ca.hxx +43 -0
  26. data/ext/couchbase/couchbase/cas.hxx +47 -0
  27. data/ext/couchbase/couchbase/cas_fmt.hxx +37 -0
  28. data/ext/couchbase/couchbase/cluster.cxx +111 -0
  29. data/ext/couchbase/couchbase/cluster.hxx +423 -0
  30. data/ext/couchbase/couchbase/cluster_options.cxx +45 -0
  31. data/ext/couchbase/couchbase/cluster_options.hxx +78 -0
  32. data/ext/couchbase/couchbase/crypto/CMakeLists.txt +12 -0
  33. data/ext/couchbase/couchbase/crypto/cbcrypto.cc +887 -0
  34. data/ext/couchbase/couchbase/crypto/cbcrypto.h +88 -0
  35. data/ext/couchbase/couchbase/design_document_namespace.hxx +26 -0
  36. data/ext/couchbase/couchbase/design_document_namespace_fmt.hxx +47 -0
  37. data/ext/couchbase/couchbase/diagnostics.hxx +97 -0
  38. data/ext/couchbase/couchbase/diagnostics_fmt.hxx +113 -0
  39. data/ext/couchbase/couchbase/diagnostics_json.hxx +100 -0
  40. data/ext/couchbase/couchbase/document_id.cxx +89 -0
  41. data/ext/couchbase/couchbase/document_id.hxx +102 -0
  42. data/ext/couchbase/couchbase/document_id_fmt.hxx +37 -0
  43. data/ext/couchbase/couchbase/error_context/analytics.hxx +51 -0
  44. data/ext/couchbase/couchbase/error_context/http.hxx +47 -0
  45. data/ext/couchbase/couchbase/error_context/key_value.hxx +50 -0
  46. data/ext/couchbase/couchbase/error_context/query.hxx +51 -0
  47. data/ext/couchbase/couchbase/error_context/search.hxx +50 -0
  48. data/ext/couchbase/couchbase/error_context/view.hxx +51 -0
  49. data/ext/couchbase/couchbase/errors.hxx +1038 -0
  50. data/ext/couchbase/couchbase/io/CMakeLists.txt +12 -0
  51. data/ext/couchbase/couchbase/io/dns_client.hxx +217 -0
  52. data/ext/couchbase/couchbase/io/dns_codec.hxx +206 -0
  53. data/ext/couchbase/couchbase/io/dns_config.hxx +115 -0
  54. data/ext/couchbase/couchbase/io/dns_message.hxx +555 -0
  55. data/ext/couchbase/couchbase/io/http_command.hxx +174 -0
  56. data/ext/couchbase/couchbase/io/http_context.hxx +40 -0
  57. data/ext/couchbase/couchbase/io/http_message.hxx +116 -0
  58. data/ext/couchbase/couchbase/io/http_parser.cxx +141 -0
  59. data/ext/couchbase/couchbase/io/http_parser.hxx +55 -0
  60. data/ext/couchbase/couchbase/io/http_session.hxx +544 -0
  61. data/ext/couchbase/couchbase/io/http_session_manager.hxx +377 -0
  62. data/ext/couchbase/couchbase/io/http_traits.hxx +30 -0
  63. data/ext/couchbase/couchbase/io/ip_protocol.hxx +28 -0
  64. data/ext/couchbase/couchbase/io/mcbp_command.hxx +300 -0
  65. data/ext/couchbase/couchbase/io/mcbp_context.hxx +39 -0
  66. data/ext/couchbase/couchbase/io/mcbp_message.cxx +39 -0
  67. data/ext/couchbase/couchbase/io/mcbp_message.hxx +55 -0
  68. data/ext/couchbase/couchbase/io/mcbp_parser.cxx +86 -0
  69. data/ext/couchbase/couchbase/io/mcbp_parser.hxx +45 -0
  70. data/ext/couchbase/couchbase/io/mcbp_session.hxx +1317 -0
  71. data/ext/couchbase/couchbase/io/mcbp_traits.hxx +30 -0
  72. data/ext/couchbase/couchbase/io/query_cache.hxx +61 -0
  73. data/ext/couchbase/couchbase/io/retry_action.hxx +30 -0
  74. data/ext/couchbase/couchbase/io/retry_context.hxx +38 -0
  75. data/ext/couchbase/couchbase/io/retry_orchestrator.hxx +112 -0
  76. data/ext/couchbase/couchbase/io/retry_reason.hxx +158 -0
  77. data/ext/couchbase/couchbase/io/retry_reason_fmt.hxx +103 -0
  78. data/ext/couchbase/couchbase/io/retry_strategy.hxx +152 -0
  79. data/ext/couchbase/couchbase/io/streams.hxx +253 -0
  80. data/ext/couchbase/couchbase/json_string.hxx +48 -0
  81. data/ext/couchbase/couchbase/logger/CMakeLists.txt +9 -0
  82. data/ext/couchbase/couchbase/logger/configuration.hxx +52 -0
  83. data/ext/couchbase/couchbase/logger/custom_rotating_file_sink.cxx +157 -0
  84. data/ext/couchbase/couchbase/logger/custom_rotating_file_sink.hxx +76 -0
  85. data/ext/couchbase/couchbase/logger/logger.cxx +337 -0
  86. data/ext/couchbase/couchbase/logger/logger.hxx +235 -0
  87. data/ext/couchbase/couchbase/management/CMakeLists.txt +13 -0
  88. data/ext/couchbase/couchbase/management/analytics_dataset.hxx +30 -0
  89. data/ext/couchbase/couchbase/management/analytics_index.hxx +30 -0
  90. data/ext/couchbase/couchbase/management/analytics_link.hxx +22 -0
  91. data/ext/couchbase/couchbase/management/analytics_link_azure_blob_external.cxx +67 -0
  92. data/ext/couchbase/couchbase/management/analytics_link_azure_blob_external.hxx +76 -0
  93. data/ext/couchbase/couchbase/management/analytics_link_azure_blob_external_json.hxx +52 -0
  94. data/ext/couchbase/couchbase/management/analytics_link_couchbase_remote.cxx +104 -0
  95. data/ext/couchbase/couchbase/management/analytics_link_couchbase_remote.hxx +107 -0
  96. data/ext/couchbase/couchbase/management/analytics_link_couchbase_remote_json.hxx +63 -0
  97. data/ext/couchbase/couchbase/management/analytics_link_s3_external.cxx +57 -0
  98. data/ext/couchbase/couchbase/management/analytics_link_s3_external.hxx +69 -0
  99. data/ext/couchbase/couchbase/management/analytics_link_s3_external_json.hxx +47 -0
  100. data/ext/couchbase/couchbase/management/bucket_settings.hxx +134 -0
  101. data/ext/couchbase/couchbase/management/bucket_settings_json.hxx +123 -0
  102. data/ext/couchbase/couchbase/management/design_document.hxx +41 -0
  103. data/ext/couchbase/couchbase/management/eventing_function.hxx +188 -0
  104. data/ext/couchbase/couchbase/management/eventing_function_json.hxx +212 -0
  105. data/ext/couchbase/couchbase/management/eventing_status.hxx +84 -0
  106. data/ext/couchbase/couchbase/management/eventing_status_json.hxx +77 -0
  107. data/ext/couchbase/couchbase/management/query_index.hxx +39 -0
  108. data/ext/couchbase/couchbase/management/rbac.hxx +77 -0
  109. data/ext/couchbase/couchbase/management/rbac_fmt.hxx +49 -0
  110. data/ext/couchbase/couchbase/management/rbac_json.hxx +179 -0
  111. data/ext/couchbase/couchbase/management/search_index.hxx +38 -0
  112. data/ext/couchbase/couchbase/management/search_index_json.hxx +58 -0
  113. data/ext/couchbase/couchbase/meta/CMakeLists.txt +15 -0
  114. data/ext/couchbase/couchbase/meta/version.cxx +181 -0
  115. data/ext/couchbase/couchbase/meta/version.hxx +45 -0
  116. data/ext/couchbase/couchbase/metrics/CMakeLists.txt +11 -0
  117. data/ext/couchbase/couchbase/metrics/logging_meter.cxx +194 -0
  118. data/ext/couchbase/couchbase/metrics/logging_meter.hxx +74 -0
  119. data/ext/couchbase/couchbase/metrics/logging_meter_options.hxx +28 -0
  120. data/ext/couchbase/couchbase/metrics/meter.hxx +52 -0
  121. data/ext/couchbase/couchbase/metrics/noop_meter.hxx +47 -0
  122. data/ext/couchbase/couchbase/mutation_token.hxx +31 -0
  123. data/ext/couchbase/couchbase/mutation_token_fmt.hxx +37 -0
  124. data/ext/couchbase/couchbase/operations/CMakeLists.txt +35 -0
  125. data/ext/couchbase/couchbase/operations/document_analytics.cxx +195 -0
  126. data/ext/couchbase/couchbase/operations/document_analytics.hxx +92 -0
  127. data/ext/couchbase/couchbase/operations/document_append.cxx +46 -0
  128. data/ext/couchbase/couchbase/operations/document_append.hxx +63 -0
  129. data/ext/couchbase/couchbase/operations/document_decrement.cxx +57 -0
  130. data/ext/couchbase/couchbase/operations/document_decrement.hxx +67 -0
  131. data/ext/couchbase/couchbase/operations/document_exists.cxx +49 -0
  132. data/ext/couchbase/couchbase/operations/document_exists.hxx +61 -0
  133. data/ext/couchbase/couchbase/operations/document_get.cxx +44 -0
  134. data/ext/couchbase/couchbase/operations/document_get.hxx +53 -0
  135. data/ext/couchbase/couchbase/operations/document_get_and_lock.cxx +45 -0
  136. data/ext/couchbase/couchbase/operations/document_get_and_lock.hxx +54 -0
  137. data/ext/couchbase/couchbase/operations/document_get_and_touch.cxx +45 -0
  138. data/ext/couchbase/couchbase/operations/document_get_and_touch.hxx +54 -0
  139. data/ext/couchbase/couchbase/operations/document_get_projected.cxx +227 -0
  140. data/ext/couchbase/couchbase/operations/document_get_projected.hxx +58 -0
  141. data/ext/couchbase/couchbase/operations/document_increment.cxx +57 -0
  142. data/ext/couchbase/couchbase/operations/document_increment.hxx +67 -0
  143. data/ext/couchbase/couchbase/operations/document_insert.cxx +48 -0
  144. data/ext/couchbase/couchbase/operations/document_insert.hxx +65 -0
  145. data/ext/couchbase/couchbase/operations/document_lookup_in.cxx +81 -0
  146. data/ext/couchbase/couchbase/operations/document_lookup_in.hxx +64 -0
  147. data/ext/couchbase/couchbase/operations/document_mutate_in.cxx +104 -0
  148. data/ext/couchbase/couchbase/operations/document_mutate_in.hxx +82 -0
  149. data/ext/couchbase/couchbase/operations/document_prepend.cxx +46 -0
  150. data/ext/couchbase/couchbase/operations/document_prepend.hxx +63 -0
  151. data/ext/couchbase/couchbase/operations/document_query.cxx +370 -0
  152. data/ext/couchbase/couchbase/operations/document_query.hxx +123 -0
  153. data/ext/couchbase/couchbase/operations/document_remove.cxx +46 -0
  154. data/ext/couchbase/couchbase/operations/document_remove.hxx +63 -0
  155. data/ext/couchbase/couchbase/operations/document_replace.cxx +52 -0
  156. data/ext/couchbase/couchbase/operations/document_replace.hxx +67 -0
  157. data/ext/couchbase/couchbase/operations/document_search.cxx +311 -0
  158. data/ext/couchbase/couchbase/operations/document_search.hxx +153 -0
  159. data/ext/couchbase/couchbase/operations/document_touch.cxx +43 -0
  160. data/ext/couchbase/couchbase/operations/document_touch.hxx +52 -0
  161. data/ext/couchbase/couchbase/operations/document_unlock.cxx +43 -0
  162. data/ext/couchbase/couchbase/operations/document_unlock.hxx +52 -0
  163. data/ext/couchbase/couchbase/operations/document_upsert.cxx +52 -0
  164. data/ext/couchbase/couchbase/operations/document_upsert.hxx +66 -0
  165. data/ext/couchbase/couchbase/operations/document_view.cxx +183 -0
  166. data/ext/couchbase/couchbase/operations/document_view.hxx +97 -0
  167. data/ext/couchbase/couchbase/operations/http_noop.cxx +60 -0
  168. data/ext/couchbase/couchbase/operations/http_noop.hxx +48 -0
  169. data/ext/couchbase/couchbase/operations/management/CMakeLists.txt +79 -0
  170. data/ext/couchbase/couchbase/operations/management/analytics.hxx +34 -0
  171. data/ext/couchbase/couchbase/operations/management/analytics_dataset_create.cxx +94 -0
  172. data/ext/couchbase/couchbase/operations/management/analytics_dataset_create.hxx +57 -0
  173. data/ext/couchbase/couchbase/operations/management/analytics_dataset_drop.cxx +83 -0
  174. data/ext/couchbase/couchbase/operations/management/analytics_dataset_drop.hxx +54 -0
  175. data/ext/couchbase/couchbase/operations/management/analytics_dataset_get_all.cxx +80 -0
  176. data/ext/couchbase/couchbase/operations/management/analytics_dataset_get_all.hxx +52 -0
  177. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_create.cxx +82 -0
  178. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_create.hxx +53 -0
  179. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_drop.cxx +82 -0
  180. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_drop.hxx +53 -0
  181. data/ext/couchbase/couchbase/operations/management/analytics_get_pending_mutations.cxx +70 -0
  182. data/ext/couchbase/couchbase/operations/management/analytics_get_pending_mutations.hxx +52 -0
  183. data/ext/couchbase/couchbase/operations/management/analytics_index_create.cxx +106 -0
  184. data/ext/couchbase/couchbase/operations/management/analytics_index_create.hxx +56 -0
  185. data/ext/couchbase/couchbase/operations/management/analytics_index_drop.cxx +90 -0
  186. data/ext/couchbase/couchbase/operations/management/analytics_index_drop.hxx +55 -0
  187. data/ext/couchbase/couchbase/operations/management/analytics_index_get_all.cxx +80 -0
  188. data/ext/couchbase/couchbase/operations/management/analytics_index_get_all.hxx +52 -0
  189. data/ext/couchbase/couchbase/operations/management/analytics_link_connect.cxx +82 -0
  190. data/ext/couchbase/couchbase/operations/management/analytics_link_connect.hxx +57 -0
  191. data/ext/couchbase/couchbase/operations/management/analytics_link_create.cxx +87 -0
  192. data/ext/couchbase/couchbase/operations/management/analytics_link_create.hxx +77 -0
  193. data/ext/couchbase/couchbase/operations/management/analytics_link_disconnect.cxx +80 -0
  194. data/ext/couchbase/couchbase/operations/management/analytics_link_disconnect.hxx +56 -0
  195. data/ext/couchbase/couchbase/operations/management/analytics_link_drop.cxx +103 -0
  196. data/ext/couchbase/couchbase/operations/management/analytics_link_drop.hxx +56 -0
  197. data/ext/couchbase/couchbase/operations/management/analytics_link_get_all.cxx +130 -0
  198. data/ext/couchbase/couchbase/operations/management/analytics_link_get_all.hxx +63 -0
  199. data/ext/couchbase/couchbase/operations/management/analytics_link_replace.cxx +87 -0
  200. data/ext/couchbase/couchbase/operations/management/analytics_link_replace.hxx +78 -0
  201. data/ext/couchbase/couchbase/operations/management/analytics_link_utils.hxx +37 -0
  202. data/ext/couchbase/couchbase/operations/management/analytics_problem.hxx +30 -0
  203. data/ext/couchbase/couchbase/operations/management/bucket.hxx +25 -0
  204. data/ext/couchbase/couchbase/operations/management/bucket_create.cxx +171 -0
  205. data/ext/couchbase/couchbase/operations/management/bucket_create.hxx +52 -0
  206. data/ext/couchbase/couchbase/operations/management/bucket_describe.cxx +67 -0
  207. data/ext/couchbase/couchbase/operations/management/bucket_describe.hxx +61 -0
  208. data/ext/couchbase/couchbase/operations/management/bucket_drop.cxx +52 -0
  209. data/ext/couchbase/couchbase/operations/management/bucket_drop.hxx +49 -0
  210. data/ext/couchbase/couchbase/operations/management/bucket_flush.cxx +59 -0
  211. data/ext/couchbase/couchbase/operations/management/bucket_flush.hxx +49 -0
  212. data/ext/couchbase/couchbase/operations/management/bucket_get.cxx +59 -0
  213. data/ext/couchbase/couchbase/operations/management/bucket_get.hxx +51 -0
  214. data/ext/couchbase/couchbase/operations/management/bucket_get_all.cxx +59 -0
  215. data/ext/couchbase/couchbase/operations/management/bucket_get_all.hxx +49 -0
  216. data/ext/couchbase/couchbase/operations/management/bucket_update.cxx +130 -0
  217. data/ext/couchbase/couchbase/operations/management/bucket_update.hxx +52 -0
  218. data/ext/couchbase/couchbase/operations/management/cluster_describe.cxx +90 -0
  219. data/ext/couchbase/couchbase/operations/management/cluster_describe.hxx +72 -0
  220. data/ext/couchbase/couchbase/operations/management/cluster_developer_preview_enable.cxx +44 -0
  221. data/ext/couchbase/couchbase/operations/management/cluster_developer_preview_enable.hxx +48 -0
  222. data/ext/couchbase/couchbase/operations/management/collection_create.cxx +83 -0
  223. data/ext/couchbase/couchbase/operations/management/collection_create.hxx +53 -0
  224. data/ext/couchbase/couchbase/operations/management/collection_drop.cxx +73 -0
  225. data/ext/couchbase/couchbase/operations/management/collection_drop.hxx +52 -0
  226. data/ext/couchbase/couchbase/operations/management/collections.hxx +25 -0
  227. data/ext/couchbase/couchbase/operations/management/collections_manifest_get.cxx +40 -0
  228. data/ext/couchbase/couchbase/operations/management/collections_manifest_get.hxx +53 -0
  229. data/ext/couchbase/couchbase/operations/management/error_utils.cxx +265 -0
  230. data/ext/couchbase/couchbase/operations/management/error_utils.hxx +48 -0
  231. data/ext/couchbase/couchbase/operations/management/eventing.hxx +28 -0
  232. data/ext/couchbase/couchbase/operations/management/eventing_deploy_function.cxx +56 -0
  233. data/ext/couchbase/couchbase/operations/management/eventing_deploy_function.hxx +52 -0
  234. data/ext/couchbase/couchbase/operations/management/eventing_drop_function.cxx +57 -0
  235. data/ext/couchbase/couchbase/operations/management/eventing_drop_function.hxx +52 -0
  236. data/ext/couchbase/couchbase/operations/management/eventing_get_all_functions.cxx +64 -0
  237. data/ext/couchbase/couchbase/operations/management/eventing_get_all_functions.hxx +51 -0
  238. data/ext/couchbase/couchbase/operations/management/eventing_get_function.cxx +56 -0
  239. data/ext/couchbase/couchbase/operations/management/eventing_get_function.hxx +53 -0
  240. data/ext/couchbase/couchbase/operations/management/eventing_get_status.cxx +56 -0
  241. data/ext/couchbase/couchbase/operations/management/eventing_get_status.hxx +53 -0
  242. data/ext/couchbase/couchbase/operations/management/eventing_pause_function.cxx +56 -0
  243. data/ext/couchbase/couchbase/operations/management/eventing_pause_function.hxx +52 -0
  244. data/ext/couchbase/couchbase/operations/management/eventing_problem.hxx +31 -0
  245. data/ext/couchbase/couchbase/operations/management/eventing_resume_function.cxx +56 -0
  246. data/ext/couchbase/couchbase/operations/management/eventing_resume_function.hxx +52 -0
  247. data/ext/couchbase/couchbase/operations/management/eventing_undeploy_function.cxx +56 -0
  248. data/ext/couchbase/couchbase/operations/management/eventing_undeploy_function.hxx +52 -0
  249. data/ext/couchbase/couchbase/operations/management/eventing_upsert_function.cxx +341 -0
  250. data/ext/couchbase/couchbase/operations/management/eventing_upsert_function.hxx +52 -0
  251. data/ext/couchbase/couchbase/operations/management/freeform.cxx +55 -0
  252. data/ext/couchbase/couchbase/operations/management/freeform.hxx +55 -0
  253. data/ext/couchbase/couchbase/operations/management/group_drop.cxx +51 -0
  254. data/ext/couchbase/couchbase/operations/management/group_drop.hxx +49 -0
  255. data/ext/couchbase/couchbase/operations/management/group_get.cxx +60 -0
  256. data/ext/couchbase/couchbase/operations/management/group_get.hxx +50 -0
  257. data/ext/couchbase/couchbase/operations/management/group_get_all.cxx +58 -0
  258. data/ext/couchbase/couchbase/operations/management/group_get_all.hxx +49 -0
  259. data/ext/couchbase/couchbase/operations/management/group_upsert.cxx +96 -0
  260. data/ext/couchbase/couchbase/operations/management/group_upsert.hxx +51 -0
  261. data/ext/couchbase/couchbase/operations/management/query.hxx +23 -0
  262. data/ext/couchbase/couchbase/operations/management/query_index_build_deferred.cxx +88 -0
  263. data/ext/couchbase/couchbase/operations/management/query_index_build_deferred.hxx +61 -0
  264. data/ext/couchbase/couchbase/operations/management/query_index_create.cxx +149 -0
  265. data/ext/couchbase/couchbase/operations/management/query_index_create.hxx +65 -0
  266. data/ext/couchbase/couchbase/operations/management/query_index_drop.cxx +128 -0
  267. data/ext/couchbase/couchbase/operations/management/query_index_drop.hxx +61 -0
  268. data/ext/couchbase/couchbase/operations/management/query_index_get_all.cxx +126 -0
  269. data/ext/couchbase/couchbase/operations/management/query_index_get_all.hxx +54 -0
  270. data/ext/couchbase/couchbase/operations/management/role_get_all.cxx +58 -0
  271. data/ext/couchbase/couchbase/operations/management/role_get_all.hxx +49 -0
  272. data/ext/couchbase/couchbase/operations/management/scope_create.cxx +75 -0
  273. data/ext/couchbase/couchbase/operations/management/scope_create.hxx +51 -0
  274. data/ext/couchbase/couchbase/operations/management/scope_drop.cxx +70 -0
  275. data/ext/couchbase/couchbase/operations/management/scope_drop.hxx +51 -0
  276. data/ext/couchbase/couchbase/operations/management/scope_get_all.cxx +62 -0
  277. data/ext/couchbase/couchbase/operations/management/scope_get_all.hxx +51 -0
  278. data/ext/couchbase/couchbase/operations/management/search.hxx +30 -0
  279. data/ext/couchbase/couchbase/operations/management/search_get_stats.cxx +41 -0
  280. data/ext/couchbase/couchbase/operations/management/search_get_stats.hxx +48 -0
  281. data/ext/couchbase/couchbase/operations/management/search_index_analyze_document.cxx +85 -0
  282. data/ext/couchbase/couchbase/operations/management/search_index_analyze_document.hxx +54 -0
  283. data/ext/couchbase/couchbase/operations/management/search_index_control_ingest.cxx +73 -0
  284. data/ext/couchbase/couchbase/operations/management/search_index_control_ingest.hxx +52 -0
  285. data/ext/couchbase/couchbase/operations/management/search_index_control_plan_freeze.cxx +73 -0
  286. data/ext/couchbase/couchbase/operations/management/search_index_control_plan_freeze.hxx +57 -0
  287. data/ext/couchbase/couchbase/operations/management/search_index_control_query.cxx +73 -0
  288. data/ext/couchbase/couchbase/operations/management/search_index_control_query.hxx +52 -0
  289. data/ext/couchbase/couchbase/operations/management/search_index_drop.cxx +72 -0
  290. data/ext/couchbase/couchbase/operations/management/search_index_drop.hxx +51 -0
  291. data/ext/couchbase/couchbase/operations/management/search_index_get.cxx +75 -0
  292. data/ext/couchbase/couchbase/operations/management/search_index_get.hxx +54 -0
  293. data/ext/couchbase/couchbase/operations/management/search_index_get_all.cxx +67 -0
  294. data/ext/couchbase/couchbase/operations/management/search_index_get_all.hxx +51 -0
  295. data/ext/couchbase/couchbase/operations/management/search_index_get_documents_count.cxx +79 -0
  296. data/ext/couchbase/couchbase/operations/management/search_index_get_documents_count.hxx +53 -0
  297. data/ext/couchbase/couchbase/operations/management/search_index_get_stats.cxx +71 -0
  298. data/ext/couchbase/couchbase/operations/management/search_index_get_stats.hxx +52 -0
  299. data/ext/couchbase/couchbase/operations/management/search_index_upsert.cxx +108 -0
  300. data/ext/couchbase/couchbase/operations/management/search_index_upsert.hxx +52 -0
  301. data/ext/couchbase/couchbase/operations/management/user.hxx +28 -0
  302. data/ext/couchbase/couchbase/operations/management/user_drop.cxx +52 -0
  303. data/ext/couchbase/couchbase/operations/management/user_drop.hxx +51 -0
  304. data/ext/couchbase/couchbase/operations/management/user_get.cxx +61 -0
  305. data/ext/couchbase/couchbase/operations/management/user_get.hxx +52 -0
  306. data/ext/couchbase/couchbase/operations/management/user_get_all.cxx +59 -0
  307. data/ext/couchbase/couchbase/operations/management/user_get_all.hxx +51 -0
  308. data/ext/couchbase/couchbase/operations/management/user_upsert.cxx +101 -0
  309. data/ext/couchbase/couchbase/operations/management/user_upsert.hxx +52 -0
  310. data/ext/couchbase/couchbase/operations/management/view.hxx +23 -0
  311. data/ext/couchbase/couchbase/operations/management/view_index_drop.cxx +46 -0
  312. data/ext/couchbase/couchbase/operations/management/view_index_drop.hxx +52 -0
  313. data/ext/couchbase/couchbase/operations/management/view_index_get.cxx +74 -0
  314. data/ext/couchbase/couchbase/operations/management/view_index_get.hxx +53 -0
  315. data/ext/couchbase/couchbase/operations/management/view_index_get_all.cxx +108 -0
  316. data/ext/couchbase/couchbase/operations/management/view_index_get_all.hxx +52 -0
  317. data/ext/couchbase/couchbase/operations/management/view_index_upsert.cxx +71 -0
  318. data/ext/couchbase/couchbase/operations/management/view_index_upsert.hxx +51 -0
  319. data/ext/couchbase/couchbase/operations/mcbp_noop.cxx +38 -0
  320. data/ext/couchbase/couchbase/operations/mcbp_noop.hxx +49 -0
  321. data/ext/couchbase/couchbase/operations.hxx +42 -0
  322. data/ext/couchbase/couchbase/origin.hxx +185 -0
  323. data/ext/couchbase/couchbase/platform/CMakeLists.txt +16 -0
  324. data/ext/couchbase/couchbase/platform/backtrace.c +189 -0
  325. data/ext/couchbase/couchbase/platform/backtrace.h +54 -0
  326. data/ext/couchbase/couchbase/platform/base64.cc +234 -0
  327. data/ext/couchbase/couchbase/platform/base64.h +44 -0
  328. data/ext/couchbase/couchbase/platform/dirutils.cc +123 -0
  329. data/ext/couchbase/couchbase/platform/dirutils.h +43 -0
  330. data/ext/couchbase/couchbase/platform/random.cc +120 -0
  331. data/ext/couchbase/couchbase/platform/random.h +39 -0
  332. data/ext/couchbase/couchbase/platform/string_hex.cc +99 -0
  333. data/ext/couchbase/couchbase/platform/string_hex.h +50 -0
  334. data/ext/couchbase/couchbase/platform/terminate_handler.cc +125 -0
  335. data/ext/couchbase/couchbase/platform/terminate_handler.h +36 -0
  336. data/ext/couchbase/couchbase/platform/uuid.cc +98 -0
  337. data/ext/couchbase/couchbase/platform/uuid.h +56 -0
  338. data/ext/couchbase/couchbase/protocol/CMakeLists.txt +42 -0
  339. data/ext/couchbase/couchbase/protocol/client_opcode.hxx +359 -0
  340. data/ext/couchbase/couchbase/protocol/client_opcode_fmt.hxx +316 -0
  341. data/ext/couchbase/couchbase/protocol/client_request.cxx +37 -0
  342. data/ext/couchbase/couchbase/protocol/client_request.hxx +157 -0
  343. data/ext/couchbase/couchbase/protocol/client_response.cxx +74 -0
  344. data/ext/couchbase/couchbase/protocol/client_response.hxx +211 -0
  345. data/ext/couchbase/couchbase/protocol/cmd_append.cxx +82 -0
  346. data/ext/couchbase/couchbase/protocol/cmd_append.hxx +107 -0
  347. data/ext/couchbase/couchbase/protocol/cmd_cluster_map_change_notification.cxx +51 -0
  348. data/ext/couchbase/couchbase/protocol/cmd_cluster_map_change_notification.hxx +57 -0
  349. data/ext/couchbase/couchbase/protocol/cmd_decrement.cxx +112 -0
  350. data/ext/couchbase/couchbase/protocol/cmd_decrement.hxx +131 -0
  351. data/ext/couchbase/couchbase/protocol/cmd_exists.cxx +92 -0
  352. data/ext/couchbase/couchbase/protocol/cmd_exists.hxx +121 -0
  353. data/ext/couchbase/couchbase/protocol/cmd_get.cxx +63 -0
  354. data/ext/couchbase/couchbase/protocol/cmd_get.hxx +101 -0
  355. data/ext/couchbase/couchbase/protocol/cmd_get_and_lock.cxx +68 -0
  356. data/ext/couchbase/couchbase/protocol/cmd_get_and_lock.hxx +117 -0
  357. data/ext/couchbase/couchbase/protocol/cmd_get_and_touch.cxx +70 -0
  358. data/ext/couchbase/couchbase/protocol/cmd_get_and_touch.hxx +117 -0
  359. data/ext/couchbase/couchbase/protocol/cmd_get_cluster_config.cxx +84 -0
  360. data/ext/couchbase/couchbase/protocol/cmd_get_cluster_config.hxx +89 -0
  361. data/ext/couchbase/couchbase/protocol/cmd_get_collection_id.cxx +50 -0
  362. data/ext/couchbase/couchbase/protocol/cmd_get_collection_id.hxx +98 -0
  363. data/ext/couchbase/couchbase/protocol/cmd_get_collections_manifest.cxx +44 -0
  364. data/ext/couchbase/couchbase/protocol/cmd_get_collections_manifest.hxx +84 -0
  365. data/ext/couchbase/couchbase/protocol/cmd_get_error_map.cxx +59 -0
  366. data/ext/couchbase/couchbase/protocol/cmd_get_error_map.hxx +103 -0
  367. data/ext/couchbase/couchbase/protocol/cmd_get_meta.cxx +74 -0
  368. data/ext/couchbase/couchbase/protocol/cmd_get_meta.hxx +119 -0
  369. data/ext/couchbase/couchbase/protocol/cmd_hello.cxx +66 -0
  370. data/ext/couchbase/couchbase/protocol/cmd_hello.hxx +144 -0
  371. data/ext/couchbase/couchbase/protocol/cmd_increment.cxx +117 -0
  372. data/ext/couchbase/couchbase/protocol/cmd_increment.hxx +131 -0
  373. data/ext/couchbase/couchbase/protocol/cmd_info.hxx +29 -0
  374. data/ext/couchbase/couchbase/protocol/cmd_insert.cxx +92 -0
  375. data/ext/couchbase/couchbase/protocol/cmd_insert.hxx +123 -0
  376. data/ext/couchbase/couchbase/protocol/cmd_lookup_in.cxx +109 -0
  377. data/ext/couchbase/couchbase/protocol/cmd_lookup_in.hxx +165 -0
  378. data/ext/couchbase/couchbase/protocol/cmd_mutate_in.cxx +174 -0
  379. data/ext/couchbase/couchbase/protocol/cmd_mutate_in.hxx +311 -0
  380. data/ext/couchbase/couchbase/protocol/cmd_noop.cxx +36 -0
  381. data/ext/couchbase/couchbase/protocol/cmd_noop.hxx +75 -0
  382. data/ext/couchbase/couchbase/protocol/cmd_prepend.cxx +82 -0
  383. data/ext/couchbase/couchbase/protocol/cmd_prepend.hxx +102 -0
  384. data/ext/couchbase/couchbase/protocol/cmd_remove.cxx +83 -0
  385. data/ext/couchbase/couchbase/protocol/cmd_remove.hxx +93 -0
  386. data/ext/couchbase/couchbase/protocol/cmd_replace.cxx +105 -0
  387. data/ext/couchbase/couchbase/protocol/cmd_replace.hxx +130 -0
  388. data/ext/couchbase/couchbase/protocol/cmd_sasl_auth.cxx +40 -0
  389. data/ext/couchbase/couchbase/protocol/cmd_sasl_auth.hxx +97 -0
  390. data/ext/couchbase/couchbase/protocol/cmd_sasl_list_mechs.cxx +48 -0
  391. data/ext/couchbase/couchbase/protocol/cmd_sasl_list_mechs.hxx +82 -0
  392. data/ext/couchbase/couchbase/protocol/cmd_sasl_step.cxx +40 -0
  393. data/ext/couchbase/couchbase/protocol/cmd_sasl_step.hxx +97 -0
  394. data/ext/couchbase/couchbase/protocol/cmd_select_bucket.cxx +36 -0
  395. data/ext/couchbase/couchbase/protocol/cmd_select_bucket.hxx +82 -0
  396. data/ext/couchbase/couchbase/protocol/cmd_touch.cxx +57 -0
  397. data/ext/couchbase/couchbase/protocol/cmd_touch.hxx +84 -0
  398. data/ext/couchbase/couchbase/protocol/cmd_unlock.cxx +48 -0
  399. data/ext/couchbase/couchbase/protocol/cmd_unlock.hxx +81 -0
  400. data/ext/couchbase/couchbase/protocol/cmd_upsert.cxx +104 -0
  401. data/ext/couchbase/couchbase/protocol/cmd_upsert.hxx +125 -0
  402. data/ext/couchbase/couchbase/protocol/datatype.hxx +48 -0
  403. data/ext/couchbase/couchbase/protocol/durability_level.hxx +59 -0
  404. data/ext/couchbase/couchbase/protocol/durability_level_fmt.hxx +52 -0
  405. data/ext/couchbase/couchbase/protocol/enhanced_error_info.hxx +28 -0
  406. data/ext/couchbase/couchbase/protocol/enhanced_error_info_fmt.hxx +44 -0
  407. data/ext/couchbase/couchbase/protocol/frame_info_id.hxx +142 -0
  408. data/ext/couchbase/couchbase/protocol/frame_info_id_fmt.hxx +79 -0
  409. data/ext/couchbase/couchbase/protocol/hello_feature.hxx +186 -0
  410. data/ext/couchbase/couchbase/protocol/hello_feature_fmt.hxx +106 -0
  411. data/ext/couchbase/couchbase/protocol/magic.hxx +53 -0
  412. data/ext/couchbase/couchbase/protocol/magic_fmt.hxx +58 -0
  413. data/ext/couchbase/couchbase/protocol/server_opcode.hxx +39 -0
  414. data/ext/couchbase/couchbase/protocol/server_opcode_fmt.hxx +46 -0
  415. data/ext/couchbase/couchbase/protocol/server_request.hxx +121 -0
  416. data/ext/couchbase/couchbase/protocol/status.cxx +187 -0
  417. data/ext/couchbase/couchbase/protocol/status.hxx +180 -0
  418. data/ext/couchbase/couchbase/protocol/status_fmt.hxx +241 -0
  419. data/ext/couchbase/couchbase/query_profile_mode.hxx +27 -0
  420. data/ext/couchbase/couchbase/query_scan_consistency.hxx +23 -0
  421. data/ext/couchbase/couchbase/sasl/CMakeLists.txt +16 -0
  422. data/ext/couchbase/couchbase/sasl/client.cc +50 -0
  423. data/ext/couchbase/couchbase/sasl/client.h +128 -0
  424. data/ext/couchbase/couchbase/sasl/context.cc +34 -0
  425. data/ext/couchbase/couchbase/sasl/context.h +52 -0
  426. data/ext/couchbase/couchbase/sasl/error.h +28 -0
  427. data/ext/couchbase/couchbase/sasl/error_fmt.h +70 -0
  428. data/ext/couchbase/couchbase/sasl/mechanism.cc +45 -0
  429. data/ext/couchbase/couchbase/sasl/mechanism.h +52 -0
  430. data/ext/couchbase/couchbase/sasl/plain/plain.cc +39 -0
  431. data/ext/couchbase/couchbase/sasl/plain/plain.h +54 -0
  432. data/ext/couchbase/couchbase/sasl/scram-sha/scram-sha.cc +372 -0
  433. data/ext/couchbase/couchbase/sasl/scram-sha/scram-sha.h +184 -0
  434. data/ext/couchbase/couchbase/sasl/scram-sha/stringutils.cc +82 -0
  435. data/ext/couchbase/couchbase/sasl/scram-sha/stringutils.h +48 -0
  436. data/ext/couchbase/couchbase/search_highlight_style.hxx +23 -0
  437. data/ext/couchbase/couchbase/search_scan_consistency.hxx +23 -0
  438. data/ext/couchbase/couchbase/service_type.hxx +31 -0
  439. data/ext/couchbase/couchbase/service_type_fmt.hxx +61 -0
  440. data/ext/couchbase/couchbase/timeout_defaults.hxx +42 -0
  441. data/ext/couchbase/couchbase/topology/CMakeLists.txt +9 -0
  442. data/ext/couchbase/couchbase/topology/capabilities.hxx +43 -0
  443. data/ext/couchbase/couchbase/topology/capabilities_fmt.hxx +106 -0
  444. data/ext/couchbase/couchbase/topology/collections_manifest.hxx +42 -0
  445. data/ext/couchbase/couchbase/topology/collections_manifest_fmt.hxx +52 -0
  446. data/ext/couchbase/couchbase/topology/collections_manifest_json.hxx +50 -0
  447. data/ext/couchbase/couchbase/topology/configuration.cxx +223 -0
  448. data/ext/couchbase/couchbase/topology/configuration.hxx +120 -0
  449. data/ext/couchbase/couchbase/topology/configuration_fmt.hxx +166 -0
  450. data/ext/couchbase/couchbase/topology/configuration_json.hxx +259 -0
  451. data/ext/couchbase/couchbase/topology/error_map.hxx +149 -0
  452. data/ext/couchbase/couchbase/topology/error_map_fmt.hxx +94 -0
  453. data/ext/couchbase/couchbase/topology/error_map_json.hxx +88 -0
  454. data/ext/couchbase/couchbase/tracing/CMakeLists.txt +9 -0
  455. data/ext/couchbase/couchbase/tracing/constants.hxx +274 -0
  456. data/ext/couchbase/couchbase/tracing/noop_tracer.hxx +55 -0
  457. data/ext/couchbase/couchbase/tracing/request_tracer.hxx +79 -0
  458. data/ext/couchbase/couchbase/tracing/threshold_logging_options.hxx +68 -0
  459. data/ext/couchbase/couchbase/tracing/threshold_logging_tracer.cxx +422 -0
  460. data/ext/couchbase/couchbase/tracing/threshold_logging_tracer.hxx +49 -0
  461. data/ext/couchbase/couchbase/utils/CMakeLists.txt +17 -0
  462. data/ext/couchbase/couchbase/utils/byteswap.cxx +45 -0
  463. data/ext/couchbase/couchbase/utils/byteswap.hxx +49 -0
  464. data/ext/couchbase/couchbase/utils/connection_string.cxx +420 -0
  465. data/ext/couchbase/couchbase/utils/connection_string.hxx +76 -0
  466. data/ext/couchbase/couchbase/utils/crc32.hxx +48 -0
  467. data/ext/couchbase/couchbase/utils/duration_parser.cxx +193 -0
  468. data/ext/couchbase/couchbase/utils/duration_parser.hxx +45 -0
  469. data/ext/couchbase/couchbase/utils/join_strings.hxx +65 -0
  470. data/ext/couchbase/couchbase/utils/json.cxx +71 -0
  471. data/ext/couchbase/couchbase/utils/json.hxx +37 -0
  472. data/ext/couchbase/couchbase/utils/json_stream_control.hxx +32 -0
  473. data/ext/couchbase/couchbase/utils/json_streaming_lexer.cxx +394 -0
  474. data/ext/couchbase/couchbase/utils/json_streaming_lexer.hxx +58 -0
  475. data/ext/couchbase/couchbase/utils/movable_function.hxx +110 -0
  476. data/ext/couchbase/couchbase/utils/name_codec.hxx +41 -0
  477. data/ext/couchbase/couchbase/utils/unsigned_leb128.hxx +181 -0
  478. data/ext/couchbase/couchbase/utils/url_codec.cxx +404 -0
  479. data/ext/couchbase/couchbase/utils/url_codec.hxx +72 -0
  480. data/ext/couchbase/couchbase/view_scan_consistency.hxx +27 -0
  481. data/ext/couchbase/couchbase/view_sort_order.hxx +23 -0
  482. data/ext/couchbase/test/CMakeLists.txt +22 -0
  483. data/ext/couchbase/test/benchmark_helper_integration.hxx +22 -0
  484. data/ext/couchbase/test/benchmark_integration_get.cxx +45 -0
  485. data/ext/couchbase/test/test_helper.hxx +25 -0
  486. data/ext/couchbase/test/test_helper_integration.hxx +24 -0
  487. data/ext/couchbase/test/test_integration_arithmetic.cxx +112 -0
  488. data/ext/couchbase/test/test_integration_binary_operations.cxx +115 -0
  489. data/ext/couchbase/test/test_integration_collections.cxx +176 -0
  490. data/ext/couchbase/test/test_integration_connect.cxx +148 -0
  491. data/ext/couchbase/test/test_integration_crud.cxx +726 -0
  492. data/ext/couchbase/test/test_integration_diagnostics.cxx +365 -0
  493. data/ext/couchbase/test/test_integration_durability.cxx +82 -0
  494. data/ext/couchbase/test/test_integration_management.cxx +2657 -0
  495. data/ext/couchbase/test/test_integration_query.cxx +407 -0
  496. data/ext/couchbase/test/test_integration_subdoc.cxx +893 -0
  497. data/ext/couchbase/test/test_unit_connection_string.cxx +379 -0
  498. data/ext/couchbase/test/test_unit_json_streaming_lexer.cxx +115 -0
  499. data/ext/couchbase/test/test_unit_jsonsl.cxx +511 -0
  500. data/ext/couchbase/test/test_unit_utils.cxx +127 -0
  501. data/ext/couchbase/third_party/asio/asio/include/asio/any_io_executor.hpp +301 -0
  502. data/ext/couchbase/third_party/asio/asio/include/asio/associated_allocator.hpp +177 -0
  503. data/ext/couchbase/third_party/asio/asio/include/asio/associated_cancellation_slot.hpp +177 -0
  504. data/ext/couchbase/third_party/asio/asio/include/asio/associated_executor.hpp +222 -0
  505. data/ext/couchbase/third_party/asio/asio/include/asio/associator.hpp +35 -0
  506. data/ext/couchbase/third_party/asio/asio/include/asio/async_result.hpp +1271 -0
  507. data/ext/couchbase/third_party/asio/asio/include/asio/awaitable.hpp +133 -0
  508. data/ext/couchbase/third_party/asio/asio/include/asio/basic_datagram_socket.hpp +1303 -0
  509. data/ext/couchbase/third_party/asio/asio/include/asio/basic_deadline_timer.hpp +703 -0
  510. data/ext/couchbase/third_party/asio/asio/include/asio/basic_file.hpp +829 -0
  511. data/ext/couchbase/third_party/asio/asio/include/asio/basic_io_object.hpp +290 -0
  512. data/ext/couchbase/third_party/asio/asio/include/asio/basic_random_access_file.hpp +677 -0
  513. data/ext/couchbase/third_party/asio/asio/include/asio/basic_raw_socket.hpp +1294 -0
  514. data/ext/couchbase/third_party/asio/asio/include/asio/basic_readable_pipe.hpp +523 -0
  515. data/ext/couchbase/third_party/asio/asio/include/asio/basic_seq_packet_socket.hpp +798 -0
  516. data/ext/couchbase/third_party/asio/asio/include/asio/basic_serial_port.hpp +907 -0
  517. data/ext/couchbase/third_party/asio/asio/include/asio/basic_signal_set.hpp +576 -0
  518. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket.hpp +1923 -0
  519. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket_acceptor.hpp +2606 -0
  520. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket_iostream.hpp +407 -0
  521. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket_streambuf.hpp +687 -0
  522. data/ext/couchbase/third_party/asio/asio/include/asio/basic_stream_file.hpp +730 -0
  523. data/ext/couchbase/third_party/asio/asio/include/asio/basic_stream_socket.hpp +1120 -0
  524. data/ext/couchbase/third_party/asio/asio/include/asio/basic_streambuf.hpp +452 -0
  525. data/ext/couchbase/third_party/asio/asio/include/asio/basic_streambuf_fwd.hpp +36 -0
  526. data/ext/couchbase/third_party/asio/asio/include/asio/basic_waitable_timer.hpp +821 -0
  527. data/ext/couchbase/third_party/asio/asio/include/asio/basic_writable_pipe.hpp +519 -0
  528. data/ext/couchbase/third_party/asio/asio/include/asio/bind_cancellation_slot.hpp +721 -0
  529. data/ext/couchbase/third_party/asio/asio/include/asio/bind_executor.hpp +754 -0
  530. data/ext/couchbase/third_party/asio/asio/include/asio/buffer.hpp +2496 -0
  531. data/ext/couchbase/third_party/asio/asio/include/asio/buffer_registration.hpp +327 -0
  532. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_read_stream.hpp +253 -0
  533. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_read_stream_fwd.hpp +25 -0
  534. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_stream.hpp +279 -0
  535. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_stream_fwd.hpp +25 -0
  536. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_write_stream.hpp +245 -0
  537. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_write_stream_fwd.hpp +25 -0
  538. data/ext/couchbase/third_party/asio/asio/include/asio/buffers_iterator.hpp +521 -0
  539. data/ext/couchbase/third_party/asio/asio/include/asio/cancellation_signal.hpp +305 -0
  540. data/ext/couchbase/third_party/asio/asio/include/asio/cancellation_state.hpp +235 -0
  541. data/ext/couchbase/third_party/asio/asio/include/asio/cancellation_type.hpp +174 -0
  542. data/ext/couchbase/third_party/asio/asio/include/asio/co_spawn.hpp +499 -0
  543. data/ext/couchbase/third_party/asio/asio/include/asio/completion_condition.hpp +218 -0
  544. data/ext/couchbase/third_party/asio/asio/include/asio/compose.hpp +136 -0
  545. data/ext/couchbase/third_party/asio/asio/include/asio/connect.hpp +1136 -0
  546. data/ext/couchbase/third_party/asio/asio/include/asio/connect_pipe.hpp +83 -0
  547. data/ext/couchbase/third_party/asio/asio/include/asio/coroutine.hpp +328 -0
  548. data/ext/couchbase/third_party/asio/asio/include/asio/deadline_timer.hpp +38 -0
  549. data/ext/couchbase/third_party/asio/asio/include/asio/defer.hpp +130 -0
  550. data/ext/couchbase/third_party/asio/asio/include/asio/detached.hpp +112 -0
  551. data/ext/couchbase/third_party/asio/asio/include/asio/detail/array.hpp +38 -0
  552. data/ext/couchbase/third_party/asio/asio/include/asio/detail/array_fwd.hpp +34 -0
  553. data/ext/couchbase/third_party/asio/asio/include/asio/detail/assert.hpp +32 -0
  554. data/ext/couchbase/third_party/asio/asio/include/asio/detail/atomic_count.hpp +67 -0
  555. data/ext/couchbase/third_party/asio/asio/include/asio/detail/base_from_cancellation_state.hpp +163 -0
  556. data/ext/couchbase/third_party/asio/asio/include/asio/detail/base_from_completion_cond.hpp +69 -0
  557. data/ext/couchbase/third_party/asio/asio/include/asio/detail/bind_handler.hpp +1071 -0
  558. data/ext/couchbase/third_party/asio/asio/include/asio/detail/blocking_executor_op.hpp +107 -0
  559. data/ext/couchbase/third_party/asio/asio/include/asio/detail/buffer_resize_guard.hpp +66 -0
  560. data/ext/couchbase/third_party/asio/asio/include/asio/detail/buffer_sequence_adapter.hpp +841 -0
  561. data/ext/couchbase/third_party/asio/asio/include/asio/detail/buffered_stream_storage.hpp +126 -0
  562. data/ext/couchbase/third_party/asio/asio/include/asio/detail/bulk_executor_op.hpp +88 -0
  563. data/ext/couchbase/third_party/asio/asio/include/asio/detail/call_stack.hpp +125 -0
  564. data/ext/couchbase/third_party/asio/asio/include/asio/detail/chrono.hpp +66 -0
  565. data/ext/couchbase/third_party/asio/asio/include/asio/detail/chrono_time_traits.hpp +190 -0
  566. data/ext/couchbase/third_party/asio/asio/include/asio/detail/completion_handler.hpp +88 -0
  567. data/ext/couchbase/third_party/asio/asio/include/asio/detail/concurrency_hint.hpp +94 -0
  568. data/ext/couchbase/third_party/asio/asio/include/asio/detail/conditionally_enabled_event.hpp +120 -0
  569. data/ext/couchbase/third_party/asio/asio/include/asio/detail/conditionally_enabled_mutex.hpp +149 -0
  570. data/ext/couchbase/third_party/asio/asio/include/asio/detail/config.hpp +1998 -0
  571. data/ext/couchbase/third_party/asio/asio/include/asio/detail/consuming_buffers.hpp +451 -0
  572. data/ext/couchbase/third_party/asio/asio/include/asio/detail/cstddef.hpp +31 -0
  573. data/ext/couchbase/third_party/asio/asio/include/asio/detail/cstdint.hpp +62 -0
  574. data/ext/couchbase/third_party/asio/asio/include/asio/detail/date_time_fwd.hpp +34 -0
  575. data/ext/couchbase/third_party/asio/asio/include/asio/detail/deadline_timer_service.hpp +335 -0
  576. data/ext/couchbase/third_party/asio/asio/include/asio/detail/dependent_type.hpp +36 -0
  577. data/ext/couchbase/third_party/asio/asio/include/asio/detail/descriptor_ops.hpp +179 -0
  578. data/ext/couchbase/third_party/asio/asio/include/asio/detail/descriptor_read_op.hpp +148 -0
  579. data/ext/couchbase/third_party/asio/asio/include/asio/detail/descriptor_write_op.hpp +148 -0
  580. data/ext/couchbase/third_party/asio/asio/include/asio/detail/dev_poll_reactor.hpp +230 -0
  581. data/ext/couchbase/third_party/asio/asio/include/asio/detail/epoll_reactor.hpp +278 -0
  582. data/ext/couchbase/third_party/asio/asio/include/asio/detail/event.hpp +48 -0
  583. data/ext/couchbase/third_party/asio/asio/include/asio/detail/eventfd_select_interrupter.hpp +83 -0
  584. data/ext/couchbase/third_party/asio/asio/include/asio/detail/executor_function.hpp +204 -0
  585. data/ext/couchbase/third_party/asio/asio/include/asio/detail/executor_op.hpp +84 -0
  586. data/ext/couchbase/third_party/asio/asio/include/asio/detail/fd_set_adapter.hpp +39 -0
  587. data/ext/couchbase/third_party/asio/asio/include/asio/detail/fenced_block.hpp +80 -0
  588. data/ext/couchbase/third_party/asio/asio/include/asio/detail/functional.hpp +44 -0
  589. data/ext/couchbase/third_party/asio/asio/include/asio/detail/future.hpp +33 -0
  590. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_arm_fenced_block.hpp +91 -0
  591. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_hppa_fenced_block.hpp +68 -0
  592. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_sync_fenced_block.hpp +65 -0
  593. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_x86_fenced_block.hpp +99 -0
  594. data/ext/couchbase/third_party/asio/asio/include/asio/detail/global.hpp +52 -0
  595. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_alloc_helpers.hpp +288 -0
  596. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_cont_helpers.hpp +45 -0
  597. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_invoke_helpers.hpp +80 -0
  598. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_tracking.hpp +264 -0
  599. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_type_requirements.hpp +559 -0
  600. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_work.hpp +525 -0
  601. data/ext/couchbase/third_party/asio/asio/include/asio/detail/hash_map.hpp +331 -0
  602. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp +118 -0
  603. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/descriptor_ops.ipp +933 -0
  604. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/dev_poll_reactor.hpp +111 -0
  605. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/dev_poll_reactor.ipp +460 -0
  606. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/epoll_reactor.hpp +109 -0
  607. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/epoll_reactor.ipp +817 -0
  608. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp +171 -0
  609. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/handler_tracking.ipp +396 -0
  610. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_descriptor_service.ipp +202 -0
  611. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_file_service.ipp +131 -0
  612. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_service.hpp +112 -0
  613. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_service.ipp +879 -0
  614. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_socket_service_base.ipp +249 -0
  615. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/kqueue_reactor.hpp +113 -0
  616. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/kqueue_reactor.ipp +599 -0
  617. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/null_event.ipp +74 -0
  618. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/pipe_select_interrupter.ipp +129 -0
  619. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_event.ipp +63 -0
  620. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_mutex.ipp +46 -0
  621. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_serial_port_service.ipp +149 -0
  622. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_thread.ipp +84 -0
  623. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_tss_ptr.ipp +46 -0
  624. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/reactive_descriptor_service.ipp +225 -0
  625. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/reactive_socket_service_base.ipp +302 -0
  626. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/resolver_service_base.ipp +158 -0
  627. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/scheduler.ipp +674 -0
  628. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/select_reactor.hpp +124 -0
  629. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/select_reactor.ipp +357 -0
  630. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/service_registry.hpp +94 -0
  631. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/service_registry.ipp +197 -0
  632. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/signal_set_service.ipp +746 -0
  633. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/socket_ops.ipp +3964 -0
  634. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/socket_select_interrupter.ipp +185 -0
  635. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_executor_service.hpp +354 -0
  636. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_executor_service.ipp +158 -0
  637. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_service.hpp +87 -0
  638. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_service.ipp +202 -0
  639. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/thread_context.ipp +35 -0
  640. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/throw_error.ipp +66 -0
  641. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/timer_queue_ptime.ipp +97 -0
  642. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/timer_queue_set.ipp +101 -0
  643. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_event.ipp +76 -0
  644. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_file_service.ipp +250 -0
  645. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_handle_service.ipp +525 -0
  646. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_io_context.hpp +120 -0
  647. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_io_context.ipp +608 -0
  648. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp +192 -0
  649. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp +821 -0
  650. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_mutex.ipp +84 -0
  651. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_object_handle_service.ipp +448 -0
  652. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_static_mutex.ipp +136 -0
  653. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_thread.ipp +150 -0
  654. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_tss_ptr.ipp +57 -0
  655. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp +626 -0
  656. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp +92 -0
  657. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp +121 -0
  658. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winsock_init.ipp +82 -0
  659. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_control.hpp +84 -0
  660. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_object_impl.hpp +172 -0
  661. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_read_at_op.hpp +190 -0
  662. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_read_op.hpp +185 -0
  663. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_service.hpp +661 -0
  664. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_write_at_op.hpp +184 -0
  665. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_write_op.hpp +180 -0
  666. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_file_service.hpp +251 -0
  667. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_null_buffers_op.hpp +111 -0
  668. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_operation.hpp +84 -0
  669. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_service.hpp +318 -0
  670. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_accept_op.hpp +277 -0
  671. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_connect_op.hpp +137 -0
  672. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_recv_op.hpp +200 -0
  673. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_recvfrom_op.hpp +201 -0
  674. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_recvmsg_op.hpp +187 -0
  675. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_send_op.hpp +186 -0
  676. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_sendto_op.hpp +189 -0
  677. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_service.hpp +613 -0
  678. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_service_base.hpp +663 -0
  679. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_wait_op.hpp +109 -0
  680. data/ext/couchbase/third_party/asio/asio/include/asio/detail/is_buffer_sequence.hpp +338 -0
  681. data/ext/couchbase/third_party/asio/asio/include/asio/detail/is_executor.hpp +126 -0
  682. data/ext/couchbase/third_party/asio/asio/include/asio/detail/keyword_tss_ptr.hpp +70 -0
  683. data/ext/couchbase/third_party/asio/asio/include/asio/detail/kqueue_reactor.hpp +254 -0
  684. data/ext/couchbase/third_party/asio/asio/include/asio/detail/limits.hpp +26 -0
  685. data/ext/couchbase/third_party/asio/asio/include/asio/detail/local_free_on_block_exit.hpp +59 -0
  686. data/ext/couchbase/third_party/asio/asio/include/asio/detail/macos_fenced_block.hpp +62 -0
  687. data/ext/couchbase/third_party/asio/asio/include/asio/detail/memory.hpp +133 -0
  688. data/ext/couchbase/third_party/asio/asio/include/asio/detail/mutex.hpp +48 -0
  689. data/ext/couchbase/third_party/asio/asio/include/asio/detail/non_const_lvalue.hpp +54 -0
  690. data/ext/couchbase/third_party/asio/asio/include/asio/detail/noncopyable.hpp +43 -0
  691. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_event.hpp +106 -0
  692. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_fenced_block.hpp +47 -0
  693. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_global.hpp +59 -0
  694. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_mutex.hpp +60 -0
  695. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_reactor.hpp +83 -0
  696. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_signal_blocker.hpp +69 -0
  697. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_socket_service.hpp +519 -0
  698. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_static_mutex.hpp +60 -0
  699. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_thread.hpp +67 -0
  700. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_tss_ptr.hpp +68 -0
  701. data/ext/couchbase/third_party/asio/asio/include/asio/detail/object_pool.hpp +171 -0
  702. data/ext/couchbase/third_party/asio/asio/include/asio/detail/old_win_sdk_compat.hpp +214 -0
  703. data/ext/couchbase/third_party/asio/asio/include/asio/detail/op_queue.hpp +162 -0
  704. data/ext/couchbase/third_party/asio/asio/include/asio/detail/operation.hpp +38 -0
  705. data/ext/couchbase/third_party/asio/asio/include/asio/detail/pipe_select_interrupter.hpp +89 -0
  706. data/ext/couchbase/third_party/asio/asio/include/asio/detail/pop_options.hpp +153 -0
  707. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_event.hpp +175 -0
  708. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_fd_set_adapter.hpp +118 -0
  709. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_global.hpp +80 -0
  710. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_mutex.hpp +76 -0
  711. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_serial_port_service.hpp +248 -0
  712. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_signal_blocker.hpp +85 -0
  713. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_static_mutex.hpp +64 -0
  714. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_thread.hpp +109 -0
  715. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_tss_ptr.hpp +79 -0
  716. data/ext/couchbase/third_party/asio/asio/include/asio/detail/push_options.hpp +219 -0
  717. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_descriptor_service.hpp +511 -0
  718. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_null_buffers_op.hpp +98 -0
  719. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_accept_op.hpp +242 -0
  720. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_connect_op.hpp +123 -0
  721. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_recv_op.hpp +159 -0
  722. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp +164 -0
  723. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp +145 -0
  724. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_send_op.hpp +162 -0
  725. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_sendto_op.hpp +156 -0
  726. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_service.hpp +607 -0
  727. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_service_base.hpp +654 -0
  728. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_wait_op.hpp +98 -0
  729. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactor.hpp +54 -0
  730. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactor_op.hpp +71 -0
  731. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactor_op_queue.hpp +212 -0
  732. data/ext/couchbase/third_party/asio/asio/include/asio/detail/recycling_allocator.hpp +105 -0
  733. data/ext/couchbase/third_party/asio/asio/include/asio/detail/regex_fwd.hpp +44 -0
  734. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolve_endpoint_op.hpp +140 -0
  735. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolve_op.hpp +45 -0
  736. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolve_query_op.hpp +150 -0
  737. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolver_service.hpp +145 -0
  738. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolver_service_base.hpp +158 -0
  739. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler.hpp +241 -0
  740. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler_operation.hpp +78 -0
  741. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler_task.hpp +49 -0
  742. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler_thread_info.hpp +40 -0
  743. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scoped_lock.hpp +101 -0
  744. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scoped_ptr.hpp +87 -0
  745. data/ext/couchbase/third_party/asio/asio/include/asio/detail/select_interrupter.hpp +46 -0
  746. data/ext/couchbase/third_party/asio/asio/include/asio/detail/select_reactor.hpp +252 -0
  747. data/ext/couchbase/third_party/asio/asio/include/asio/detail/service_registry.hpp +164 -0
  748. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_blocker.hpp +44 -0
  749. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_handler.hpp +90 -0
  750. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_init.hpp +47 -0
  751. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_op.hpp +49 -0
  752. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_set_service.hpp +241 -0
  753. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_holder.hpp +98 -0
  754. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_ops.hpp +383 -0
  755. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_option.hpp +316 -0
  756. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_select_interrupter.hpp +91 -0
  757. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_types.hpp +417 -0
  758. data/ext/couchbase/third_party/asio/asio/include/asio/detail/solaris_fenced_block.hpp +62 -0
  759. data/ext/couchbase/third_party/asio/asio/include/asio/detail/source_location.hpp +45 -0
  760. data/ext/couchbase/third_party/asio/asio/include/asio/detail/static_mutex.hpp +52 -0
  761. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_event.hpp +188 -0
  762. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_fenced_block.hpp +62 -0
  763. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_global.hpp +70 -0
  764. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_mutex.hpp +73 -0
  765. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_static_mutex.hpp +81 -0
  766. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_thread.hpp +71 -0
  767. data/ext/couchbase/third_party/asio/asio/include/asio/detail/strand_executor_service.hpp +173 -0
  768. data/ext/couchbase/third_party/asio/asio/include/asio/detail/strand_service.hpp +144 -0
  769. data/ext/couchbase/third_party/asio/asio/include/asio/detail/string_view.hpp +47 -0
  770. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread.hpp +60 -0
  771. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread_context.hpp +51 -0
  772. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread_group.hpp +99 -0
  773. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread_info_base.hpp +260 -0
  774. data/ext/couchbase/third_party/asio/asio/include/asio/detail/throw_error.hpp +53 -0
  775. data/ext/couchbase/third_party/asio/asio/include/asio/detail/throw_exception.hpp +51 -0
  776. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue.hpp +389 -0
  777. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue_base.hpp +68 -0
  778. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue_ptime.hpp +103 -0
  779. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue_set.hpp +66 -0
  780. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_scheduler.hpp +37 -0
  781. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_scheduler_fwd.hpp +42 -0
  782. data/ext/couchbase/third_party/asio/asio/include/asio/detail/tss_ptr.hpp +69 -0
  783. data/ext/couchbase/third_party/asio/asio/include/asio/detail/type_traits.hpp +156 -0
  784. data/ext/couchbase/third_party/asio/asio/include/asio/detail/variadic_templates.hpp +294 -0
  785. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wait_handler.hpp +90 -0
  786. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wait_op.hpp +49 -0
  787. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_event.hpp +164 -0
  788. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_fd_set_adapter.hpp +149 -0
  789. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_fenced_block.hpp +90 -0
  790. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_global.hpp +71 -0
  791. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_file_service.hpp +280 -0
  792. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_handle_read_op.hpp +117 -0
  793. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_handle_service.hpp +403 -0
  794. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_handle_write_op.hpp +110 -0
  795. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_io_context.hpp +345 -0
  796. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_null_buffers_op.hpp +127 -0
  797. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_operation.hpp +96 -0
  798. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_overlapped_op.hpp +96 -0
  799. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp +171 -0
  800. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_serial_port_service.hpp +232 -0
  801. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_accept_op.hpp +338 -0
  802. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_connect_op.hpp +135 -0
  803. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_recv_op.hpp +124 -0
  804. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp +133 -0
  805. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp +125 -0
  806. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_send_op.hpp +118 -0
  807. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_service.hpp +659 -0
  808. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_service_base.hpp +832 -0
  809. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_thread_info.hpp +34 -0
  810. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_wait_op.hpp +128 -0
  811. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_mutex.hpp +78 -0
  812. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_object_handle_service.hpp +195 -0
  813. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_static_mutex.hpp +74 -0
  814. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_thread.hpp +147 -0
  815. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_tss_ptr.hpp +79 -0
  816. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winapp_thread.hpp +124 -0
  817. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wince_thread.hpp +124 -0
  818. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_async_manager.hpp +305 -0
  819. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_async_op.hpp +65 -0
  820. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_resolve_op.hpp +125 -0
  821. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_resolver_service.hpp +212 -0
  822. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_socket_connect_op.hpp +98 -0
  823. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_socket_recv_op.hpp +119 -0
  824. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_socket_send_op.hpp +110 -0
  825. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_ssocket_service.hpp +250 -0
  826. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_ssocket_service_base.hpp +362 -0
  827. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_timer_scheduler.hpp +147 -0
  828. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_utils.hpp +106 -0
  829. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winsock_init.hpp +128 -0
  830. data/ext/couchbase/third_party/asio/asio/include/asio/detail/work_dispatcher.hpp +151 -0
  831. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wrapped_handler.hpp +327 -0
  832. data/ext/couchbase/third_party/asio/asio/include/asio/dispatch.hpp +121 -0
  833. data/ext/couchbase/third_party/asio/asio/include/asio/error.hpp +356 -0
  834. data/ext/couchbase/third_party/asio/asio/include/asio/error_code.hpp +202 -0
  835. data/ext/couchbase/third_party/asio/asio/include/asio/execution/allocator.hpp +337 -0
  836. data/ext/couchbase/third_party/asio/asio/include/asio/execution/any_executor.hpp +2351 -0
  837. data/ext/couchbase/third_party/asio/asio/include/asio/execution/bad_executor.hpp +47 -0
  838. data/ext/couchbase/third_party/asio/asio/include/asio/execution/blocking.hpp +1551 -0
  839. data/ext/couchbase/third_party/asio/asio/include/asio/execution/blocking_adaptation.hpp +1212 -0
  840. data/ext/couchbase/third_party/asio/asio/include/asio/execution/bulk_execute.hpp +397 -0
  841. data/ext/couchbase/third_party/asio/asio/include/asio/execution/bulk_guarantee.hpp +1215 -0
  842. data/ext/couchbase/third_party/asio/asio/include/asio/execution/connect.hpp +489 -0
  843. data/ext/couchbase/third_party/asio/asio/include/asio/execution/context.hpp +233 -0
  844. data/ext/couchbase/third_party/asio/asio/include/asio/execution/context_as.hpp +221 -0
  845. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/as_invocable.hpp +152 -0
  846. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/as_operation.hpp +105 -0
  847. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/as_receiver.hpp +128 -0
  848. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/bulk_sender.hpp +261 -0
  849. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/submit_receiver.hpp +233 -0
  850. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/void_receiver.hpp +90 -0
  851. data/ext/couchbase/third_party/asio/asio/include/asio/execution/execute.hpp +283 -0
  852. data/ext/couchbase/third_party/asio/asio/include/asio/execution/executor.hpp +252 -0
  853. data/ext/couchbase/third_party/asio/asio/include/asio/execution/impl/bad_executor.ipp +40 -0
  854. data/ext/couchbase/third_party/asio/asio/include/asio/execution/impl/receiver_invocation_error.ipp +36 -0
  855. data/ext/couchbase/third_party/asio/asio/include/asio/execution/invocable_archetype.hpp +71 -0
  856. data/ext/couchbase/third_party/asio/asio/include/asio/execution/mapping.hpp +1116 -0
  857. data/ext/couchbase/third_party/asio/asio/include/asio/execution/occupancy.hpp +226 -0
  858. data/ext/couchbase/third_party/asio/asio/include/asio/execution/operation_state.hpp +94 -0
  859. data/ext/couchbase/third_party/asio/asio/include/asio/execution/outstanding_work.hpp +867 -0
  860. data/ext/couchbase/third_party/asio/asio/include/asio/execution/prefer_only.hpp +331 -0
  861. data/ext/couchbase/third_party/asio/asio/include/asio/execution/receiver.hpp +280 -0
  862. data/ext/couchbase/third_party/asio/asio/include/asio/execution/receiver_invocation_error.hpp +48 -0
  863. data/ext/couchbase/third_party/asio/asio/include/asio/execution/relationship.hpp +865 -0
  864. data/ext/couchbase/third_party/asio/asio/include/asio/execution/schedule.hpp +287 -0
  865. data/ext/couchbase/third_party/asio/asio/include/asio/execution/scheduler.hpp +86 -0
  866. data/ext/couchbase/third_party/asio/asio/include/asio/execution/sender.hpp +311 -0
  867. data/ext/couchbase/third_party/asio/asio/include/asio/execution/set_done.hpp +250 -0
  868. data/ext/couchbase/third_party/asio/asio/include/asio/execution/set_error.hpp +250 -0
  869. data/ext/couchbase/third_party/asio/asio/include/asio/execution/set_value.hpp +483 -0
  870. data/ext/couchbase/third_party/asio/asio/include/asio/execution/start.hpp +247 -0
  871. data/ext/couchbase/third_party/asio/asio/include/asio/execution/submit.hpp +450 -0
  872. data/ext/couchbase/third_party/asio/asio/include/asio/execution.hpp +48 -0
  873. data/ext/couchbase/third_party/asio/asio/include/asio/execution_context.hpp +412 -0
  874. data/ext/couchbase/third_party/asio/asio/include/asio/executor.hpp +347 -0
  875. data/ext/couchbase/third_party/asio/asio/include/asio/executor_work_guard.hpp +302 -0
  876. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/append.hpp +71 -0
  877. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/as_single.hpp +135 -0
  878. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/as_tuple.hpp +131 -0
  879. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/awaitable_operators.hpp +536 -0
  880. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/basic_channel.hpp +415 -0
  881. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/basic_concurrent_channel.hpp +424 -0
  882. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/cancellation_condition.hpp +155 -0
  883. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/channel.hpp +70 -0
  884. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp +84 -0
  885. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_traits.hpp +231 -0
  886. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/co_spawn.hpp +191 -0
  887. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/concurrent_channel.hpp +70 -0
  888. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/coro.hpp +263 -0
  889. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/coro_traits.hpp +228 -0
  890. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/deferred.hpp +605 -0
  891. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_handler.hpp +70 -0
  892. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_message.hpp +122 -0
  893. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_operation.hpp +199 -0
  894. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_payload.hpp +93 -0
  895. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_receive_op.hpp +112 -0
  896. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_send_functions.hpp +131 -0
  897. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_send_op.hpp +140 -0
  898. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_service.hpp +497 -0
  899. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/completion_handler_erasure.hpp +158 -0
  900. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/coro_promise_allocator.hpp +118 -0
  901. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/has_signature.hpp +54 -0
  902. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/impl/channel_service.hpp +611 -0
  903. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/partial_promise.hpp +176 -0
  904. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/append.hpp +217 -0
  905. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/as_single.hpp +229 -0
  906. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/as_tuple.hpp +246 -0
  907. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/channel_error.ipp +61 -0
  908. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/coro.hpp +1204 -0
  909. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/deferred.hpp +104 -0
  910. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/parallel_group.hpp +432 -0
  911. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/prepend.hpp +217 -0
  912. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/promise.hpp +102 -0
  913. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/use_coro.hpp +267 -0
  914. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/parallel_group.hpp +215 -0
  915. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/prepend.hpp +71 -0
  916. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/promise.hpp +610 -0
  917. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/use_coro.hpp +169 -0
  918. data/ext/couchbase/third_party/asio/asio/include/asio/file_base.hpp +160 -0
  919. data/ext/couchbase/third_party/asio/asio/include/asio/generic/basic_endpoint.hpp +193 -0
  920. data/ext/couchbase/third_party/asio/asio/include/asio/generic/datagram_protocol.hpp +123 -0
  921. data/ext/couchbase/third_party/asio/asio/include/asio/generic/detail/endpoint.hpp +133 -0
  922. data/ext/couchbase/third_party/asio/asio/include/asio/generic/detail/impl/endpoint.ipp +110 -0
  923. data/ext/couchbase/third_party/asio/asio/include/asio/generic/raw_protocol.hpp +121 -0
  924. data/ext/couchbase/third_party/asio/asio/include/asio/generic/seq_packet_protocol.hpp +122 -0
  925. data/ext/couchbase/third_party/asio/asio/include/asio/generic/stream_protocol.hpp +127 -0
  926. data/ext/couchbase/third_party/asio/asio/include/asio/handler_alloc_hook.hpp +104 -0
  927. data/ext/couchbase/third_party/asio/asio/include/asio/handler_continuation_hook.hpp +54 -0
  928. data/ext/couchbase/third_party/asio/asio/include/asio/handler_invoke_hook.hpp +111 -0
  929. data/ext/couchbase/third_party/asio/asio/include/asio/high_resolution_timer.hpp +44 -0
  930. data/ext/couchbase/third_party/asio/asio/include/asio/impl/any_io_executor.ipp +124 -0
  931. data/ext/couchbase/third_party/asio/asio/include/asio/impl/awaitable.hpp +760 -0
  932. data/ext/couchbase/third_party/asio/asio/include/asio/impl/buffered_read_stream.hpp +498 -0
  933. data/ext/couchbase/third_party/asio/asio/include/asio/impl/buffered_write_stream.hpp +478 -0
  934. data/ext/couchbase/third_party/asio/asio/include/asio/impl/cancellation_signal.ipp +96 -0
  935. data/ext/couchbase/third_party/asio/asio/include/asio/impl/co_spawn.hpp +346 -0
  936. data/ext/couchbase/third_party/asio/asio/include/asio/impl/compose.hpp +707 -0
  937. data/ext/couchbase/third_party/asio/asio/include/asio/impl/connect.hpp +905 -0
  938. data/ext/couchbase/third_party/asio/asio/include/asio/impl/connect_pipe.hpp +73 -0
  939. data/ext/couchbase/third_party/asio/asio/include/asio/impl/connect_pipe.ipp +149 -0
  940. data/ext/couchbase/third_party/asio/asio/include/asio/impl/defer.hpp +256 -0
  941. data/ext/couchbase/third_party/asio/asio/include/asio/impl/detached.hpp +130 -0
  942. data/ext/couchbase/third_party/asio/asio/include/asio/impl/dispatch.hpp +251 -0
  943. data/ext/couchbase/third_party/asio/asio/include/asio/impl/error.ipp +128 -0
  944. data/ext/couchbase/third_party/asio/asio/include/asio/impl/error_code.ipp +206 -0
  945. data/ext/couchbase/third_party/asio/asio/include/asio/impl/execution_context.hpp +109 -0
  946. data/ext/couchbase/third_party/asio/asio/include/asio/impl/execution_context.ipp +82 -0
  947. data/ext/couchbase/third_party/asio/asio/include/asio/impl/executor.hpp +300 -0
  948. data/ext/couchbase/third_party/asio/asio/include/asio/impl/executor.ipp +43 -0
  949. data/ext/couchbase/third_party/asio/asio/include/asio/impl/handler_alloc_hook.ipp +62 -0
  950. data/ext/couchbase/third_party/asio/asio/include/asio/impl/io_context.hpp +444 -0
  951. data/ext/couchbase/third_party/asio/asio/include/asio/impl/io_context.ipp +175 -0
  952. data/ext/couchbase/third_party/asio/asio/include/asio/impl/multiple_exceptions.ipp +49 -0
  953. data/ext/couchbase/third_party/asio/asio/include/asio/impl/post.hpp +256 -0
  954. data/ext/couchbase/third_party/asio/asio/include/asio/impl/read.hpp +1199 -0
  955. data/ext/couchbase/third_party/asio/asio/include/asio/impl/read_at.hpp +733 -0
  956. data/ext/couchbase/third_party/asio/asio/include/asio/impl/read_until.hpp +3315 -0
  957. data/ext/couchbase/third_party/asio/asio/include/asio/impl/redirect_error.hpp +609 -0
  958. data/ext/couchbase/third_party/asio/asio/include/asio/impl/serial_port_base.hpp +59 -0
  959. data/ext/couchbase/third_party/asio/asio/include/asio/impl/serial_port_base.ipp +554 -0
  960. data/ext/couchbase/third_party/asio/asio/include/asio/impl/spawn.hpp +517 -0
  961. data/ext/couchbase/third_party/asio/asio/include/asio/impl/src.hpp +95 -0
  962. data/ext/couchbase/third_party/asio/asio/include/asio/impl/system_context.hpp +34 -0
  963. data/ext/couchbase/third_party/asio/asio/include/asio/impl/system_context.ipp +92 -0
  964. data/ext/couchbase/third_party/asio/asio/include/asio/impl/system_executor.hpp +185 -0
  965. data/ext/couchbase/third_party/asio/asio/include/asio/impl/thread_pool.hpp +354 -0
  966. data/ext/couchbase/third_party/asio/asio/include/asio/impl/thread_pool.ipp +141 -0
  967. data/ext/couchbase/third_party/asio/asio/include/asio/impl/use_awaitable.hpp +291 -0
  968. data/ext/couchbase/third_party/asio/asio/include/asio/impl/use_future.hpp +1028 -0
  969. data/ext/couchbase/third_party/asio/asio/include/asio/impl/write.hpp +1100 -0
  970. data/ext/couchbase/third_party/asio/asio/include/asio/impl/write_at.hpp +644 -0
  971. data/ext/couchbase/third_party/asio/asio/include/asio/io_context.hpp +1560 -0
  972. data/ext/couchbase/third_party/asio/asio/include/asio/io_context_strand.hpp +376 -0
  973. data/ext/couchbase/third_party/asio/asio/include/asio/io_service.hpp +33 -0
  974. data/ext/couchbase/third_party/asio/asio/include/asio/io_service_strand.hpp +20 -0
  975. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address.hpp +290 -0
  976. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v4.hpp +355 -0
  977. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v4_iterator.hpp +162 -0
  978. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v4_range.hpp +134 -0
  979. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v6.hpp +382 -0
  980. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v6_iterator.hpp +183 -0
  981. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v6_range.hpp +129 -0
  982. data/ext/couchbase/third_party/asio/asio/include/asio/ip/bad_address_cast.hpp +53 -0
  983. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_endpoint.hpp +291 -0
  984. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver.hpp +1076 -0
  985. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_entry.hpp +113 -0
  986. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_iterator.hpp +192 -0
  987. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_query.hpp +244 -0
  988. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_results.hpp +311 -0
  989. data/ext/couchbase/third_party/asio/asio/include/asio/ip/detail/endpoint.hpp +141 -0
  990. data/ext/couchbase/third_party/asio/asio/include/asio/ip/detail/impl/endpoint.ipp +199 -0
  991. data/ext/couchbase/third_party/asio/asio/include/asio/ip/detail/socket_option.hpp +566 -0
  992. data/ext/couchbase/third_party/asio/asio/include/asio/ip/host_name.hpp +42 -0
  993. data/ext/couchbase/third_party/asio/asio/include/asio/ip/icmp.hpp +115 -0
  994. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address.hpp +67 -0
  995. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address.ipp +239 -0
  996. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v4.hpp +67 -0
  997. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v4.ipp +210 -0
  998. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v6.hpp +67 -0
  999. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v6.ipp +350 -0
  1000. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/basic_endpoint.hpp +43 -0
  1001. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/host_name.ipp +54 -0
  1002. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v4.hpp +54 -0
  1003. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v4.ipp +216 -0
  1004. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v6.hpp +53 -0
  1005. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v6.ipp +185 -0
  1006. data/ext/couchbase/third_party/asio/asio/include/asio/ip/multicast.hpp +191 -0
  1007. data/ext/couchbase/third_party/asio/asio/include/asio/ip/network_v4.hpp +261 -0
  1008. data/ext/couchbase/third_party/asio/asio/include/asio/ip/network_v6.hpp +235 -0
  1009. data/ext/couchbase/third_party/asio/asio/include/asio/ip/resolver_base.hpp +129 -0
  1010. data/ext/couchbase/third_party/asio/asio/include/asio/ip/resolver_query_base.hpp +43 -0
  1011. data/ext/couchbase/third_party/asio/asio/include/asio/ip/tcp.hpp +155 -0
  1012. data/ext/couchbase/third_party/asio/asio/include/asio/ip/udp.hpp +111 -0
  1013. data/ext/couchbase/third_party/asio/asio/include/asio/ip/unicast.hpp +70 -0
  1014. data/ext/couchbase/third_party/asio/asio/include/asio/ip/v6_only.hpp +69 -0
  1015. data/ext/couchbase/third_party/asio/asio/include/asio/is_applicable_property.hpp +61 -0
  1016. data/ext/couchbase/third_party/asio/asio/include/asio/is_executor.hpp +46 -0
  1017. data/ext/couchbase/third_party/asio/asio/include/asio/is_read_buffered.hpp +59 -0
  1018. data/ext/couchbase/third_party/asio/asio/include/asio/is_write_buffered.hpp +59 -0
  1019. data/ext/couchbase/third_party/asio/asio/include/asio/local/basic_endpoint.hpp +247 -0
  1020. data/ext/couchbase/third_party/asio/asio/include/asio/local/connect_pair.hpp +101 -0
  1021. data/ext/couchbase/third_party/asio/asio/include/asio/local/datagram_protocol.hpp +80 -0
  1022. data/ext/couchbase/third_party/asio/asio/include/asio/local/detail/endpoint.hpp +139 -0
  1023. data/ext/couchbase/third_party/asio/asio/include/asio/local/detail/impl/endpoint.ipp +131 -0
  1024. data/ext/couchbase/third_party/asio/asio/include/asio/local/stream_protocol.hpp +90 -0
  1025. data/ext/couchbase/third_party/asio/asio/include/asio/multiple_exceptions.hpp +58 -0
  1026. data/ext/couchbase/third_party/asio/asio/include/asio/packaged_task.hpp +126 -0
  1027. data/ext/couchbase/third_party/asio/asio/include/asio/placeholders.hpp +151 -0
  1028. data/ext/couchbase/third_party/asio/asio/include/asio/posix/basic_descriptor.hpp +720 -0
  1029. data/ext/couchbase/third_party/asio/asio/include/asio/posix/basic_stream_descriptor.hpp +501 -0
  1030. data/ext/couchbase/third_party/asio/asio/include/asio/posix/descriptor.hpp +37 -0
  1031. data/ext/couchbase/third_party/asio/asio/include/asio/posix/descriptor_base.hpp +90 -0
  1032. data/ext/couchbase/third_party/asio/asio/include/asio/posix/stream_descriptor.hpp +37 -0
  1033. data/ext/couchbase/third_party/asio/asio/include/asio/post.hpp +126 -0
  1034. data/ext/couchbase/third_party/asio/asio/include/asio/prefer.hpp +734 -0
  1035. data/ext/couchbase/third_party/asio/asio/include/asio/query.hpp +324 -0
  1036. data/ext/couchbase/third_party/asio/asio/include/asio/random_access_file.hpp +35 -0
  1037. data/ext/couchbase/third_party/asio/asio/include/asio/read.hpp +1388 -0
  1038. data/ext/couchbase/third_party/asio/asio/include/asio/read_at.hpp +738 -0
  1039. data/ext/couchbase/third_party/asio/asio/include/asio/read_until.hpp +3031 -0
  1040. data/ext/couchbase/third_party/asio/asio/include/asio/readable_pipe.hpp +35 -0
  1041. data/ext/couchbase/third_party/asio/asio/include/asio/redirect_error.hpp +66 -0
  1042. data/ext/couchbase/third_party/asio/asio/include/asio/registered_buffer.hpp +356 -0
  1043. data/ext/couchbase/third_party/asio/asio/include/asio/require.hpp +571 -0
  1044. data/ext/couchbase/third_party/asio/asio/include/asio/require_concept.hpp +352 -0
  1045. data/ext/couchbase/third_party/asio/asio/include/asio/serial_port.hpp +36 -0
  1046. data/ext/couchbase/third_party/asio/asio/include/asio/serial_port_base.hpp +167 -0
  1047. data/ext/couchbase/third_party/asio/asio/include/asio/signal_set.hpp +28 -0
  1048. data/ext/couchbase/third_party/asio/asio/include/asio/socket_base.hpp +559 -0
  1049. data/ext/couchbase/third_party/asio/asio/include/asio/spawn.hpp +344 -0
  1050. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/context.hpp +761 -0
  1051. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/context_base.hpp +209 -0
  1052. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/buffered_handshake_op.hpp +119 -0
  1053. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/engine.hpp +170 -0
  1054. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/handshake_op.hpp +67 -0
  1055. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/impl/engine.ipp +363 -0
  1056. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/impl/openssl_init.ipp +165 -0
  1057. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/io.hpp +425 -0
  1058. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/openssl_init.hpp +101 -0
  1059. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/openssl_types.hpp +34 -0
  1060. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/password_callback.hpp +66 -0
  1061. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/read_op.hpp +72 -0
  1062. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/shutdown_op.hpp +69 -0
  1063. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/stream_core.hpp +206 -0
  1064. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/verify_callback.hpp +62 -0
  1065. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/write_op.hpp +76 -0
  1066. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/error.hpp +125 -0
  1067. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/host_name_verification.hpp +90 -0
  1068. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/context.hpp +67 -0
  1069. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/context.ipp +1245 -0
  1070. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/error.ipp +102 -0
  1071. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/host_name_verification.ipp +73 -0
  1072. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/rfc2818_verification.ipp +164 -0
  1073. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/src.hpp +29 -0
  1074. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/rfc2818_verification.hpp +98 -0
  1075. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/stream.hpp +972 -0
  1076. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/stream_base.hpp +52 -0
  1077. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/verify_context.hpp +67 -0
  1078. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/verify_mode.hpp +63 -0
  1079. data/ext/couchbase/third_party/asio/asio/include/asio/ssl.hpp +28 -0
  1080. data/ext/couchbase/third_party/asio/asio/include/asio/static_thread_pool.hpp +31 -0
  1081. data/ext/couchbase/third_party/asio/asio/include/asio/steady_timer.hpp +42 -0
  1082. data/ext/couchbase/third_party/asio/asio/include/asio/strand.hpp +569 -0
  1083. data/ext/couchbase/third_party/asio/asio/include/asio/stream_file.hpp +35 -0
  1084. data/ext/couchbase/third_party/asio/asio/include/asio/streambuf.hpp +33 -0
  1085. data/ext/couchbase/third_party/asio/asio/include/asio/system_context.hpp +90 -0
  1086. data/ext/couchbase/third_party/asio/asio/include/asio/system_error.hpp +131 -0
  1087. data/ext/couchbase/third_party/asio/asio/include/asio/system_executor.hpp +684 -0
  1088. data/ext/couchbase/third_party/asio/asio/include/asio/system_timer.hpp +42 -0
  1089. data/ext/couchbase/third_party/asio/asio/include/asio/this_coro.hpp +280 -0
  1090. data/ext/couchbase/third_party/asio/asio/include/asio/thread.hpp +92 -0
  1091. data/ext/couchbase/third_party/asio/asio/include/asio/thread_pool.hpp +1140 -0
  1092. data/ext/couchbase/third_party/asio/asio/include/asio/time_traits.hpp +86 -0
  1093. data/ext/couchbase/third_party/asio/asio/include/asio/traits/bulk_execute_free.hpp +114 -0
  1094. data/ext/couchbase/third_party/asio/asio/include/asio/traits/bulk_execute_member.hpp +114 -0
  1095. data/ext/couchbase/third_party/asio/asio/include/asio/traits/connect_free.hpp +112 -0
  1096. data/ext/couchbase/third_party/asio/asio/include/asio/traits/connect_member.hpp +112 -0
  1097. data/ext/couchbase/third_party/asio/asio/include/asio/traits/equality_comparable.hpp +104 -0
  1098. data/ext/couchbase/third_party/asio/asio/include/asio/traits/execute_free.hpp +108 -0
  1099. data/ext/couchbase/third_party/asio/asio/include/asio/traits/execute_member.hpp +108 -0
  1100. data/ext/couchbase/third_party/asio/asio/include/asio/traits/prefer_free.hpp +108 -0
  1101. data/ext/couchbase/third_party/asio/asio/include/asio/traits/prefer_member.hpp +108 -0
  1102. data/ext/couchbase/third_party/asio/asio/include/asio/traits/query_free.hpp +108 -0
  1103. data/ext/couchbase/third_party/asio/asio/include/asio/traits/query_member.hpp +108 -0
  1104. data/ext/couchbase/third_party/asio/asio/include/asio/traits/query_static_constexpr_member.hpp +108 -0
  1105. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_concept_free.hpp +108 -0
  1106. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_concept_member.hpp +108 -0
  1107. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_free.hpp +108 -0
  1108. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_member.hpp +108 -0
  1109. data/ext/couchbase/third_party/asio/asio/include/asio/traits/schedule_free.hpp +108 -0
  1110. data/ext/couchbase/third_party/asio/asio/include/asio/traits/schedule_member.hpp +108 -0
  1111. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_done_free.hpp +108 -0
  1112. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_done_member.hpp +108 -0
  1113. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_error_free.hpp +112 -0
  1114. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_error_member.hpp +112 -0
  1115. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_value_free.hpp +234 -0
  1116. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_value_member.hpp +234 -0
  1117. data/ext/couchbase/third_party/asio/asio/include/asio/traits/start_free.hpp +108 -0
  1118. data/ext/couchbase/third_party/asio/asio/include/asio/traits/start_member.hpp +108 -0
  1119. data/ext/couchbase/third_party/asio/asio/include/asio/traits/static_query.hpp +108 -0
  1120. data/ext/couchbase/third_party/asio/asio/include/asio/traits/static_require.hpp +123 -0
  1121. data/ext/couchbase/third_party/asio/asio/include/asio/traits/static_require_concept.hpp +124 -0
  1122. data/ext/couchbase/third_party/asio/asio/include/asio/traits/submit_free.hpp +112 -0
  1123. data/ext/couchbase/third_party/asio/asio/include/asio/traits/submit_member.hpp +112 -0
  1124. data/ext/couchbase/third_party/asio/asio/include/asio/ts/buffer.hpp +24 -0
  1125. data/ext/couchbase/third_party/asio/asio/include/asio/ts/executor.hpp +35 -0
  1126. data/ext/couchbase/third_party/asio/asio/include/asio/ts/internet.hpp +40 -0
  1127. data/ext/couchbase/third_party/asio/asio/include/asio/ts/io_context.hpp +20 -0
  1128. data/ext/couchbase/third_party/asio/asio/include/asio/ts/net.hpp +26 -0
  1129. data/ext/couchbase/third_party/asio/asio/include/asio/ts/netfwd.hpp +254 -0
  1130. data/ext/couchbase/third_party/asio/asio/include/asio/ts/socket.hpp +27 -0
  1131. data/ext/couchbase/third_party/asio/asio/include/asio/ts/timer.hpp +26 -0
  1132. data/ext/couchbase/third_party/asio/asio/include/asio/unyield.hpp +21 -0
  1133. data/ext/couchbase/third_party/asio/asio/include/asio/use_awaitable.hpp +166 -0
  1134. data/ext/couchbase/third_party/asio/asio/include/asio/use_future.hpp +160 -0
  1135. data/ext/couchbase/third_party/asio/asio/include/asio/uses_executor.hpp +71 -0
  1136. data/ext/couchbase/third_party/asio/asio/include/asio/version.hpp +23 -0
  1137. data/ext/couchbase/third_party/asio/asio/include/asio/wait_traits.hpp +56 -0
  1138. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_object_handle.hpp +435 -0
  1139. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_overlapped_handle.hpp +361 -0
  1140. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_random_access_handle.hpp +510 -0
  1141. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_stream_handle.hpp +494 -0
  1142. data/ext/couchbase/third_party/asio/asio/include/asio/windows/object_handle.hpp +38 -0
  1143. data/ext/couchbase/third_party/asio/asio/include/asio/windows/overlapped_handle.hpp +39 -0
  1144. data/ext/couchbase/third_party/asio/asio/include/asio/windows/overlapped_ptr.hpp +145 -0
  1145. data/ext/couchbase/third_party/asio/asio/include/asio/windows/random_access_handle.hpp +37 -0
  1146. data/ext/couchbase/third_party/asio/asio/include/asio/windows/stream_handle.hpp +37 -0
  1147. data/ext/couchbase/third_party/asio/asio/include/asio/writable_pipe.hpp +35 -0
  1148. data/ext/couchbase/third_party/asio/asio/include/asio/write.hpp +1346 -0
  1149. data/ext/couchbase/third_party/asio/asio/include/asio/write_at.hpp +746 -0
  1150. data/ext/couchbase/third_party/asio/asio/include/asio/yield.hpp +23 -0
  1151. data/ext/couchbase/third_party/asio/asio/include/asio.hpp +201 -0
  1152. data/ext/couchbase/third_party/fmt/CMakeLists.txt +410 -0
  1153. data/ext/couchbase/third_party/fmt/ChangeLog.rst +4364 -0
  1154. data/ext/couchbase/third_party/fmt/LICENSE.rst +27 -0
  1155. data/ext/couchbase/third_party/fmt/README.rst +528 -0
  1156. data/ext/couchbase/third_party/fmt/include/fmt/args.h +244 -0
  1157. data/ext/couchbase/third_party/fmt/include/fmt/chrono.h +2055 -0
  1158. data/ext/couchbase/third_party/fmt/include/fmt/color.h +638 -0
  1159. data/ext/couchbase/third_party/fmt/include/fmt/compile.h +642 -0
  1160. data/ext/couchbase/third_party/fmt/include/fmt/core.h +3217 -0
  1161. data/ext/couchbase/third_party/fmt/include/fmt/format-inl.h +2637 -0
  1162. data/ext/couchbase/third_party/fmt/include/fmt/format.h +3120 -0
  1163. data/ext/couchbase/third_party/fmt/include/fmt/locale.h +2 -0
  1164. data/ext/couchbase/third_party/fmt/include/fmt/os.h +527 -0
  1165. data/ext/couchbase/third_party/fmt/include/fmt/ostream.h +135 -0
  1166. data/ext/couchbase/third_party/fmt/include/fmt/printf.h +657 -0
  1167. data/ext/couchbase/third_party/fmt/include/fmt/ranges.h +742 -0
  1168. data/ext/couchbase/third_party/fmt/include/fmt/xchar.h +236 -0
  1169. data/ext/couchbase/third_party/fmt/src/fmt.cc +99 -0
  1170. data/ext/couchbase/third_party/fmt/src/format.cc +124 -0
  1171. data/ext/couchbase/third_party/fmt/src/os.cc +361 -0
  1172. data/ext/couchbase/third_party/fmt/support/cmake/FindSetEnv.cmake +7 -0
  1173. data/ext/couchbase/third_party/fmt/support/cmake/JoinPaths.cmake +26 -0
  1174. data/ext/couchbase/third_party/fmt/support/cmake/cxx14.cmake +70 -0
  1175. data/ext/couchbase/third_party/fmt/support/cmake/fmt-config.cmake.in +4 -0
  1176. data/ext/couchbase/third_party/fmt/support/cmake/fmt.pc.in +11 -0
  1177. data/ext/couchbase/third_party/gsl/CMakeLists.txt +61 -0
  1178. data/ext/couchbase/third_party/gsl/LICENSE +21 -0
  1179. data/ext/couchbase/third_party/gsl/ThirdPartyNotices.txt +41 -0
  1180. data/ext/couchbase/third_party/gsl/cmake/guidelineSupportLibrary.cmake +116 -0
  1181. data/ext/couchbase/third_party/gsl/include/CMakeLists.txt +20 -0
  1182. data/ext/couchbase/third_party/gsl/include/gsl/algorithm +63 -0
  1183. data/ext/couchbase/third_party/gsl/include/gsl/assert +136 -0
  1184. data/ext/couchbase/third_party/gsl/include/gsl/byte +213 -0
  1185. data/ext/couchbase/third_party/gsl/include/gsl/gsl +32 -0
  1186. data/ext/couchbase/third_party/gsl/include/gsl/gsl_algorithm +4 -0
  1187. data/ext/couchbase/third_party/gsl/include/gsl/gsl_assert +3 -0
  1188. data/ext/couchbase/third_party/gsl/include/gsl/gsl_byte +3 -0
  1189. data/ext/couchbase/third_party/gsl/include/gsl/gsl_narrow +3 -0
  1190. data/ext/couchbase/third_party/gsl/include/gsl/gsl_util +3 -0
  1191. data/ext/couchbase/third_party/gsl/include/gsl/narrow +66 -0
  1192. data/ext/couchbase/third_party/gsl/include/gsl/pointers +323 -0
  1193. data/ext/couchbase/third_party/gsl/include/gsl/span +821 -0
  1194. data/ext/couchbase/third_party/gsl/include/gsl/span_ext +212 -0
  1195. data/ext/couchbase/third_party/gsl/include/gsl/string_span +767 -0
  1196. data/ext/couchbase/third_party/gsl/include/gsl/util +157 -0
  1197. data/ext/couchbase/third_party/hdr_histogram_c/CMakeLists.txt +84 -0
  1198. data/ext/couchbase/third_party/hdr_histogram_c/COPYING.txt +121 -0
  1199. data/ext/couchbase/third_party/hdr_histogram_c/LICENSE.txt +41 -0
  1200. data/ext/couchbase/third_party/hdr_histogram_c/config.cmake.in +6 -0
  1201. data/ext/couchbase/third_party/hdr_histogram_c/src/CMakeLists.txt +83 -0
  1202. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_atomic.h +146 -0
  1203. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_encoding.c +322 -0
  1204. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_encoding.h +79 -0
  1205. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_endian.h +116 -0
  1206. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_histogram.c +1211 -0
  1207. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_histogram.h +516 -0
  1208. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_histogram_log.c +1290 -0
  1209. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_histogram_log.h +236 -0
  1210. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_histogram_log_no_op.c +171 -0
  1211. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_interval_recorder.c +227 -0
  1212. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_interval_recorder.h +109 -0
  1213. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_malloc.h +19 -0
  1214. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_tests.h +22 -0
  1215. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_thread.c +108 -0
  1216. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_thread.h +55 -0
  1217. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_time.c +98 -0
  1218. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_time.h +49 -0
  1219. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_writer_reader_phaser.c +143 -0
  1220. data/ext/couchbase/third_party/hdr_histogram_c/src/hdr_writer_reader_phaser.h +51 -0
  1221. data/ext/couchbase/third_party/http_parser/LICENSE-MIT +19 -0
  1222. data/ext/couchbase/third_party/http_parser/http_parser.c +2575 -0
  1223. data/ext/couchbase/third_party/http_parser/http_parser.h +449 -0
  1224. data/ext/couchbase/third_party/json/CMakeLists.txt +90 -0
  1225. data/ext/couchbase/third_party/json/LICENSE +21 -0
  1226. data/ext/couchbase/third_party/json/LICENSE.double-conversion +32 -0
  1227. data/ext/couchbase/third_party/json/LICENSE.itoa +19 -0
  1228. data/ext/couchbase/third_party/json/LICENSE.ryu +201 -0
  1229. data/ext/couchbase/third_party/json/external/PEGTL/.cmake/pegtl-config.cmake.in +4 -0
  1230. data/ext/couchbase/third_party/json/external/PEGTL/.cmake/test_filesystem.cpp.in +22 -0
  1231. data/ext/couchbase/third_party/json/external/PEGTL/CMakeLists.txt +155 -0
  1232. data/ext/couchbase/third_party/json/external/PEGTL/LICENSE +21 -0
  1233. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/apply_mode.hpp +19 -0
  1234. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/argv_input.hpp +49 -0
  1235. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/ascii.hpp +54 -0
  1236. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/buffer_input.hpp +226 -0
  1237. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_action.hpp +38 -0
  1238. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_action_and_state.hpp +71 -0
  1239. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_action_and_states.hpp +62 -0
  1240. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_control.hpp +36 -0
  1241. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_state.hpp +69 -0
  1242. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_states.hpp +61 -0
  1243. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/config.hpp +11 -0
  1244. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/abnf.hpp +35 -0
  1245. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/add_state.hpp +69 -0
  1246. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/alphabet.hpp +67 -0
  1247. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/analyze.hpp +189 -0
  1248. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/analyze_traits.hpp +277 -0
  1249. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/check_bytes.hpp +55 -0
  1250. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/control_action.hpp +81 -0
  1251. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/coverage.hpp +151 -0
  1252. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/forward.hpp +16 -0
  1253. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/function.hpp +52 -0
  1254. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/http.hpp +277 -0
  1255. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/internal.hpp +98 -0
  1256. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/utf16.hpp +196 -0
  1257. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/utf32.hpp +196 -0
  1258. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/utf8.hpp +103 -0
  1259. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/if_then.hpp +56 -0
  1260. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/instantiate.hpp +38 -0
  1261. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/integer.hpp +468 -0
  1262. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/endian.hpp +77 -0
  1263. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/endian_gcc.hpp +198 -0
  1264. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/endian_win.hpp +102 -0
  1265. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_mask_uint.hpp +54 -0
  1266. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_mask_uint8.hpp +33 -0
  1267. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_uint.hpp +45 -0
  1268. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_uint8.hpp +32 -0
  1269. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_utf16.hpp +54 -0
  1270. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_utf32.hpp +43 -0
  1271. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/read_uint.hpp +77 -0
  1272. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/set_stack_guard.hpp +52 -0
  1273. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/vector_stack_guard.hpp +45 -0
  1274. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/iri.hpp +106 -0
  1275. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/json.hpp +91 -0
  1276. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/json_pointer.hpp +33 -0
  1277. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/limit_bytes.hpp +88 -0
  1278. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/limit_depth.hpp +83 -0
  1279. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/parse_tree.hpp +443 -0
  1280. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/parse_tree_to_dot.hpp +111 -0
  1281. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/peg.hpp +121 -0
  1282. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/predicates.hpp +126 -0
  1283. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/print.hpp +75 -0
  1284. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/print_coverage.hpp +53 -0
  1285. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/proto3.hpp +142 -0
  1286. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/raw_string.hpp +232 -0
  1287. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/remove_first_state.hpp +72 -0
  1288. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/remove_last_states.hpp +121 -0
  1289. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/rep_one_min_max.hpp +100 -0
  1290. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/rep_string.hpp +43 -0
  1291. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/separated_seq.hpp +45 -0
  1292. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/shuffle_states.hpp +193 -0
  1293. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/state_control.hpp +122 -0
  1294. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/to_string.hpp +38 -0
  1295. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/trace.hpp +227 -0
  1296. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint16.hpp +62 -0
  1297. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint32.hpp +62 -0
  1298. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint64.hpp +63 -0
  1299. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint8.hpp +36 -0
  1300. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/unescape.hpp +214 -0
  1301. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uri.hpp +111 -0
  1302. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/utf16.hpp +57 -0
  1303. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/utf32.hpp +57 -0
  1304. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/cstream_input.hpp +32 -0
  1305. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/demangle.hpp +175 -0
  1306. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/disable_action.hpp +35 -0
  1307. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/discard_input.hpp +37 -0
  1308. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/discard_input_on_failure.hpp +39 -0
  1309. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/discard_input_on_success.hpp +39 -0
  1310. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/enable_action.hpp +35 -0
  1311. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/eol.hpp +37 -0
  1312. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/eol_pair.hpp +18 -0
  1313. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/file_input.hpp +44 -0
  1314. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/action.hpp +54 -0
  1315. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/action_input.hpp +106 -0
  1316. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/any.hpp +77 -0
  1317. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply.hpp +53 -0
  1318. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply0.hpp +51 -0
  1319. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply0_single.hpp +34 -0
  1320. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply_single.hpp +34 -0
  1321. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/at.hpp +55 -0
  1322. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bof.hpp +32 -0
  1323. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bol.hpp +31 -0
  1324. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp +45 -0
  1325. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump_help.hpp +26 -0
  1326. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bytes.hpp +43 -0
  1327. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/control.hpp +54 -0
  1328. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cr_crlf_eol.hpp +32 -0
  1329. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cr_eol.hpp +32 -0
  1330. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/crlf_eol.hpp +32 -0
  1331. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cstream_reader.hpp +58 -0
  1332. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cstring_reader.hpp +40 -0
  1333. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/dependent_false.hpp +16 -0
  1334. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/dependent_true.hpp +16 -0
  1335. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/disable.hpp +54 -0
  1336. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/discard.hpp +34 -0
  1337. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/enable.hpp +54 -0
  1338. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/enable_control.hpp +25 -0
  1339. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/eof.hpp +32 -0
  1340. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/eol.hpp +32 -0
  1341. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/eolf.hpp +33 -0
  1342. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/failure.hpp +32 -0
  1343. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/file_mapper_posix.hpp +159 -0
  1344. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/file_mapper_win32.hpp +243 -0
  1345. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/file_reader.hpp +152 -0
  1346. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/filesystem.hpp +64 -0
  1347. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_apply.hpp +21 -0
  1348. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_apply0.hpp +21 -0
  1349. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_match.hpp +40 -0
  1350. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_unwind.hpp +21 -0
  1351. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/identifier.hpp +22 -0
  1352. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_apply.hpp +54 -0
  1353. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_must.hpp +52 -0
  1354. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_must_else.hpp +26 -0
  1355. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_then_else.hpp +51 -0
  1356. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/input_pair.hpp +29 -0
  1357. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/istream_reader.hpp +50 -0
  1358. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/istring.hpp +81 -0
  1359. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/iterator.hpp +49 -0
  1360. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/lf_crlf_eol.hpp +37 -0
  1361. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/lf_eol.hpp +32 -0
  1362. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list.hpp +19 -0
  1363. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list_must.hpp +25 -0
  1364. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list_tail.hpp +22 -0
  1365. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list_tail_pad.hpp +22 -0
  1366. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/marker.hpp +80 -0
  1367. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/minus.hpp +21 -0
  1368. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/missing_apply.hpp +28 -0
  1369. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/missing_apply0.hpp +26 -0
  1370. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/must.hpp +69 -0
  1371. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/not_at.hpp +55 -0
  1372. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/one.hpp +66 -0
  1373. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/opt.hpp +57 -0
  1374. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/pad.hpp +19 -0
  1375. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/pad_opt.hpp +20 -0
  1376. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/path_to_string.hpp +28 -0
  1377. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/peek_char.hpp +32 -0
  1378. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/peek_utf8.hpp +89 -0
  1379. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/pegtl_string.hpp +90 -0
  1380. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/plus.hpp +60 -0
  1381. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/raise.hpp +49 -0
  1382. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/range.hpp +60 -0
  1383. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/ranges.hpp +90 -0
  1384. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rematch.hpp +72 -0
  1385. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep.hpp +67 -0
  1386. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep_min.hpp +20 -0
  1387. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep_min_max.hpp +81 -0
  1388. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep_opt.hpp +61 -0
  1389. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/require.hpp +42 -0
  1390. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/result_on_found.hpp +19 -0
  1391. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rules.hpp +64 -0
  1392. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/seq.hpp +58 -0
  1393. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/sor.hpp +67 -0
  1394. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/star.hpp +52 -0
  1395. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/star_must.hpp +24 -0
  1396. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/state.hpp +75 -0
  1397. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/string.hpp +67 -0
  1398. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/success.hpp +32 -0
  1399. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/try_catch_type.hpp +69 -0
  1400. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/until.hpp +88 -0
  1401. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/istream_input.hpp +32 -0
  1402. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/match.hpp +173 -0
  1403. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/memory_input.hpp +378 -0
  1404. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/mmap_input.hpp +79 -0
  1405. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/must_if.hpp +69 -0
  1406. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/normal.hpp +99 -0
  1407. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/nothing.hpp +19 -0
  1408. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/parse.hpp +72 -0
  1409. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/parse_error.hpp +119 -0
  1410. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/position.hpp +98 -0
  1411. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/read_input.hpp +54 -0
  1412. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/require_apply.hpp +16 -0
  1413. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/require_apply0.hpp +16 -0
  1414. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/rewind_mode.hpp +20 -0
  1415. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/rules.hpp +71 -0
  1416. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/string_input.hpp +64 -0
  1417. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/tracking_mode.hpp +19 -0
  1418. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/type_list.hpp +46 -0
  1419. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/utf8.hpp +28 -0
  1420. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/version.hpp +13 -0
  1421. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/visit.hpp +80 -0
  1422. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl.hpp +48 -0
  1423. data/ext/couchbase/third_party/json/include/tao/json/basic_value.hpp +962 -0
  1424. data/ext/couchbase/third_party/json/include/tao/json/binary.hpp +103 -0
  1425. data/ext/couchbase/third_party/json/include/tao/json/binary_view.hpp +31 -0
  1426. data/ext/couchbase/third_party/json/include/tao/json/binding/constant.hpp +231 -0
  1427. data/ext/couchbase/third_party/json/include/tao/json/binding/element.hpp +71 -0
  1428. data/ext/couchbase/third_party/json/include/tao/json/binding/element2.hpp +35 -0
  1429. data/ext/couchbase/third_party/json/include/tao/json/binding/factory.hpp +253 -0
  1430. data/ext/couchbase/third_party/json/include/tao/json/binding/for_nothing_value.hpp +17 -0
  1431. data/ext/couchbase/third_party/json/include/tao/json/binding/for_unknown_key.hpp +17 -0
  1432. data/ext/couchbase/third_party/json/include/tao/json/binding/inherit.hpp +14 -0
  1433. data/ext/couchbase/third_party/json/include/tao/json/binding/internal/array.hpp +105 -0
  1434. data/ext/couchbase/third_party/json/include/tao/json/binding/internal/elementr.hpp +134 -0
  1435. data/ext/couchbase/third_party/json/include/tao/json/binding/internal/elementw.hpp +251 -0
  1436. data/ext/couchbase/third_party/json/include/tao/json/binding/internal/inherit.hpp +45 -0
  1437. data/ext/couchbase/third_party/json/include/tao/json/binding/internal/object.hpp +269 -0
  1438. data/ext/couchbase/third_party/json/include/tao/json/binding/internal/type_key.hpp +54 -0
  1439. data/ext/couchbase/third_party/json/include/tao/json/binding/member.hpp +47 -0
  1440. data/ext/couchbase/third_party/json/include/tao/json/binding/member_kind.hpp +17 -0
  1441. data/ext/couchbase/third_party/json/include/tao/json/binding/versions.hpp +130 -0
  1442. data/ext/couchbase/third_party/json/include/tao/json/binding.hpp +74 -0
  1443. data/ext/couchbase/third_party/json/include/tao/json/cbor/consume_file.hpp +34 -0
  1444. data/ext/couchbase/third_party/json/include/tao/json/cbor/consume_string.hpp +32 -0
  1445. data/ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp +44 -0
  1446. data/ext/couchbase/third_party/json/include/tao/json/cbor/events/from_file.hpp +27 -0
  1447. data/ext/couchbase/third_party/json/include/tao/json/cbor/events/from_input.hpp +43 -0
  1448. data/ext/couchbase/third_party/json/include/tao/json/cbor/events/from_string.hpp +37 -0
  1449. data/ext/couchbase/third_party/json/include/tao/json/cbor/events/to_stream.hpp +161 -0
  1450. data/ext/couchbase/third_party/json/include/tao/json/cbor/events/to_string.hpp +37 -0
  1451. data/ext/couchbase/third_party/json/include/tao/json/cbor/from_binary.hpp +32 -0
  1452. data/ext/couchbase/third_party/json/include/tao/json/cbor/from_file.hpp +33 -0
  1453. data/ext/couchbase/third_party/json/include/tao/json/cbor/from_input.hpp +33 -0
  1454. data/ext/couchbase/third_party/json/include/tao/json/cbor/from_string.hpp +32 -0
  1455. data/ext/couchbase/third_party/json/include/tao/json/cbor/internal/grammar.hpp +424 -0
  1456. data/ext/couchbase/third_party/json/include/tao/json/cbor/internal/major.hpp +28 -0
  1457. data/ext/couchbase/third_party/json/include/tao/json/cbor/parts_parser.hpp +395 -0
  1458. data/ext/couchbase/third_party/json/include/tao/json/cbor/to_stream.hpp +27 -0
  1459. data/ext/couchbase/third_party/json/include/tao/json/cbor/to_string.hpp +29 -0
  1460. data/ext/couchbase/third_party/json/include/tao/json/cbor.hpp +19 -0
  1461. data/ext/couchbase/third_party/json/include/tao/json/consume.hpp +43 -0
  1462. data/ext/couchbase/third_party/json/include/tao/json/consume_file.hpp +33 -0
  1463. data/ext/couchbase/third_party/json/include/tao/json/consume_string.hpp +31 -0
  1464. data/ext/couchbase/third_party/json/include/tao/json/contrib/array_traits.hpp +43 -0
  1465. data/ext/couchbase/third_party/json/include/tao/json/contrib/deque_traits.hpp +41 -0
  1466. data/ext/couchbase/third_party/json/include/tao/json/contrib/diff.hpp +106 -0
  1467. data/ext/couchbase/third_party/json/include/tao/json/contrib/get.hpp +152 -0
  1468. data/ext/couchbase/third_party/json/include/tao/json/contrib/internal/array_traits.hpp +92 -0
  1469. data/ext/couchbase/third_party/json/include/tao/json/contrib/internal/indirect_traits.hpp +76 -0
  1470. data/ext/couchbase/third_party/json/include/tao/json/contrib/internal/object_traits.hpp +105 -0
  1471. data/ext/couchbase/third_party/json/include/tao/json/contrib/internal/type_traits.hpp +36 -0
  1472. data/ext/couchbase/third_party/json/include/tao/json/contrib/list_traits.hpp +41 -0
  1473. data/ext/couchbase/third_party/json/include/tao/json/contrib/map_traits.hpp +43 -0
  1474. data/ext/couchbase/third_party/json/include/tao/json/contrib/multimap_traits.hpp +43 -0
  1475. data/ext/couchbase/third_party/json/include/tao/json/contrib/multiset_traits.hpp +41 -0
  1476. data/ext/couchbase/third_party/json/include/tao/json/contrib/pair_traits.hpp +21 -0
  1477. data/ext/couchbase/third_party/json/include/tao/json/contrib/patch.hpp +117 -0
  1478. data/ext/couchbase/third_party/json/include/tao/json/contrib/pointer_traits.hpp +59 -0
  1479. data/ext/couchbase/third_party/json/include/tao/json/contrib/position.hpp +166 -0
  1480. data/ext/couchbase/third_party/json/include/tao/json/contrib/reference.hpp +113 -0
  1481. data/ext/couchbase/third_party/json/include/tao/json/contrib/schema.hpp +1874 -0
  1482. data/ext/couchbase/third_party/json/include/tao/json/contrib/set_traits.hpp +41 -0
  1483. data/ext/couchbase/third_party/json/include/tao/json/contrib/shared_ptr_traits.hpp +98 -0
  1484. data/ext/couchbase/third_party/json/include/tao/json/contrib/traits.hpp +128 -0
  1485. data/ext/couchbase/third_party/json/include/tao/json/contrib/tuple_traits.hpp +51 -0
  1486. data/ext/couchbase/third_party/json/include/tao/json/contrib/unique_ptr_traits.hpp +97 -0
  1487. data/ext/couchbase/third_party/json/include/tao/json/contrib/unordered_map_traits.hpp +43 -0
  1488. data/ext/couchbase/third_party/json/include/tao/json/contrib/unordered_set_traits.hpp +41 -0
  1489. data/ext/couchbase/third_party/json/include/tao/json/contrib/variant_traits.hpp +73 -0
  1490. data/ext/couchbase/third_party/json/include/tao/json/contrib/vector_bool_traits.hpp +45 -0
  1491. data/ext/couchbase/third_party/json/include/tao/json/contrib/vector_traits.hpp +51 -0
  1492. data/ext/couchbase/third_party/json/include/tao/json/events/apply.hpp +20 -0
  1493. data/ext/couchbase/third_party/json/include/tao/json/events/binary_to_base64.hpp +26 -0
  1494. data/ext/couchbase/third_party/json/include/tao/json/events/binary_to_base64url.hpp +28 -0
  1495. data/ext/couchbase/third_party/json/include/tao/json/events/binary_to_exception.hpp +27 -0
  1496. data/ext/couchbase/third_party/json/include/tao/json/events/binary_to_hex.hpp +26 -0
  1497. data/ext/couchbase/third_party/json/include/tao/json/events/compare.hpp +255 -0
  1498. data/ext/couchbase/third_party/json/include/tao/json/events/debug.hpp +145 -0
  1499. data/ext/couchbase/third_party/json/include/tao/json/events/discard.hpp +43 -0
  1500. data/ext/couchbase/third_party/json/include/tao/json/events/from_file.hpp +28 -0
  1501. data/ext/couchbase/third_party/json/include/tao/json/events/from_input.hpp +45 -0
  1502. data/ext/couchbase/third_party/json/include/tao/json/events/from_stream.hpp +33 -0
  1503. data/ext/couchbase/third_party/json/include/tao/json/events/from_string.hpp +38 -0
  1504. data/ext/couchbase/third_party/json/include/tao/json/events/from_value.hpp +205 -0
  1505. data/ext/couchbase/third_party/json/include/tao/json/events/hash.hpp +174 -0
  1506. data/ext/couchbase/third_party/json/include/tao/json/events/invalid_string_to_binary.hpp +50 -0
  1507. data/ext/couchbase/third_party/json/include/tao/json/events/invalid_string_to_exception.hpp +49 -0
  1508. data/ext/couchbase/third_party/json/include/tao/json/events/invalid_string_to_hex.hpp +48 -0
  1509. data/ext/couchbase/third_party/json/include/tao/json/events/key_camel_case_to_snake_case.hpp +62 -0
  1510. data/ext/couchbase/third_party/json/include/tao/json/events/key_snake_case_to_camel_case.hpp +57 -0
  1511. data/ext/couchbase/third_party/json/include/tao/json/events/limit_nesting_depth.hpp +82 -0
  1512. data/ext/couchbase/third_party/json/include/tao/json/events/limit_value_count.hpp +46 -0
  1513. data/ext/couchbase/third_party/json/include/tao/json/events/non_finite_to_exception.hpp +31 -0
  1514. data/ext/couchbase/third_party/json/include/tao/json/events/non_finite_to_null.hpp +32 -0
  1515. data/ext/couchbase/third_party/json/include/tao/json/events/non_finite_to_string.hpp +40 -0
  1516. data/ext/couchbase/third_party/json/include/tao/json/events/prefer_signed.hpp +32 -0
  1517. data/ext/couchbase/third_party/json/include/tao/json/events/prefer_unsigned.hpp +32 -0
  1518. data/ext/couchbase/third_party/json/include/tao/json/events/produce.hpp +120 -0
  1519. data/ext/couchbase/third_party/json/include/tao/json/events/ref.hpp +114 -0
  1520. data/ext/couchbase/third_party/json/include/tao/json/events/statistics.hpp +112 -0
  1521. data/ext/couchbase/third_party/json/include/tao/json/events/tee.hpp +386 -0
  1522. data/ext/couchbase/third_party/json/include/tao/json/events/to_pretty_stream.hpp +172 -0
  1523. data/ext/couchbase/third_party/json/include/tao/json/events/to_stream.hpp +142 -0
  1524. data/ext/couchbase/third_party/json/include/tao/json/events/to_string.hpp +39 -0
  1525. data/ext/couchbase/third_party/json/include/tao/json/events/to_value.hpp +137 -0
  1526. data/ext/couchbase/third_party/json/include/tao/json/events/transformer.hpp +70 -0
  1527. data/ext/couchbase/third_party/json/include/tao/json/events/validate_event_order.hpp +415 -0
  1528. data/ext/couchbase/third_party/json/include/tao/json/events/validate_keys.hpp +52 -0
  1529. data/ext/couchbase/third_party/json/include/tao/json/events/virtual_base.hpp +192 -0
  1530. data/ext/couchbase/third_party/json/include/tao/json/events/virtual_ref.hpp +179 -0
  1531. data/ext/couchbase/third_party/json/include/tao/json/events/virtual_wrap.hpp +166 -0
  1532. data/ext/couchbase/third_party/json/include/tao/json/events.hpp +52 -0
  1533. data/ext/couchbase/third_party/json/include/tao/json/external/double.hpp +1306 -0
  1534. data/ext/couchbase/third_party/json/include/tao/json/external/itoa.hpp +151 -0
  1535. data/ext/couchbase/third_party/json/include/tao/json/external/ryu.hpp +1216 -0
  1536. data/ext/couchbase/third_party/json/include/tao/json/forward.hpp +44 -0
  1537. data/ext/couchbase/third_party/json/include/tao/json/from_file.hpp +32 -0
  1538. data/ext/couchbase/third_party/json/include/tao/json/from_input.hpp +32 -0
  1539. data/ext/couchbase/third_party/json/include/tao/json/from_stream.hpp +45 -0
  1540. data/ext/couchbase/third_party/json/include/tao/json/from_string.hpp +41 -0
  1541. data/ext/couchbase/third_party/json/include/tao/json/internal/action.hpp +271 -0
  1542. data/ext/couchbase/third_party/json/include/tao/json/internal/base64.hpp +55 -0
  1543. data/ext/couchbase/third_party/json/include/tao/json/internal/base64url.hpp +53 -0
  1544. data/ext/couchbase/third_party/json/include/tao/json/internal/dependent_false.hpp +14 -0
  1545. data/ext/couchbase/third_party/json/include/tao/json/internal/endian.hpp +60 -0
  1546. data/ext/couchbase/third_party/json/include/tao/json/internal/endian_gcc.hpp +198 -0
  1547. data/ext/couchbase/third_party/json/include/tao/json/internal/endian_win.hpp +103 -0
  1548. data/ext/couchbase/third_party/json/include/tao/json/internal/errors.hpp +86 -0
  1549. data/ext/couchbase/third_party/json/include/tao/json/internal/escape.hpp +69 -0
  1550. data/ext/couchbase/third_party/json/include/tao/json/internal/filesystem.hpp +15 -0
  1551. data/ext/couchbase/third_party/json/include/tao/json/internal/format.hpp +59 -0
  1552. data/ext/couchbase/third_party/json/include/tao/json/internal/grammar.hpp +231 -0
  1553. data/ext/couchbase/third_party/json/include/tao/json/internal/hexdump.hpp +33 -0
  1554. data/ext/couchbase/third_party/json/include/tao/json/internal/identity.hpp +22 -0
  1555. data/ext/couchbase/third_party/json/include/tao/json/internal/number_state.hpp +81 -0
  1556. data/ext/couchbase/third_party/json/include/tao/json/internal/number_traits.hpp +267 -0
  1557. data/ext/couchbase/third_party/json/include/tao/json/internal/pair.hpp +42 -0
  1558. data/ext/couchbase/third_party/json/include/tao/json/internal/parse_util.hpp +113 -0
  1559. data/ext/couchbase/third_party/json/include/tao/json/internal/sha256.hpp +218 -0
  1560. data/ext/couchbase/third_party/json/include/tao/json/internal/single.hpp +40 -0
  1561. data/ext/couchbase/third_party/json/include/tao/json/internal/string_t.hpp +35 -0
  1562. data/ext/couchbase/third_party/json/include/tao/json/internal/type_traits.hpp +97 -0
  1563. data/ext/couchbase/third_party/json/include/tao/json/internal/unescape_action.hpp +24 -0
  1564. data/ext/couchbase/third_party/json/include/tao/json/internal/uri_fragment.hpp +182 -0
  1565. data/ext/couchbase/third_party/json/include/tao/json/jaxn/consume_file.hpp +34 -0
  1566. data/ext/couchbase/third_party/json/include/tao/json/jaxn/consume_string.hpp +32 -0
  1567. data/ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_file.hpp +29 -0
  1568. data/ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_input.hpp +45 -0
  1569. data/ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_stream.hpp +33 -0
  1570. data/ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_string.hpp +39 -0
  1571. data/ext/couchbase/third_party/json/include/tao/json/jaxn/events/to_pretty_stream.hpp +69 -0
  1572. data/ext/couchbase/third_party/json/include/tao/json/jaxn/events/to_stream.hpp +67 -0
  1573. data/ext/couchbase/third_party/json/include/tao/json/jaxn/events/to_string.hpp +39 -0
  1574. data/ext/couchbase/third_party/json/include/tao/json/jaxn/from_file.hpp +33 -0
  1575. data/ext/couchbase/third_party/json/include/tao/json/jaxn/from_input.hpp +33 -0
  1576. data/ext/couchbase/third_party/json/include/tao/json/jaxn/from_stream.hpp +48 -0
  1577. data/ext/couchbase/third_party/json/include/tao/json/jaxn/from_string.hpp +42 -0
  1578. data/ext/couchbase/third_party/json/include/tao/json/jaxn/internal/action.hpp +380 -0
  1579. data/ext/couchbase/third_party/json/include/tao/json/jaxn/internal/bunescape_action.hpp +115 -0
  1580. data/ext/couchbase/third_party/json/include/tao/json/jaxn/internal/errors.hpp +110 -0
  1581. data/ext/couchbase/third_party/json/include/tao/json/jaxn/internal/grammar.hpp +381 -0
  1582. data/ext/couchbase/third_party/json/include/tao/json/jaxn/internal/integer.hpp +255 -0
  1583. data/ext/couchbase/third_party/json/include/tao/json/jaxn/internal/unescape_action.hpp +28 -0
  1584. data/ext/couchbase/third_party/json/include/tao/json/jaxn/is_identifier.hpp +23 -0
  1585. data/ext/couchbase/third_party/json/include/tao/json/jaxn/parts_parser.hpp +261 -0
  1586. data/ext/couchbase/third_party/json/include/tao/json/jaxn/to_stream.hpp +36 -0
  1587. data/ext/couchbase/third_party/json/include/tao/json/jaxn/to_string.hpp +34 -0
  1588. data/ext/couchbase/third_party/json/include/tao/json/jaxn.hpp +19 -0
  1589. data/ext/couchbase/third_party/json/include/tao/json/message_extension.hpp +49 -0
  1590. data/ext/couchbase/third_party/json/include/tao/json/msgpack/consume_file.hpp +34 -0
  1591. data/ext/couchbase/third_party/json/include/tao/json/msgpack/consume_string.hpp +32 -0
  1592. data/ext/couchbase/third_party/json/include/tao/json/msgpack/events/from_binary.hpp +44 -0
  1593. data/ext/couchbase/third_party/json/include/tao/json/msgpack/events/from_file.hpp +27 -0
  1594. data/ext/couchbase/third_party/json/include/tao/json/msgpack/events/from_input.hpp +43 -0
  1595. data/ext/couchbase/third_party/json/include/tao/json/msgpack/events/from_string.hpp +37 -0
  1596. data/ext/couchbase/third_party/json/include/tao/json/msgpack/events/to_stream.hpp +214 -0
  1597. data/ext/couchbase/third_party/json/include/tao/json/msgpack/events/to_string.hpp +37 -0
  1598. data/ext/couchbase/third_party/json/include/tao/json/msgpack/from_binary.hpp +32 -0
  1599. data/ext/couchbase/third_party/json/include/tao/json/msgpack/from_file.hpp +33 -0
  1600. data/ext/couchbase/third_party/json/include/tao/json/msgpack/from_input.hpp +33 -0
  1601. data/ext/couchbase/third_party/json/include/tao/json/msgpack/from_string.hpp +32 -0
  1602. data/ext/couchbase/third_party/json/include/tao/json/msgpack/internal/format.hpp +57 -0
  1603. data/ext/couchbase/third_party/json/include/tao/json/msgpack/internal/grammar.hpp +230 -0
  1604. data/ext/couchbase/third_party/json/include/tao/json/msgpack/parts_parser.hpp +315 -0
  1605. data/ext/couchbase/third_party/json/include/tao/json/msgpack/to_stream.hpp +27 -0
  1606. data/ext/couchbase/third_party/json/include/tao/json/msgpack/to_string.hpp +29 -0
  1607. data/ext/couchbase/third_party/json/include/tao/json/msgpack.hpp +19 -0
  1608. data/ext/couchbase/third_party/json/include/tao/json/operators.hpp +490 -0
  1609. data/ext/couchbase/third_party/json/include/tao/json/parts_parser.hpp +333 -0
  1610. data/ext/couchbase/third_party/json/include/tao/json/pointer.hpp +433 -0
  1611. data/ext/couchbase/third_party/json/include/tao/json/produce.hpp +61 -0
  1612. data/ext/couchbase/third_party/json/include/tao/json/self_contained.hpp +130 -0
  1613. data/ext/couchbase/third_party/json/include/tao/json/span.hpp +496 -0
  1614. data/ext/couchbase/third_party/json/include/tao/json/stream.hpp +38 -0
  1615. data/ext/couchbase/third_party/json/include/tao/json/to_stream.hpp +42 -0
  1616. data/ext/couchbase/third_party/json/include/tao/json/to_string.hpp +25 -0
  1617. data/ext/couchbase/third_party/json/include/tao/json/traits.hpp +975 -0
  1618. data/ext/couchbase/third_party/json/include/tao/json/type.hpp +112 -0
  1619. data/ext/couchbase/third_party/json/include/tao/json/ubjson/consume_file.hpp +34 -0
  1620. data/ext/couchbase/third_party/json/include/tao/json/ubjson/consume_string.hpp +32 -0
  1621. data/ext/couchbase/third_party/json/include/tao/json/ubjson/events/from_binary.hpp +44 -0
  1622. data/ext/couchbase/third_party/json/include/tao/json/ubjson/events/from_file.hpp +27 -0
  1623. data/ext/couchbase/third_party/json/include/tao/json/ubjson/events/from_input.hpp +43 -0
  1624. data/ext/couchbase/third_party/json/include/tao/json/ubjson/events/from_string.hpp +37 -0
  1625. data/ext/couchbase/third_party/json/include/tao/json/ubjson/events/to_stream.hpp +174 -0
  1626. data/ext/couchbase/third_party/json/include/tao/json/ubjson/events/to_string.hpp +37 -0
  1627. data/ext/couchbase/third_party/json/include/tao/json/ubjson/from_binary.hpp +32 -0
  1628. data/ext/couchbase/third_party/json/include/tao/json/ubjson/from_file.hpp +33 -0
  1629. data/ext/couchbase/third_party/json/include/tao/json/ubjson/from_input.hpp +33 -0
  1630. data/ext/couchbase/third_party/json/include/tao/json/ubjson/from_string.hpp +32 -0
  1631. data/ext/couchbase/third_party/json/include/tao/json/ubjson/internal/grammar.hpp +415 -0
  1632. data/ext/couchbase/third_party/json/include/tao/json/ubjson/internal/marker.hpp +46 -0
  1633. data/ext/couchbase/third_party/json/include/tao/json/ubjson/parts_parser.hpp +396 -0
  1634. data/ext/couchbase/third_party/json/include/tao/json/ubjson/to_stream.hpp +28 -0
  1635. data/ext/couchbase/third_party/json/include/tao/json/ubjson/to_string.hpp +30 -0
  1636. data/ext/couchbase/third_party/json/include/tao/json/ubjson.hpp +19 -0
  1637. data/ext/couchbase/third_party/json/include/tao/json/utf8.hpp +56 -0
  1638. data/ext/couchbase/third_party/json/include/tao/json/value.hpp +12 -0
  1639. data/ext/couchbase/third_party/json/include/tao/json.hpp +45 -0
  1640. data/ext/couchbase/third_party/jsonsl/LICENSE +20 -0
  1641. data/ext/couchbase/third_party/jsonsl/jsonsl.c +3059 -0
  1642. data/ext/couchbase/third_party/jsonsl/jsonsl.h +978 -0
  1643. data/ext/couchbase/third_party/snappy/CMakeLists.txt +297 -0
  1644. data/ext/couchbase/third_party/snappy/COPYING +54 -0
  1645. data/ext/couchbase/third_party/snappy/cmake/SnappyConfig.cmake.in +33 -0
  1646. data/ext/couchbase/third_party/snappy/cmake/config.h.in +62 -0
  1647. data/ext/couchbase/third_party/snappy/snappy-c.cc +90 -0
  1648. data/ext/couchbase/third_party/snappy/snappy-c.h +138 -0
  1649. data/ext/couchbase/third_party/snappy/snappy-internal.h +231 -0
  1650. data/ext/couchbase/third_party/snappy/snappy-sinksource.cc +104 -0
  1651. data/ext/couchbase/third_party/snappy/snappy-sinksource.h +182 -0
  1652. data/ext/couchbase/third_party/snappy/snappy-stubs-internal.cc +42 -0
  1653. data/ext/couchbase/third_party/snappy/snappy-stubs-internal.h +606 -0
  1654. data/ext/couchbase/third_party/snappy/snappy-stubs-public.h.in +74 -0
  1655. data/ext/couchbase/third_party/snappy/snappy.cc +1661 -0
  1656. data/ext/couchbase/third_party/snappy/snappy.h +207 -0
  1657. data/ext/couchbase/third_party/spdlog/CMakeLists.txt +320 -0
  1658. data/ext/couchbase/third_party/spdlog/LICENSE +26 -0
  1659. data/ext/couchbase/third_party/spdlog/cmake/ide.cmake +18 -0
  1660. data/ext/couchbase/third_party/spdlog/cmake/pch.h.in +258 -0
  1661. data/ext/couchbase/third_party/spdlog/cmake/spdlog.pc.in +13 -0
  1662. data/ext/couchbase/third_party/spdlog/cmake/spdlogCPack.cmake +60 -0
  1663. data/ext/couchbase/third_party/spdlog/cmake/spdlogConfig.cmake.in +19 -0
  1664. data/ext/couchbase/third_party/spdlog/cmake/utils.cmake +62 -0
  1665. data/ext/couchbase/third_party/spdlog/cmake/version.rc.in +42 -0
  1666. data/ext/couchbase/third_party/spdlog/include/spdlog/async.h +93 -0
  1667. data/ext/couchbase/third_party/spdlog/include/spdlog/async_logger-inl.h +92 -0
  1668. data/ext/couchbase/third_party/spdlog/include/spdlog/async_logger.h +68 -0
  1669. data/ext/couchbase/third_party/spdlog/include/spdlog/cfg/argv.h +44 -0
  1670. data/ext/couchbase/third_party/spdlog/include/spdlog/cfg/env.h +38 -0
  1671. data/ext/couchbase/third_party/spdlog/include/spdlog/cfg/helpers-inl.h +120 -0
  1672. data/ext/couchbase/third_party/spdlog/include/spdlog/cfg/helpers.h +29 -0
  1673. data/ext/couchbase/third_party/spdlog/include/spdlog/common-inl.h +78 -0
  1674. data/ext/couchbase/third_party/spdlog/include/spdlog/common.h +276 -0
  1675. data/ext/couchbase/third_party/spdlog/include/spdlog/details/backtracer-inl.h +69 -0
  1676. data/ext/couchbase/third_party/spdlog/include/spdlog/details/backtracer.h +45 -0
  1677. data/ext/couchbase/third_party/spdlog/include/spdlog/details/circular_q.h +141 -0
  1678. data/ext/couchbase/third_party/spdlog/include/spdlog/details/console_globals.h +32 -0
  1679. data/ext/couchbase/third_party/spdlog/include/spdlog/details/file_helper-inl.h +147 -0
  1680. data/ext/couchbase/third_party/spdlog/include/spdlog/details/file_helper.h +59 -0
  1681. data/ext/couchbase/third_party/spdlog/include/spdlog/details/fmt_helper.h +117 -0
  1682. data/ext/couchbase/third_party/spdlog/include/spdlog/details/log_msg-inl.h +37 -0
  1683. data/ext/couchbase/third_party/spdlog/include/spdlog/details/log_msg.h +37 -0
  1684. data/ext/couchbase/third_party/spdlog/include/spdlog/details/log_msg_buffer-inl.h +58 -0
  1685. data/ext/couchbase/third_party/spdlog/include/spdlog/details/log_msg_buffer.h +33 -0
  1686. data/ext/couchbase/third_party/spdlog/include/spdlog/details/mpmc_blocking_q.h +126 -0
  1687. data/ext/couchbase/third_party/spdlog/include/spdlog/details/null_mutex.h +49 -0
  1688. data/ext/couchbase/third_party/spdlog/include/spdlog/details/os-inl.h +599 -0
  1689. data/ext/couchbase/third_party/spdlog/include/spdlog/details/os.h +118 -0
  1690. data/ext/couchbase/third_party/spdlog/include/spdlog/details/periodic_worker-inl.h +49 -0
  1691. data/ext/couchbase/third_party/spdlog/include/spdlog/details/periodic_worker.h +40 -0
  1692. data/ext/couchbase/third_party/spdlog/include/spdlog/details/registry-inl.h +313 -0
  1693. data/ext/couchbase/third_party/spdlog/include/spdlog/details/registry.h +115 -0
  1694. data/ext/couchbase/third_party/spdlog/include/spdlog/details/synchronous_factory.h +24 -0
  1695. data/ext/couchbase/third_party/spdlog/include/spdlog/details/tcp_client-windows.h +175 -0
  1696. data/ext/couchbase/third_party/spdlog/include/spdlog/details/tcp_client.h +146 -0
  1697. data/ext/couchbase/third_party/spdlog/include/spdlog/details/thread_pool-inl.h +129 -0
  1698. data/ext/couchbase/third_party/spdlog/include/spdlog/details/thread_pool.h +120 -0
  1699. data/ext/couchbase/third_party/spdlog/include/spdlog/details/windows_include.h +11 -0
  1700. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bin_to_hex.h +217 -0
  1701. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/args.h +232 -0
  1702. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/chrono.h +1308 -0
  1703. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/color.h +627 -0
  1704. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/compile.h +639 -0
  1705. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/core.h +3002 -0
  1706. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/format-inl.h +2620 -0
  1707. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/format.h +2830 -0
  1708. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/locale.h +2 -0
  1709. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/os.h +515 -0
  1710. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/ostream.h +181 -0
  1711. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/printf.h +652 -0
  1712. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/ranges.h +468 -0
  1713. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/bundled/xchar.h +236 -0
  1714. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/chrono.h +20 -0
  1715. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/compile.h +20 -0
  1716. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/fmt.h +27 -0
  1717. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/ostr.h +20 -0
  1718. data/ext/couchbase/third_party/spdlog/include/spdlog/fmt/xchar.h +20 -0
  1719. data/ext/couchbase/third_party/spdlog/include/spdlog/formatter.h +18 -0
  1720. data/ext/couchbase/third_party/spdlog/include/spdlog/fwd.h +14 -0
  1721. data/ext/couchbase/third_party/spdlog/include/spdlog/logger-inl.h +257 -0
  1722. data/ext/couchbase/third_party/spdlog/include/spdlog/logger.h +403 -0
  1723. data/ext/couchbase/third_party/spdlog/include/spdlog/pattern_formatter-inl.h +1395 -0
  1724. data/ext/couchbase/third_party/spdlog/include/spdlog/pattern_formatter.h +126 -0
  1725. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/android_sink.h +119 -0
  1726. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/ansicolor_sink-inl.h +145 -0
  1727. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/ansicolor_sink.h +118 -0
  1728. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/base_sink-inl.h +63 -0
  1729. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/base_sink.h +52 -0
  1730. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/basic_file_sink-inl.h +43 -0
  1731. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/basic_file_sink.h +58 -0
  1732. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/daily_file_sink.h +242 -0
  1733. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/dist_sink.h +97 -0
  1734. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/dup_filter_sink.h +94 -0
  1735. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/hourly_file_sink.h +194 -0
  1736. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/mongo_sink.h +98 -0
  1737. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/msvc_sink.h +48 -0
  1738. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/null_sink.h +44 -0
  1739. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/ostream_sink.h +50 -0
  1740. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/qt_sinks.h +93 -0
  1741. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/ringbuffer_sink.h +74 -0
  1742. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/rotating_file_sink-inl.h +131 -0
  1743. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/rotating_file_sink.h +78 -0
  1744. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/sink-inl.h +25 -0
  1745. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/sink.h +35 -0
  1746. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/stdout_color_sinks-inl.h +38 -0
  1747. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/stdout_color_sinks.h +45 -0
  1748. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/stdout_sinks-inl.h +139 -0
  1749. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/stdout_sinks.h +87 -0
  1750. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/syslog_sink.h +109 -0
  1751. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/systemd_sink.h +103 -0
  1752. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/tcp_sink.h +81 -0
  1753. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/win_eventlog_sink.h +276 -0
  1754. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/wincolor_sink-inl.h +175 -0
  1755. data/ext/couchbase/third_party/spdlog/include/spdlog/sinks/wincolor_sink.h +85 -0
  1756. data/ext/couchbase/third_party/spdlog/include/spdlog/spdlog-inl.h +125 -0
  1757. data/ext/couchbase/third_party/spdlog/include/spdlog/spdlog.h +345 -0
  1758. data/ext/couchbase/third_party/spdlog/include/spdlog/stopwatch.h +61 -0
  1759. data/ext/couchbase/third_party/spdlog/include/spdlog/tweakme.h +124 -0
  1760. data/ext/couchbase/third_party/spdlog/include/spdlog/version.h +10 -0
  1761. data/ext/couchbase/third_party/spdlog/src/async.cpp +13 -0
  1762. data/ext/couchbase/third_party/spdlog/src/cfg.cpp +8 -0
  1763. data/ext/couchbase/third_party/spdlog/src/color_sinks.cpp +51 -0
  1764. data/ext/couchbase/third_party/spdlog/src/file_sinks.cpp +20 -0
  1765. data/ext/couchbase/third_party/spdlog/src/fmt.cpp +68 -0
  1766. data/ext/couchbase/third_party/spdlog/src/spdlog.cpp +26 -0
  1767. data/ext/couchbase/third_party/spdlog/src/stdout_sinks.cpp +29 -0
  1768. data/ext/couchbase.cxx +7422 -0
  1769. data/ext/ext_build_version.hxx.in +20 -0
  1770. data/ext/extconf.rb +137 -0
  1771. data/ext/revisions.rb +2 -0
  1772. data/lib/active_support/cache/couchbase_store.rb +257 -348
  1773. data/lib/couchbase/analytics_options.rb +107 -0
  1774. data/lib/couchbase/authenticator.rb +65 -0
  1775. data/lib/couchbase/binary_collection.rb +128 -0
  1776. data/lib/couchbase/binary_collection_options.rb +24 -0
  1777. data/lib/couchbase/bucket.rb +104 -417
  1778. data/lib/couchbase/cluster.rb +415 -101
  1779. data/lib/couchbase/collection.rb +563 -0
  1780. data/lib/couchbase/collection_options.rb +344 -0
  1781. data/lib/couchbase/configuration.rb +57 -0
  1782. data/lib/couchbase/datastructures/couchbase_list.rb +160 -0
  1783. data/lib/couchbase/datastructures/couchbase_map.rb +194 -0
  1784. data/lib/couchbase/datastructures/couchbase_queue.rb +134 -0
  1785. data/lib/couchbase/datastructures/couchbase_set.rb +128 -0
  1786. data/lib/couchbase/datastructures.rb +24 -0
  1787. data/lib/couchbase/diagnostics.rb +181 -0
  1788. data/lib/couchbase/errors.rb +351 -0
  1789. data/lib/couchbase/json_transcoder.rb +32 -0
  1790. data/lib/couchbase/logger.rb +42 -0
  1791. data/lib/couchbase/management/analytics_index_manager.rb +1127 -0
  1792. data/lib/couchbase/management/bucket_manager.rb +436 -0
  1793. data/lib/couchbase/management/collection_manager.rb +321 -0
  1794. data/lib/couchbase/management/query_index_manager.rb +522 -0
  1795. data/lib/couchbase/management/search_index_manager.rb +408 -0
  1796. data/lib/couchbase/management/user_manager.rb +449 -0
  1797. data/lib/couchbase/management/view_index_manager.rb +237 -0
  1798. data/lib/couchbase/management.rb +27 -0
  1799. data/lib/couchbase/mutation_state.rb +63 -0
  1800. data/lib/couchbase/options.rb +2232 -0
  1801. data/lib/couchbase/query_options.rb +120 -0
  1802. data/lib/couchbase/railtie.rb +45 -0
  1803. data/lib/couchbase/scope.rb +232 -0
  1804. data/lib/couchbase/search_options.rb +1571 -0
  1805. data/lib/couchbase/subdoc.rb +290 -0
  1806. data/lib/couchbase/utils/time.rb +56 -0
  1807. data/lib/couchbase/utils.rb +14 -55
  1808. data/lib/couchbase/version.rb +31 -15
  1809. data/lib/couchbase/view_options.rb +65 -0
  1810. data/lib/couchbase.rb +17 -152
  1811. data/lib/rails/generators/couchbase/config/config_generator.rb +27 -0
  1812. metadata +1830 -291
  1813. data/.gitignore +0 -15
  1814. data/.travis.yml +0 -22
  1815. data/.yardopts +0 -5
  1816. data/CONTRIBUTING.markdown +0 -75
  1817. data/Gemfile +0 -4
  1818. data/LICENSE +0 -201
  1819. data/Makefile +0 -3
  1820. data/README.markdown +0 -592
  1821. data/RELEASE_NOTES.markdown +0 -909
  1822. data/Rakefile +0 -20
  1823. data/couchbase.gemspec +0 -50
  1824. data/examples/chat-em/Gemfile +0 -7
  1825. data/examples/chat-em/README.markdown +0 -45
  1826. data/examples/chat-em/server.rb +0 -82
  1827. data/examples/chat-goliath-grape/Gemfile +0 -5
  1828. data/examples/chat-goliath-grape/README.markdown +0 -50
  1829. data/examples/chat-goliath-grape/app.rb +0 -67
  1830. data/examples/chat-goliath-grape/config/app.rb +0 -20
  1831. data/examples/transcoders/Gemfile +0 -3
  1832. data/examples/transcoders/README.markdown +0 -59
  1833. data/examples/transcoders/cb-zcat +0 -40
  1834. data/examples/transcoders/cb-zcp +0 -45
  1835. data/examples/transcoders/gzip_transcoder.rb +0 -49
  1836. data/examples/transcoders/options.rb +0 -54
  1837. data/ext/couchbase_ext/.gitignore +0 -4
  1838. data/ext/couchbase_ext/arguments.c +0 -979
  1839. data/ext/couchbase_ext/arithmetic.c +0 -316
  1840. data/ext/couchbase_ext/bucket.c +0 -1436
  1841. data/ext/couchbase_ext/context.c +0 -65
  1842. data/ext/couchbase_ext/couchbase_ext.c +0 -1480
  1843. data/ext/couchbase_ext/couchbase_ext.h +0 -678
  1844. data/ext/couchbase_ext/delete.c +0 -163
  1845. data/ext/couchbase_ext/eventmachine_plugin.c +0 -466
  1846. data/ext/couchbase_ext/extconf.rb +0 -194
  1847. data/ext/couchbase_ext/get.c +0 -316
  1848. data/ext/couchbase_ext/gethrtime.c +0 -129
  1849. data/ext/couchbase_ext/http.c +0 -432
  1850. data/ext/couchbase_ext/multithread_plugin.c +0 -1085
  1851. data/ext/couchbase_ext/n1ql.c +0 -117
  1852. data/ext/couchbase_ext/observe.c +0 -171
  1853. data/ext/couchbase_ext/result.c +0 -129
  1854. data/ext/couchbase_ext/stats.c +0 -163
  1855. data/ext/couchbase_ext/store.c +0 -542
  1856. data/ext/couchbase_ext/timer.c +0 -192
  1857. data/ext/couchbase_ext/touch.c +0 -186
  1858. data/ext/couchbase_ext/unlock.c +0 -176
  1859. data/ext/couchbase_ext/utils.c +0 -558
  1860. data/ext/couchbase_ext/version.c +0 -142
  1861. data/lib/action_dispatch/middleware/session/couchbase_store.rb +0 -38
  1862. data/lib/couchbase/connection_pool.rb +0 -58
  1863. data/lib/couchbase/constants.rb +0 -12
  1864. data/lib/couchbase/dns.rb +0 -76
  1865. data/lib/couchbase/result.rb +0 -26
  1866. data/lib/couchbase/transcoder.rb +0 -120
  1867. data/lib/couchbase/view.rb +0 -506
  1868. data/lib/couchbase/view_row.rb +0 -272
  1869. data/lib/ext/multi_json_fix.rb +0 -56
  1870. data/lib/rack/session/couchbase.rb +0 -108
  1871. data/tasks/benchmark.rake +0 -6
  1872. data/tasks/compile.rake +0 -153
  1873. data/tasks/test.rake +0 -100
  1874. data/tasks/util.rake +0 -21
  1875. data/test/profile/.gitignore +0 -1
  1876. data/test/profile/Gemfile +0 -6
  1877. data/test/profile/benchmark.rb +0 -195
  1878. data/test/setup.rb +0 -178
  1879. data/test/test_arithmetic.rb +0 -185
  1880. data/test/test_async.rb +0 -316
  1881. data/test/test_bucket.rb +0 -299
  1882. data/test/test_cas.rb +0 -235
  1883. data/test/test_couchbase.rb +0 -77
  1884. data/test/test_couchbase_connection_pool.rb +0 -77
  1885. data/test/test_couchbase_rails_cache_store.rb +0 -358
  1886. data/test/test_delete.rb +0 -120
  1887. data/test/test_errors.rb +0 -82
  1888. data/test/test_eventmachine.rb +0 -78
  1889. data/test/test_format.rb +0 -164
  1890. data/test/test_get.rb +0 -407
  1891. data/test/test_stats.rb +0 -57
  1892. data/test/test_store.rb +0 -224
  1893. data/test/test_timer.rb +0 -42
  1894. data/test/test_touch.rb +0 -97
  1895. data/test/test_unlock.rb +0 -119
  1896. data/test/test_utils.rb +0 -58
  1897. data/test/test_version.rb +0 -52
@@ -0,0 +1,2830 @@
1
+ /*
2
+ Formatting library for C++
3
+
4
+ Copyright (c) 2012 - present, Victor Zverovich
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ "Software"), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
+
25
+ --- Optional exception to the license ---
26
+
27
+ As an exception, if, as a result of your compiling your source code, portions
28
+ of this Software are embedded into a machine-executable object form of such
29
+ source code, you may redistribute such embedded portions in such object form
30
+ without including the above copyright and permission notices.
31
+ */
32
+
33
+ #ifndef FMT_FORMAT_H_
34
+ #define FMT_FORMAT_H_
35
+
36
+ #include <cmath> // std::signbit
37
+ #include <cstdint> // uint32_t
38
+ #include <limits> // std::numeric_limits
39
+ #include <memory> // std::uninitialized_copy
40
+ #include <stdexcept> // std::runtime_error
41
+ #include <system_error> // std::system_error
42
+ #include <utility> // std::swap
43
+
44
+ #include "core.h"
45
+
46
+ #ifdef __INTEL_COMPILER
47
+ # define FMT_ICC_VERSION __INTEL_COMPILER
48
+ #elif defined(__ICL)
49
+ # define FMT_ICC_VERSION __ICL
50
+ #else
51
+ # define FMT_ICC_VERSION 0
52
+ #endif
53
+
54
+ #ifdef __NVCC__
55
+ # define FMT_CUDA_VERSION (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__)
56
+ #else
57
+ # define FMT_CUDA_VERSION 0
58
+ #endif
59
+
60
+ #ifdef __has_builtin
61
+ # define FMT_HAS_BUILTIN(x) __has_builtin(x)
62
+ #else
63
+ # define FMT_HAS_BUILTIN(x) 0
64
+ #endif
65
+
66
+ #if FMT_GCC_VERSION || FMT_CLANG_VERSION
67
+ # define FMT_NOINLINE __attribute__((noinline))
68
+ #else
69
+ # define FMT_NOINLINE
70
+ #endif
71
+
72
+ #if FMT_MSC_VER
73
+ # define FMT_MSC_DEFAULT = default
74
+ #else
75
+ # define FMT_MSC_DEFAULT
76
+ #endif
77
+
78
+ #ifndef FMT_THROW
79
+ # if FMT_EXCEPTIONS
80
+ # if FMT_MSC_VER || FMT_NVCC
81
+ FMT_BEGIN_NAMESPACE
82
+ namespace detail {
83
+ template <typename Exception> inline void do_throw(const Exception& x) {
84
+ // Silence unreachable code warnings in MSVC and NVCC because these
85
+ // are nearly impossible to fix in a generic code.
86
+ volatile bool b = true;
87
+ if (b) throw x;
88
+ }
89
+ } // namespace detail
90
+ FMT_END_NAMESPACE
91
+ # define FMT_THROW(x) detail::do_throw(x)
92
+ # else
93
+ # define FMT_THROW(x) throw x
94
+ # endif
95
+ # else
96
+ # define FMT_THROW(x) \
97
+ do { \
98
+ FMT_ASSERT(false, (x).what()); \
99
+ } while (false)
100
+ # endif
101
+ #endif
102
+
103
+ #if FMT_EXCEPTIONS
104
+ # define FMT_TRY try
105
+ # define FMT_CATCH(x) catch (x)
106
+ #else
107
+ # define FMT_TRY if (true)
108
+ # define FMT_CATCH(x) if (false)
109
+ #endif
110
+
111
+ #ifndef FMT_DEPRECATED
112
+ # if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
113
+ # define FMT_DEPRECATED [[deprecated]]
114
+ # else
115
+ # if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
116
+ # define FMT_DEPRECATED __attribute__((deprecated))
117
+ # elif FMT_MSC_VER
118
+ # define FMT_DEPRECATED __declspec(deprecated)
119
+ # else
120
+ # define FMT_DEPRECATED /* deprecated */
121
+ # endif
122
+ # endif
123
+ #endif
124
+
125
+ // Workaround broken [[deprecated]] in the Intel, PGI and NVCC compilers.
126
+ #if FMT_ICC_VERSION || defined(__PGI) || FMT_NVCC
127
+ # define FMT_DEPRECATED_ALIAS
128
+ #else
129
+ # define FMT_DEPRECATED_ALIAS FMT_DEPRECATED
130
+ #endif
131
+
132
+ #ifndef FMT_USE_USER_DEFINED_LITERALS
133
+ // EDG based compilers (Intel, NVIDIA, Elbrus, etc), GCC and MSVC support UDLs.
134
+ # if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 407 || \
135
+ FMT_MSC_VER >= 1900) && \
136
+ (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= /* UDL feature */ 480)
137
+ # define FMT_USE_USER_DEFINED_LITERALS 1
138
+ # else
139
+ # define FMT_USE_USER_DEFINED_LITERALS 0
140
+ # endif
141
+ #endif
142
+
143
+ // Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of
144
+ // integer formatter template instantiations to just one by only using the
145
+ // largest integer type. This results in a reduction in binary size but will
146
+ // cause a decrease in integer formatting performance.
147
+ #if !defined(FMT_REDUCE_INT_INSTANTIATIONS)
148
+ # define FMT_REDUCE_INT_INSTANTIATIONS 0
149
+ #endif
150
+
151
+ // __builtin_clz is broken in clang with Microsoft CodeGen:
152
+ // https://github.com/fmtlib/fmt/issues/519
153
+ #if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER
154
+ # define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
155
+ #endif
156
+ #if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)) && !FMT_MSC_VER
157
+ # define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
158
+ #endif
159
+ #if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz))
160
+ # define FMT_BUILTIN_CTZ(n) __builtin_ctz(n)
161
+ #endif
162
+ #if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll))
163
+ # define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n)
164
+ #endif
165
+
166
+ #if FMT_MSC_VER
167
+ # include <intrin.h> // _BitScanReverse[64], _BitScanForward[64], _umul128
168
+ #endif
169
+
170
+ // Some compilers masquerade as both MSVC and GCC-likes or otherwise support
171
+ // __builtin_clz and __builtin_clzll, so only define FMT_BUILTIN_CLZ using the
172
+ // MSVC intrinsics if the clz and clzll builtins are not available.
173
+ #if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && !defined(FMT_BUILTIN_CTZLL)
174
+ FMT_BEGIN_NAMESPACE
175
+ namespace detail {
176
+ // Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning.
177
+ # if !defined(__clang__)
178
+ # pragma managed(push, off)
179
+ # pragma intrinsic(_BitScanForward)
180
+ # pragma intrinsic(_BitScanReverse)
181
+ # if defined(_WIN64)
182
+ # pragma intrinsic(_BitScanForward64)
183
+ # pragma intrinsic(_BitScanReverse64)
184
+ # endif
185
+ # endif
186
+
187
+ inline auto clz(uint32_t x) -> int {
188
+ unsigned long r = 0;
189
+ _BitScanReverse(&r, x);
190
+ FMT_ASSERT(x != 0, "");
191
+ // Static analysis complains about using uninitialized data
192
+ // "r", but the only way that can happen is if "x" is 0,
193
+ // which the callers guarantee to not happen.
194
+ FMT_MSC_WARNING(suppress : 6102)
195
+ return 31 ^ static_cast<int>(r);
196
+ }
197
+ # define FMT_BUILTIN_CLZ(n) detail::clz(n)
198
+
199
+ inline auto clzll(uint64_t x) -> int {
200
+ unsigned long r = 0;
201
+ # ifdef _WIN64
202
+ _BitScanReverse64(&r, x);
203
+ # else
204
+ // Scan the high 32 bits.
205
+ if (_BitScanReverse(&r, static_cast<uint32_t>(x >> 32))) return 63 ^ (r + 32);
206
+ // Scan the low 32 bits.
207
+ _BitScanReverse(&r, static_cast<uint32_t>(x));
208
+ # endif
209
+ FMT_ASSERT(x != 0, "");
210
+ FMT_MSC_WARNING(suppress : 6102) // Suppress a bogus static analysis warning.
211
+ return 63 ^ static_cast<int>(r);
212
+ }
213
+ # define FMT_BUILTIN_CLZLL(n) detail::clzll(n)
214
+
215
+ inline auto ctz(uint32_t x) -> int {
216
+ unsigned long r = 0;
217
+ _BitScanForward(&r, x);
218
+ FMT_ASSERT(x != 0, "");
219
+ FMT_MSC_WARNING(suppress : 6102) // Suppress a bogus static analysis warning.
220
+ return static_cast<int>(r);
221
+ }
222
+ # define FMT_BUILTIN_CTZ(n) detail::ctz(n)
223
+
224
+ inline auto ctzll(uint64_t x) -> int {
225
+ unsigned long r = 0;
226
+ FMT_ASSERT(x != 0, "");
227
+ FMT_MSC_WARNING(suppress : 6102) // Suppress a bogus static analysis warning.
228
+ # ifdef _WIN64
229
+ _BitScanForward64(&r, x);
230
+ # else
231
+ // Scan the low 32 bits.
232
+ if (_BitScanForward(&r, static_cast<uint32_t>(x))) return static_cast<int>(r);
233
+ // Scan the high 32 bits.
234
+ _BitScanForward(&r, static_cast<uint32_t>(x >> 32));
235
+ r += 32;
236
+ # endif
237
+ return static_cast<int>(r);
238
+ }
239
+ # define FMT_BUILTIN_CTZLL(n) detail::ctzll(n)
240
+ # if !defined(__clang__)
241
+ # pragma managed(pop)
242
+ # endif
243
+ } // namespace detail
244
+ FMT_END_NAMESPACE
245
+ #endif
246
+
247
+ FMT_BEGIN_NAMESPACE
248
+ namespace detail {
249
+
250
+ #if __cplusplus >= 202002L || \
251
+ (__cplusplus >= 201709L && FMT_GCC_VERSION >= 1002)
252
+ # define FMT_CONSTEXPR20 constexpr
253
+ #else
254
+ # define FMT_CONSTEXPR20
255
+ #endif
256
+
257
+ // An equivalent of `*reinterpret_cast<Dest*>(&source)` that doesn't have
258
+ // undefined behavior (e.g. due to type aliasing).
259
+ // Example: uint64_t d = bit_cast<uint64_t>(2.718);
260
+ template <typename Dest, typename Source>
261
+ inline auto bit_cast(const Source& source) -> Dest {
262
+ static_assert(sizeof(Dest) == sizeof(Source), "size mismatch");
263
+ Dest dest;
264
+ std::memcpy(&dest, &source, sizeof(dest));
265
+ return dest;
266
+ }
267
+
268
+ inline auto is_big_endian() -> bool {
269
+ const auto u = 1u;
270
+ struct bytes {
271
+ char data[sizeof(u)];
272
+ };
273
+ return bit_cast<bytes>(u).data[0] == 0;
274
+ }
275
+
276
+ // A fallback implementation of uintptr_t for systems that lack it.
277
+ struct fallback_uintptr {
278
+ unsigned char value[sizeof(void*)];
279
+
280
+ fallback_uintptr() = default;
281
+ explicit fallback_uintptr(const void* p) {
282
+ *this = bit_cast<fallback_uintptr>(p);
283
+ if (is_big_endian()) {
284
+ for (size_t i = 0, j = sizeof(void*) - 1; i < j; ++i, --j)
285
+ std::swap(value[i], value[j]);
286
+ }
287
+ }
288
+ };
289
+ #ifdef UINTPTR_MAX
290
+ using uintptr_t = ::uintptr_t;
291
+ inline auto to_uintptr(const void* p) -> uintptr_t {
292
+ return bit_cast<uintptr_t>(p);
293
+ }
294
+ #else
295
+ using uintptr_t = fallback_uintptr;
296
+ inline auto to_uintptr(const void* p) -> fallback_uintptr {
297
+ return fallback_uintptr(p);
298
+ }
299
+ #endif
300
+
301
+ // Returns the largest possible value for type T. Same as
302
+ // std::numeric_limits<T>::max() but shorter and not affected by the max macro.
303
+ template <typename T> constexpr auto max_value() -> T {
304
+ return (std::numeric_limits<T>::max)();
305
+ }
306
+ template <typename T> constexpr auto num_bits() -> int {
307
+ return std::numeric_limits<T>::digits;
308
+ }
309
+ // std::numeric_limits<T>::digits may return 0 for 128-bit ints.
310
+ template <> constexpr auto num_bits<int128_t>() -> int { return 128; }
311
+ template <> constexpr auto num_bits<uint128_t>() -> int { return 128; }
312
+ template <> constexpr auto num_bits<fallback_uintptr>() -> int {
313
+ return static_cast<int>(sizeof(void*) *
314
+ std::numeric_limits<unsigned char>::digits);
315
+ }
316
+
317
+ FMT_INLINE void assume(bool condition) {
318
+ (void)condition;
319
+ #if FMT_HAS_BUILTIN(__builtin_assume)
320
+ __builtin_assume(condition);
321
+ #endif
322
+ }
323
+
324
+ // An approximation of iterator_t for pre-C++20 systems.
325
+ template <typename T>
326
+ using iterator_t = decltype(std::begin(std::declval<T&>()));
327
+ template <typename T> using sentinel_t = decltype(std::end(std::declval<T&>()));
328
+
329
+ // A workaround for std::string not having mutable data() until C++17.
330
+ template <typename Char>
331
+ inline auto get_data(std::basic_string<Char>& s) -> Char* {
332
+ return &s[0];
333
+ }
334
+ template <typename Container>
335
+ inline auto get_data(Container& c) -> typename Container::value_type* {
336
+ return c.data();
337
+ }
338
+
339
+ #if defined(_SECURE_SCL) && _SECURE_SCL
340
+ // Make a checked iterator to avoid MSVC warnings.
341
+ template <typename T> using checked_ptr = stdext::checked_array_iterator<T*>;
342
+ template <typename T> auto make_checked(T* p, size_t size) -> checked_ptr<T> {
343
+ return {p, size};
344
+ }
345
+ #else
346
+ template <typename T> using checked_ptr = T*;
347
+ template <typename T> inline auto make_checked(T* p, size_t) -> T* { return p; }
348
+ #endif
349
+
350
+ // Attempts to reserve space for n extra characters in the output range.
351
+ // Returns a pointer to the reserved range or a reference to it.
352
+ template <typename Container, FMT_ENABLE_IF(is_contiguous<Container>::value)>
353
+ #if FMT_CLANG_VERSION >= 307 && !FMT_ICC_VERSION
354
+ __attribute__((no_sanitize("undefined")))
355
+ #endif
356
+ inline auto
357
+ reserve(std::back_insert_iterator<Container> it, size_t n)
358
+ -> checked_ptr<typename Container::value_type> {
359
+ Container& c = get_container(it);
360
+ size_t size = c.size();
361
+ c.resize(size + n);
362
+ return make_checked(get_data(c) + size, n);
363
+ }
364
+
365
+ template <typename T>
366
+ inline auto reserve(buffer_appender<T> it, size_t n) -> buffer_appender<T> {
367
+ buffer<T>& buf = get_container(it);
368
+ buf.try_reserve(buf.size() + n);
369
+ return it;
370
+ }
371
+
372
+ template <typename Iterator>
373
+ constexpr auto reserve(Iterator& it, size_t) -> Iterator& {
374
+ return it;
375
+ }
376
+
377
+ template <typename OutputIt>
378
+ using reserve_iterator =
379
+ remove_reference_t<decltype(reserve(std::declval<OutputIt&>(), 0))>;
380
+
381
+ template <typename T, typename OutputIt>
382
+ constexpr auto to_pointer(OutputIt, size_t) -> T* {
383
+ return nullptr;
384
+ }
385
+ template <typename T> auto to_pointer(buffer_appender<T> it, size_t n) -> T* {
386
+ buffer<T>& buf = get_container(it);
387
+ auto size = buf.size();
388
+ if (buf.capacity() < size + n) return nullptr;
389
+ buf.try_resize(size + n);
390
+ return buf.data() + size;
391
+ }
392
+
393
+ template <typename Container, FMT_ENABLE_IF(is_contiguous<Container>::value)>
394
+ inline auto base_iterator(std::back_insert_iterator<Container>& it,
395
+ checked_ptr<typename Container::value_type>)
396
+ -> std::back_insert_iterator<Container> {
397
+ return it;
398
+ }
399
+
400
+ template <typename Iterator>
401
+ constexpr auto base_iterator(Iterator, Iterator it) -> Iterator {
402
+ return it;
403
+ }
404
+
405
+ // <algorithm> is spectacularly slow to compile in C++20 so use a simple fill_n
406
+ // instead (#1998).
407
+ template <typename OutputIt, typename Size, typename T>
408
+ FMT_CONSTEXPR auto fill_n(OutputIt out, Size count, const T& value)
409
+ -> OutputIt {
410
+ for (Size i = 0; i < count; ++i) *out++ = value;
411
+ return out;
412
+ }
413
+ template <typename T, typename Size>
414
+ FMT_CONSTEXPR20 auto fill_n(T* out, Size count, char value) -> T* {
415
+ if (is_constant_evaluated()) {
416
+ return fill_n<T*, Size, T>(out, count, value);
417
+ }
418
+ std::memset(out, value, to_unsigned(count));
419
+ return out + count;
420
+ }
421
+
422
+ #ifdef __cpp_char8_t
423
+ using char8_type = char8_t;
424
+ #else
425
+ enum char8_type : unsigned char {};
426
+ #endif
427
+
428
+ template <typename OutChar, typename InputIt, typename OutputIt>
429
+ FMT_CONSTEXPR FMT_NOINLINE auto copy_str_noinline(InputIt begin, InputIt end,
430
+ OutputIt out) -> OutputIt {
431
+ return copy_str<OutChar>(begin, end, out);
432
+ }
433
+
434
+ // A public domain branchless UTF-8 decoder by Christopher Wellons:
435
+ // https://github.com/skeeto/branchless-utf8
436
+ /* Decode the next character, c, from s, reporting errors in e.
437
+ *
438
+ * Since this is a branchless decoder, four bytes will be read from the
439
+ * buffer regardless of the actual length of the next character. This
440
+ * means the buffer _must_ have at least three bytes of zero padding
441
+ * following the end of the data stream.
442
+ *
443
+ * Errors are reported in e, which will be non-zero if the parsed
444
+ * character was somehow invalid: invalid byte sequence, non-canonical
445
+ * encoding, or a surrogate half.
446
+ *
447
+ * The function returns a pointer to the next character. When an error
448
+ * occurs, this pointer will be a guess that depends on the particular
449
+ * error, but it will always advance at least one byte.
450
+ */
451
+ FMT_CONSTEXPR inline auto utf8_decode(const char* s, uint32_t* c, int* e)
452
+ -> const char* {
453
+ constexpr const int masks[] = {0x00, 0x7f, 0x1f, 0x0f, 0x07};
454
+ constexpr const uint32_t mins[] = {4194304, 0, 128, 2048, 65536};
455
+ constexpr const int shiftc[] = {0, 18, 12, 6, 0};
456
+ constexpr const int shifte[] = {0, 6, 4, 2, 0};
457
+
458
+ int len = code_point_length(s);
459
+ const char* next = s + len;
460
+
461
+ // Assume a four-byte character and load four bytes. Unused bits are
462
+ // shifted out.
463
+ *c = uint32_t(s[0] & masks[len]) << 18;
464
+ *c |= uint32_t(s[1] & 0x3f) << 12;
465
+ *c |= uint32_t(s[2] & 0x3f) << 6;
466
+ *c |= uint32_t(s[3] & 0x3f) << 0;
467
+ *c >>= shiftc[len];
468
+
469
+ // Accumulate the various error conditions.
470
+ using uchar = unsigned char;
471
+ *e = (*c < mins[len]) << 6; // non-canonical encoding
472
+ *e |= ((*c >> 11) == 0x1b) << 7; // surrogate half?
473
+ *e |= (*c > 0x10FFFF) << 8; // out of range?
474
+ *e |= (uchar(s[1]) & 0xc0) >> 2;
475
+ *e |= (uchar(s[2]) & 0xc0) >> 4;
476
+ *e |= uchar(s[3]) >> 6;
477
+ *e ^= 0x2a; // top two bits of each tail byte correct?
478
+ *e >>= shifte[len];
479
+
480
+ return next;
481
+ }
482
+
483
+ template <typename F>
484
+ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
485
+ auto decode = [f](const char* p) {
486
+ auto cp = uint32_t();
487
+ auto error = 0;
488
+ p = utf8_decode(p, &cp, &error);
489
+ f(cp, error);
490
+ return p;
491
+ };
492
+ auto p = s.data();
493
+ const size_t block_size = 4; // utf8_decode always reads blocks of 4 chars.
494
+ if (s.size() >= block_size) {
495
+ for (auto end = p + s.size() - block_size + 1; p < end;) p = decode(p);
496
+ }
497
+ if (auto num_chars_left = s.data() + s.size() - p) {
498
+ char buf[2 * block_size - 1] = {};
499
+ copy_str<char>(p, p + num_chars_left, buf);
500
+ p = buf;
501
+ do {
502
+ p = decode(p);
503
+ } while (p - buf < num_chars_left);
504
+ }
505
+ }
506
+
507
+ template <typename Char>
508
+ inline auto compute_width(basic_string_view<Char> s) -> size_t {
509
+ return s.size();
510
+ }
511
+
512
+ // Computes approximate display width of a UTF-8 string.
513
+ FMT_CONSTEXPR inline size_t compute_width(string_view s) {
514
+ size_t num_code_points = 0;
515
+ // It is not a lambda for compatibility with C++14.
516
+ struct count_code_points {
517
+ size_t* count;
518
+ FMT_CONSTEXPR void operator()(uint32_t cp, int error) const {
519
+ *count += detail::to_unsigned(
520
+ 1 +
521
+ (error == 0 && cp >= 0x1100 &&
522
+ (cp <= 0x115f || // Hangul Jamo init. consonants
523
+ cp == 0x2329 || // LEFT-POINTING ANGLE BRACKET
524
+ cp == 0x232a || // RIGHT-POINTING ANGLE BRACKET
525
+ // CJK ... Yi except IDEOGRAPHIC HALF FILL SPACE:
526
+ (cp >= 0x2e80 && cp <= 0xa4cf && cp != 0x303f) ||
527
+ (cp >= 0xac00 && cp <= 0xd7a3) || // Hangul Syllables
528
+ (cp >= 0xf900 && cp <= 0xfaff) || // CJK Compatibility Ideographs
529
+ (cp >= 0xfe10 && cp <= 0xfe19) || // Vertical Forms
530
+ (cp >= 0xfe30 && cp <= 0xfe6f) || // CJK Compatibility Forms
531
+ (cp >= 0xff00 && cp <= 0xff60) || // Fullwidth Forms
532
+ (cp >= 0xffe0 && cp <= 0xffe6) || // Fullwidth Forms
533
+ (cp >= 0x20000 && cp <= 0x2fffd) || // CJK
534
+ (cp >= 0x30000 && cp <= 0x3fffd) ||
535
+ // Miscellaneous Symbols and Pictographs + Emoticons:
536
+ (cp >= 0x1f300 && cp <= 0x1f64f) ||
537
+ // Supplemental Symbols and Pictographs:
538
+ (cp >= 0x1f900 && cp <= 0x1f9ff))));
539
+ }
540
+ };
541
+ for_each_codepoint(s, count_code_points{&num_code_points});
542
+ return num_code_points;
543
+ }
544
+
545
+ inline auto compute_width(basic_string_view<char8_type> s) -> size_t {
546
+ return compute_width(basic_string_view<char>(
547
+ reinterpret_cast<const char*>(s.data()), s.size()));
548
+ }
549
+
550
+ template <typename Char>
551
+ inline auto code_point_index(basic_string_view<Char> s, size_t n) -> size_t {
552
+ size_t size = s.size();
553
+ return n < size ? n : size;
554
+ }
555
+
556
+ // Calculates the index of the nth code point in a UTF-8 string.
557
+ inline auto code_point_index(basic_string_view<char8_type> s, size_t n)
558
+ -> size_t {
559
+ const char8_type* data = s.data();
560
+ size_t num_code_points = 0;
561
+ for (size_t i = 0, size = s.size(); i != size; ++i) {
562
+ if ((data[i] & 0xc0) != 0x80 && ++num_code_points > n) return i;
563
+ }
564
+ return s.size();
565
+ }
566
+
567
+ template <typename T>
568
+ using is_fast_float = bool_constant<std::numeric_limits<T>::is_iec559 &&
569
+ sizeof(T) <= sizeof(double)>;
570
+
571
+ #ifndef FMT_USE_FULL_CACHE_DRAGONBOX
572
+ # define FMT_USE_FULL_CACHE_DRAGONBOX 0
573
+ #endif
574
+
575
+ template <typename T>
576
+ template <typename U>
577
+ void buffer<T>::append(const U* begin, const U* end) {
578
+ while (begin != end) {
579
+ auto count = to_unsigned(end - begin);
580
+ try_reserve(size_ + count);
581
+ auto free_cap = capacity_ - size_;
582
+ if (free_cap < count) count = free_cap;
583
+ std::uninitialized_copy_n(begin, count, make_checked(ptr_ + size_, count));
584
+ size_ += count;
585
+ begin += count;
586
+ }
587
+ }
588
+
589
+ template <typename T, typename Enable = void>
590
+ struct is_locale : std::false_type {};
591
+ template <typename T>
592
+ struct is_locale<T, void_t<decltype(T::classic())>> : std::true_type {};
593
+ } // namespace detail
594
+
595
+ FMT_MODULE_EXPORT_BEGIN
596
+
597
+ // The number of characters to store in the basic_memory_buffer object itself
598
+ // to avoid dynamic memory allocation.
599
+ enum { inline_buffer_size = 500 };
600
+
601
+ /**
602
+ \rst
603
+ A dynamically growing memory buffer for trivially copyable/constructible types
604
+ with the first ``SIZE`` elements stored in the object itself.
605
+
606
+ You can use the ``memory_buffer`` type alias for ``char`` instead.
607
+
608
+ **Example**::
609
+
610
+ fmt::memory_buffer out;
611
+ format_to(out, "The answer is {}.", 42);
612
+
613
+ This will append the following output to the ``out`` object:
614
+
615
+ .. code-block:: none
616
+
617
+ The answer is 42.
618
+
619
+ The output can be converted to an ``std::string`` with ``to_string(out)``.
620
+ \endrst
621
+ */
622
+ template <typename T, size_t SIZE = inline_buffer_size,
623
+ typename Allocator = std::allocator<T>>
624
+ class basic_memory_buffer final : public detail::buffer<T> {
625
+ private:
626
+ T store_[SIZE];
627
+
628
+ // Don't inherit from Allocator avoid generating type_info for it.
629
+ Allocator alloc_;
630
+
631
+ // Deallocate memory allocated by the buffer.
632
+ void deallocate() {
633
+ T* data = this->data();
634
+ if (data != store_) alloc_.deallocate(data, this->capacity());
635
+ }
636
+
637
+ protected:
638
+ void grow(size_t size) final FMT_OVERRIDE;
639
+
640
+ public:
641
+ using value_type = T;
642
+ using const_reference = const T&;
643
+
644
+ explicit basic_memory_buffer(const Allocator& alloc = Allocator())
645
+ : alloc_(alloc) {
646
+ this->set(store_, SIZE);
647
+ }
648
+ ~basic_memory_buffer() { deallocate(); }
649
+
650
+ private:
651
+ // Move data from other to this buffer.
652
+ void move(basic_memory_buffer& other) {
653
+ alloc_ = std::move(other.alloc_);
654
+ T* data = other.data();
655
+ size_t size = other.size(), capacity = other.capacity();
656
+ if (data == other.store_) {
657
+ this->set(store_, capacity);
658
+ std::uninitialized_copy(other.store_, other.store_ + size,
659
+ detail::make_checked(store_, capacity));
660
+ } else {
661
+ this->set(data, capacity);
662
+ // Set pointer to the inline array so that delete is not called
663
+ // when deallocating.
664
+ other.set(other.store_, 0);
665
+ }
666
+ this->resize(size);
667
+ }
668
+
669
+ public:
670
+ /**
671
+ \rst
672
+ Constructs a :class:`fmt::basic_memory_buffer` object moving the content
673
+ of the other object to it.
674
+ \endrst
675
+ */
676
+ basic_memory_buffer(basic_memory_buffer&& other) FMT_NOEXCEPT { move(other); }
677
+
678
+ /**
679
+ \rst
680
+ Moves the content of the other ``basic_memory_buffer`` object to this one.
681
+ \endrst
682
+ */
683
+ auto operator=(basic_memory_buffer&& other) FMT_NOEXCEPT
684
+ -> basic_memory_buffer& {
685
+ FMT_ASSERT(this != &other, "");
686
+ deallocate();
687
+ move(other);
688
+ return *this;
689
+ }
690
+
691
+ // Returns a copy of the allocator associated with this buffer.
692
+ auto get_allocator() const -> Allocator { return alloc_; }
693
+
694
+ /**
695
+ Resizes the buffer to contain *count* elements. If T is a POD type new
696
+ elements may not be initialized.
697
+ */
698
+ void resize(size_t count) { this->try_resize(count); }
699
+
700
+ /** Increases the buffer capacity to *new_capacity*. */
701
+ void reserve(size_t new_capacity) { this->try_reserve(new_capacity); }
702
+
703
+ // Directly append data into the buffer
704
+ using detail::buffer<T>::append;
705
+ template <typename ContiguousRange>
706
+ void append(const ContiguousRange& range) {
707
+ append(range.data(), range.data() + range.size());
708
+ }
709
+ };
710
+
711
+ template <typename T, size_t SIZE, typename Allocator>
712
+ void basic_memory_buffer<T, SIZE, Allocator>::grow(size_t size) {
713
+ #ifdef FMT_FUZZ
714
+ if (size > 5000) throw std::runtime_error("fuzz mode - won't grow that much");
715
+ #endif
716
+ const size_t max_size = std::allocator_traits<Allocator>::max_size(alloc_);
717
+ size_t old_capacity = this->capacity();
718
+ size_t new_capacity = old_capacity + old_capacity / 2;
719
+ if (size > new_capacity)
720
+ new_capacity = size;
721
+ else if (new_capacity > max_size)
722
+ new_capacity = size > max_size ? size : max_size;
723
+ T* old_data = this->data();
724
+ T* new_data =
725
+ std::allocator_traits<Allocator>::allocate(alloc_, new_capacity);
726
+ // The following code doesn't throw, so the raw pointer above doesn't leak.
727
+ std::uninitialized_copy(old_data, old_data + this->size(),
728
+ detail::make_checked(new_data, new_capacity));
729
+ this->set(new_data, new_capacity);
730
+ // deallocate must not throw according to the standard, but even if it does,
731
+ // the buffer already uses the new storage and will deallocate it in
732
+ // destructor.
733
+ if (old_data != store_) alloc_.deallocate(old_data, old_capacity);
734
+ }
735
+
736
+ using memory_buffer = basic_memory_buffer<char>;
737
+
738
+ template <typename T, size_t SIZE, typename Allocator>
739
+ struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>> : std::true_type {
740
+ };
741
+
742
+ namespace detail {
743
+ FMT_API void print(std::FILE*, string_view);
744
+ }
745
+
746
+ /** A formatting error such as invalid format string. */
747
+ FMT_CLASS_API
748
+ class FMT_API format_error : public std::runtime_error {
749
+ public:
750
+ explicit format_error(const char* message) : std::runtime_error(message) {}
751
+ explicit format_error(const std::string& message)
752
+ : std::runtime_error(message) {}
753
+ format_error(const format_error&) = default;
754
+ format_error& operator=(const format_error&) = default;
755
+ format_error(format_error&&) = default;
756
+ format_error& operator=(format_error&&) = default;
757
+ ~format_error() FMT_NOEXCEPT FMT_OVERRIDE FMT_MSC_DEFAULT;
758
+ };
759
+
760
+ /**
761
+ \rst
762
+ Constructs a `~fmt::format_arg_store` object that contains references
763
+ to arguments and can be implicitly converted to `~fmt::format_args`.
764
+ If ``fmt`` is a compile-time string then `make_args_checked` checks
765
+ its validity at compile time.
766
+ \endrst
767
+ */
768
+ template <typename... Args, typename S, typename Char = char_t<S>>
769
+ FMT_INLINE auto make_args_checked(const S& fmt,
770
+ const remove_reference_t<Args>&... args)
771
+ -> format_arg_store<buffer_context<Char>, remove_reference_t<Args>...> {
772
+ static_assert(
773
+ detail::count<(
774
+ std::is_base_of<detail::view, remove_reference_t<Args>>::value &&
775
+ std::is_reference<Args>::value)...>() == 0,
776
+ "passing views as lvalues is disallowed");
777
+ detail::check_format_string<Args...>(fmt);
778
+ return {args...};
779
+ }
780
+
781
+ // compile-time support
782
+ namespace detail_exported {
783
+ #if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
784
+ template <typename Char, size_t N> struct fixed_string {
785
+ constexpr fixed_string(const Char (&str)[N]) {
786
+ detail::copy_str<Char, const Char*, Char*>(static_cast<const Char*>(str),
787
+ str + N, data);
788
+ }
789
+ Char data[N]{};
790
+ };
791
+ #endif
792
+
793
+ // Converts a compile-time string to basic_string_view.
794
+ template <typename Char, size_t N>
795
+ constexpr auto compile_string_to_view(const Char (&s)[N])
796
+ -> basic_string_view<Char> {
797
+ // Remove trailing NUL character if needed. Won't be present if this is used
798
+ // with a raw character array (i.e. not defined as a string).
799
+ return {s, N - (std::char_traits<Char>::to_int_type(s[N - 1]) == 0 ? 1 : 0)};
800
+ }
801
+ template <typename Char>
802
+ constexpr auto compile_string_to_view(detail::std_string_view<Char> s)
803
+ -> basic_string_view<Char> {
804
+ return {s.data(), s.size()};
805
+ }
806
+ } // namespace detail_exported
807
+
808
+ FMT_BEGIN_DETAIL_NAMESPACE
809
+
810
+ inline void throw_format_error(const char* message) {
811
+ FMT_THROW(format_error(message));
812
+ }
813
+
814
+ template <typename T> struct is_integral : std::is_integral<T> {};
815
+ template <> struct is_integral<int128_t> : std::true_type {};
816
+ template <> struct is_integral<uint128_t> : std::true_type {};
817
+
818
+ template <typename T>
819
+ using is_signed =
820
+ std::integral_constant<bool, std::numeric_limits<T>::is_signed ||
821
+ std::is_same<T, int128_t>::value>;
822
+
823
+ // Returns true if value is negative, false otherwise.
824
+ // Same as `value < 0` but doesn't produce warnings if T is an unsigned type.
825
+ template <typename T, FMT_ENABLE_IF(is_signed<T>::value)>
826
+ FMT_CONSTEXPR auto is_negative(T value) -> bool {
827
+ return value < 0;
828
+ }
829
+ template <typename T, FMT_ENABLE_IF(!is_signed<T>::value)>
830
+ FMT_CONSTEXPR auto is_negative(T) -> bool {
831
+ return false;
832
+ }
833
+
834
+ template <typename T, FMT_ENABLE_IF(std::is_floating_point<T>::value)>
835
+ FMT_CONSTEXPR auto is_supported_floating_point(T) -> uint16_t {
836
+ return (std::is_same<T, float>::value && FMT_USE_FLOAT) ||
837
+ (std::is_same<T, double>::value && FMT_USE_DOUBLE) ||
838
+ (std::is_same<T, long double>::value && FMT_USE_LONG_DOUBLE);
839
+ }
840
+
841
+ // Smallest of uint32_t, uint64_t, uint128_t that is large enough to
842
+ // represent all values of an integral type T.
843
+ template <typename T>
844
+ using uint32_or_64_or_128_t =
845
+ conditional_t<num_bits<T>() <= 32 && !FMT_REDUCE_INT_INSTANTIATIONS,
846
+ uint32_t,
847
+ conditional_t<num_bits<T>() <= 64, uint64_t, uint128_t>>;
848
+ template <typename T>
849
+ using uint64_or_128_t = conditional_t<num_bits<T>() <= 64, uint64_t, uint128_t>;
850
+
851
+ #define FMT_POWERS_OF_10(factor) \
852
+ factor * 10, (factor)*100, (factor)*1000, (factor)*10000, (factor)*100000, \
853
+ (factor)*1000000, (factor)*10000000, (factor)*100000000, \
854
+ (factor)*1000000000
855
+
856
+ // Static data is placed in this class template for the header-only config.
857
+ template <typename T = void> struct basic_data {
858
+ // log10(2) = 0x0.4d104d427de7fbcc...
859
+ static const uint64_t log10_2_significand = 0x4d104d427de7fbcc;
860
+
861
+ // GCC generates slightly better code for pairs than chars.
862
+ FMT_API static constexpr const char digits[100][2] = {
863
+ {'0', '0'}, {'0', '1'}, {'0', '2'}, {'0', '3'}, {'0', '4'}, {'0', '5'},
864
+ {'0', '6'}, {'0', '7'}, {'0', '8'}, {'0', '9'}, {'1', '0'}, {'1', '1'},
865
+ {'1', '2'}, {'1', '3'}, {'1', '4'}, {'1', '5'}, {'1', '6'}, {'1', '7'},
866
+ {'1', '8'}, {'1', '9'}, {'2', '0'}, {'2', '1'}, {'2', '2'}, {'2', '3'},
867
+ {'2', '4'}, {'2', '5'}, {'2', '6'}, {'2', '7'}, {'2', '8'}, {'2', '9'},
868
+ {'3', '0'}, {'3', '1'}, {'3', '2'}, {'3', '3'}, {'3', '4'}, {'3', '5'},
869
+ {'3', '6'}, {'3', '7'}, {'3', '8'}, {'3', '9'}, {'4', '0'}, {'4', '1'},
870
+ {'4', '2'}, {'4', '3'}, {'4', '4'}, {'4', '5'}, {'4', '6'}, {'4', '7'},
871
+ {'4', '8'}, {'4', '9'}, {'5', '0'}, {'5', '1'}, {'5', '2'}, {'5', '3'},
872
+ {'5', '4'}, {'5', '5'}, {'5', '6'}, {'5', '7'}, {'5', '8'}, {'5', '9'},
873
+ {'6', '0'}, {'6', '1'}, {'6', '2'}, {'6', '3'}, {'6', '4'}, {'6', '5'},
874
+ {'6', '6'}, {'6', '7'}, {'6', '8'}, {'6', '9'}, {'7', '0'}, {'7', '1'},
875
+ {'7', '2'}, {'7', '3'}, {'7', '4'}, {'7', '5'}, {'7', '6'}, {'7', '7'},
876
+ {'7', '8'}, {'7', '9'}, {'8', '0'}, {'8', '1'}, {'8', '2'}, {'8', '3'},
877
+ {'8', '4'}, {'8', '5'}, {'8', '6'}, {'8', '7'}, {'8', '8'}, {'8', '9'},
878
+ {'9', '0'}, {'9', '1'}, {'9', '2'}, {'9', '3'}, {'9', '4'}, {'9', '5'},
879
+ {'9', '6'}, {'9', '7'}, {'9', '8'}, {'9', '9'}};
880
+
881
+ FMT_API static constexpr const char hex_digits[] = "0123456789abcdef";
882
+ FMT_API static constexpr const char signs[4] = {0, '-', '+', ' '};
883
+ FMT_API static constexpr const unsigned prefixes[4] = {0, 0, 0x1000000u | '+',
884
+ 0x1000000u | ' '};
885
+ FMT_API static constexpr const char left_padding_shifts[5] = {31, 31, 0, 1,
886
+ 0};
887
+ FMT_API static constexpr const char right_padding_shifts[5] = {0, 31, 0, 1,
888
+ 0};
889
+ };
890
+
891
+ #ifdef FMT_SHARED
892
+ // Required for -flto, -fivisibility=hidden and -shared to work
893
+ extern template struct basic_data<void>;
894
+ #endif
895
+
896
+ // This is a struct rather than an alias to avoid shadowing warnings in gcc.
897
+ struct data : basic_data<> {};
898
+
899
+ template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
900
+ int count = 1;
901
+ for (;;) {
902
+ // Integer division is slow so do it for a group of four digits instead
903
+ // of for every digit. The idea comes from the talk by Alexandrescu
904
+ // "Three Optimization Tips for C++". See speed-test for a comparison.
905
+ if (n < 10) return count;
906
+ if (n < 100) return count + 1;
907
+ if (n < 1000) return count + 2;
908
+ if (n < 10000) return count + 3;
909
+ n /= 10000u;
910
+ count += 4;
911
+ }
912
+ }
913
+ #if FMT_USE_INT128
914
+ FMT_CONSTEXPR inline auto count_digits(uint128_t n) -> int {
915
+ return count_digits_fallback(n);
916
+ }
917
+ #endif
918
+
919
+ // Returns the number of decimal digits in n. Leading zeros are not counted
920
+ // except for n == 0 in which case count_digits returns 1.
921
+ FMT_CONSTEXPR20 inline auto count_digits(uint64_t n) -> int {
922
+ #ifdef FMT_BUILTIN_CLZLL
923
+ if (!is_constant_evaluated()) {
924
+ // https://github.com/fmtlib/format-benchmark/blob/master/digits10
925
+ // Maps bsr(n) to ceil(log10(pow(2, bsr(n) + 1) - 1)).
926
+ constexpr uint16_t bsr2log10[] = {
927
+ 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5,
928
+ 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10,
929
+ 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15,
930
+ 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20};
931
+ auto t = bsr2log10[FMT_BUILTIN_CLZLL(n | 1) ^ 63];
932
+ constexpr const uint64_t zero_or_powers_of_10[] = {
933
+ 0, 0, FMT_POWERS_OF_10(1U), FMT_POWERS_OF_10(1000000000ULL),
934
+ 10000000000000000000ULL};
935
+ return t - (n < zero_or_powers_of_10[t]);
936
+ }
937
+ #endif
938
+ return count_digits_fallback(n);
939
+ }
940
+
941
+ // Counts the number of digits in n. BITS = log2(radix).
942
+ template <int BITS, typename UInt>
943
+ FMT_CONSTEXPR auto count_digits(UInt n) -> int {
944
+ #ifdef FMT_BUILTIN_CLZ
945
+ if (num_bits<UInt>() == 32)
946
+ return (FMT_BUILTIN_CLZ(static_cast<uint32_t>(n) | 1) ^ 31) / BITS + 1;
947
+ #endif
948
+ int num_digits = 0;
949
+ do {
950
+ ++num_digits;
951
+ } while ((n >>= BITS) != 0);
952
+ return num_digits;
953
+ }
954
+
955
+ template <> auto count_digits<4>(detail::fallback_uintptr n) -> int;
956
+
957
+ // It is a separate function rather than a part of count_digits to workaround
958
+ // the lack of static constexpr in constexpr functions.
959
+ FMT_INLINE uint64_t count_digits_inc(int n) {
960
+ // An optimization by Kendall Willets from https://bit.ly/3uOIQrB.
961
+ // This increments the upper 32 bits (log10(T) - 1) when >= T is added.
962
+ #define FMT_INC(T) (((sizeof(#T) - 1ull) << 32) - T)
963
+ static constexpr uint64_t table[] = {
964
+ FMT_INC(0), FMT_INC(0), FMT_INC(0), // 8
965
+ FMT_INC(10), FMT_INC(10), FMT_INC(10), // 64
966
+ FMT_INC(100), FMT_INC(100), FMT_INC(100), // 512
967
+ FMT_INC(1000), FMT_INC(1000), FMT_INC(1000), // 4096
968
+ FMT_INC(10000), FMT_INC(10000), FMT_INC(10000), // 32k
969
+ FMT_INC(100000), FMT_INC(100000), FMT_INC(100000), // 256k
970
+ FMT_INC(1000000), FMT_INC(1000000), FMT_INC(1000000), // 2048k
971
+ FMT_INC(10000000), FMT_INC(10000000), FMT_INC(10000000), // 16M
972
+ FMT_INC(100000000), FMT_INC(100000000), FMT_INC(100000000), // 128M
973
+ FMT_INC(1000000000), FMT_INC(1000000000), FMT_INC(1000000000), // 1024M
974
+ FMT_INC(1000000000), FMT_INC(1000000000) // 4B
975
+ };
976
+ return table[n];
977
+ }
978
+
979
+ // Optional version of count_digits for better performance on 32-bit platforms.
980
+ FMT_CONSTEXPR20 inline auto count_digits(uint32_t n) -> int {
981
+ #ifdef FMT_BUILTIN_CLZ
982
+ if (!is_constant_evaluated()) {
983
+ auto inc = count_digits_inc(FMT_BUILTIN_CLZ(n | 1) ^ 31);
984
+ return static_cast<int>((n + inc) >> 32);
985
+ }
986
+ #endif
987
+ return count_digits_fallback(n);
988
+ }
989
+
990
+ template <typename Int> constexpr auto digits10() FMT_NOEXCEPT -> int {
991
+ return std::numeric_limits<Int>::digits10;
992
+ }
993
+ template <> constexpr auto digits10<int128_t>() FMT_NOEXCEPT -> int {
994
+ return 38;
995
+ }
996
+ template <> constexpr auto digits10<uint128_t>() FMT_NOEXCEPT -> int {
997
+ return 38;
998
+ }
999
+
1000
+ template <typename Char> struct thousands_sep_result {
1001
+ std::string grouping;
1002
+ Char thousands_sep;
1003
+ };
1004
+
1005
+ template <typename Char>
1006
+ FMT_API auto thousands_sep_impl(locale_ref loc) -> thousands_sep_result<Char>;
1007
+ template <typename Char>
1008
+ inline auto thousands_sep(locale_ref loc) -> thousands_sep_result<Char> {
1009
+ auto result = thousands_sep_impl<char>(loc);
1010
+ return {result.grouping, Char(result.thousands_sep)};
1011
+ }
1012
+ template <>
1013
+ inline auto thousands_sep(locale_ref loc) -> thousands_sep_result<wchar_t> {
1014
+ return thousands_sep_impl<wchar_t>(loc);
1015
+ }
1016
+
1017
+ template <typename Char>
1018
+ FMT_API auto decimal_point_impl(locale_ref loc) -> Char;
1019
+ template <typename Char> inline auto decimal_point(locale_ref loc) -> Char {
1020
+ return Char(decimal_point_impl<char>(loc));
1021
+ }
1022
+ template <> inline auto decimal_point(locale_ref loc) -> wchar_t {
1023
+ return decimal_point_impl<wchar_t>(loc);
1024
+ }
1025
+
1026
+ // Compares two characters for equality.
1027
+ template <typename Char> auto equal2(const Char* lhs, const char* rhs) -> bool {
1028
+ return lhs[0] == Char(rhs[0]) && lhs[1] == Char(rhs[1]);
1029
+ }
1030
+ inline auto equal2(const char* lhs, const char* rhs) -> bool {
1031
+ return memcmp(lhs, rhs, 2) == 0;
1032
+ }
1033
+
1034
+ // Copies two characters from src to dst.
1035
+ template <typename Char> void copy2(Char* dst, const char* src) {
1036
+ *dst++ = static_cast<Char>(*src++);
1037
+ *dst = static_cast<Char>(*src);
1038
+ }
1039
+ FMT_INLINE void copy2(char* dst, const char* src) { memcpy(dst, src, 2); }
1040
+
1041
+ template <typename Iterator> struct format_decimal_result {
1042
+ Iterator begin;
1043
+ Iterator end;
1044
+ };
1045
+
1046
+ // Formats a decimal unsigned integer value writing into out pointing to a
1047
+ // buffer of specified size. The caller must ensure that the buffer is large
1048
+ // enough.
1049
+ template <typename Char, typename UInt>
1050
+ FMT_CONSTEXPR20 auto format_decimal(Char* out, UInt value, int size)
1051
+ -> format_decimal_result<Char*> {
1052
+ FMT_ASSERT(size >= count_digits(value), "invalid digit count");
1053
+ out += size;
1054
+ Char* end = out;
1055
+ if (is_constant_evaluated()) {
1056
+ while (value >= 10) {
1057
+ *--out = static_cast<Char>('0' + value % 10);
1058
+ value /= 10;
1059
+ }
1060
+ *--out = static_cast<Char>('0' + value);
1061
+ return {out, end};
1062
+ }
1063
+ while (value >= 100) {
1064
+ // Integer division is slow so do it for a group of two digits instead
1065
+ // of for every digit. The idea comes from the talk by Alexandrescu
1066
+ // "Three Optimization Tips for C++". See speed-test for a comparison.
1067
+ out -= 2;
1068
+ copy2(out, data::digits[value % 100]);
1069
+ value /= 100;
1070
+ }
1071
+ if (value < 10) {
1072
+ *--out = static_cast<Char>('0' + value);
1073
+ return {out, end};
1074
+ }
1075
+ out -= 2;
1076
+ copy2(out, data::digits[value]);
1077
+ return {out, end};
1078
+ }
1079
+
1080
+ template <typename Char, typename UInt, typename Iterator,
1081
+ FMT_ENABLE_IF(!std::is_pointer<remove_cvref_t<Iterator>>::value)>
1082
+ inline auto format_decimal(Iterator out, UInt value, int size)
1083
+ -> format_decimal_result<Iterator> {
1084
+ // Buffer is large enough to hold all digits (digits10 + 1).
1085
+ Char buffer[digits10<UInt>() + 1];
1086
+ auto end = format_decimal(buffer, value, size).end;
1087
+ return {out, detail::copy_str_noinline<Char>(buffer, end, out)};
1088
+ }
1089
+
1090
+ template <unsigned BASE_BITS, typename Char, typename UInt>
1091
+ FMT_CONSTEXPR auto format_uint(Char* buffer, UInt value, int num_digits,
1092
+ bool upper = false) -> Char* {
1093
+ buffer += num_digits;
1094
+ Char* end = buffer;
1095
+ do {
1096
+ const char* digits = upper ? "0123456789ABCDEF" : data::hex_digits;
1097
+ unsigned digit = (value & ((1 << BASE_BITS) - 1));
1098
+ *--buffer = static_cast<Char>(BASE_BITS < 4 ? static_cast<char>('0' + digit)
1099
+ : digits[digit]);
1100
+ } while ((value >>= BASE_BITS) != 0);
1101
+ return end;
1102
+ }
1103
+
1104
+ template <unsigned BASE_BITS, typename Char>
1105
+ auto format_uint(Char* buffer, detail::fallback_uintptr n, int num_digits,
1106
+ bool = false) -> Char* {
1107
+ auto char_digits = std::numeric_limits<unsigned char>::digits / 4;
1108
+ int start = (num_digits + char_digits - 1) / char_digits - 1;
1109
+ if (int start_digits = num_digits % char_digits) {
1110
+ unsigned value = n.value[start--];
1111
+ buffer = format_uint<BASE_BITS>(buffer, value, start_digits);
1112
+ }
1113
+ for (; start >= 0; --start) {
1114
+ unsigned value = n.value[start];
1115
+ buffer += char_digits;
1116
+ auto p = buffer;
1117
+ for (int i = 0; i < char_digits; ++i) {
1118
+ unsigned digit = (value & ((1 << BASE_BITS) - 1));
1119
+ *--p = static_cast<Char>(data::hex_digits[digit]);
1120
+ value >>= BASE_BITS;
1121
+ }
1122
+ }
1123
+ return buffer;
1124
+ }
1125
+
1126
+ template <unsigned BASE_BITS, typename Char, typename It, typename UInt>
1127
+ inline auto format_uint(It out, UInt value, int num_digits, bool upper = false)
1128
+ -> It {
1129
+ if (auto ptr = to_pointer<Char>(out, to_unsigned(num_digits))) {
1130
+ format_uint<BASE_BITS>(ptr, value, num_digits, upper);
1131
+ return out;
1132
+ }
1133
+ // Buffer should be large enough to hold all digits (digits / BASE_BITS + 1).
1134
+ char buffer[num_bits<UInt>() / BASE_BITS + 1];
1135
+ format_uint<BASE_BITS>(buffer, value, num_digits, upper);
1136
+ return detail::copy_str_noinline<Char>(buffer, buffer + num_digits, out);
1137
+ }
1138
+
1139
+ // A converter from UTF-8 to UTF-16.
1140
+ class utf8_to_utf16 {
1141
+ private:
1142
+ basic_memory_buffer<wchar_t> buffer_;
1143
+
1144
+ public:
1145
+ FMT_API explicit utf8_to_utf16(string_view s);
1146
+ operator basic_string_view<wchar_t>() const { return {&buffer_[0], size()}; }
1147
+ auto size() const -> size_t { return buffer_.size() - 1; }
1148
+ auto c_str() const -> const wchar_t* { return &buffer_[0]; }
1149
+ auto str() const -> std::wstring { return {&buffer_[0], size()}; }
1150
+ };
1151
+
1152
+ namespace dragonbox {
1153
+
1154
+ // Type-specific information that Dragonbox uses.
1155
+ template <class T> struct float_info;
1156
+
1157
+ template <> struct float_info<float> {
1158
+ using carrier_uint = uint32_t;
1159
+ static const int significand_bits = 23;
1160
+ static const int exponent_bits = 8;
1161
+ static const int min_exponent = -126;
1162
+ static const int max_exponent = 127;
1163
+ static const int exponent_bias = -127;
1164
+ static const int decimal_digits = 9;
1165
+ static const int kappa = 1;
1166
+ static const int big_divisor = 100;
1167
+ static const int small_divisor = 10;
1168
+ static const int min_k = -31;
1169
+ static const int max_k = 46;
1170
+ static const int cache_bits = 64;
1171
+ static const int divisibility_check_by_5_threshold = 39;
1172
+ static const int case_fc_pm_half_lower_threshold = -1;
1173
+ static const int case_fc_pm_half_upper_threshold = 6;
1174
+ static const int case_fc_lower_threshold = -2;
1175
+ static const int case_fc_upper_threshold = 6;
1176
+ static const int case_shorter_interval_left_endpoint_lower_threshold = 2;
1177
+ static const int case_shorter_interval_left_endpoint_upper_threshold = 3;
1178
+ static const int shorter_interval_tie_lower_threshold = -35;
1179
+ static const int shorter_interval_tie_upper_threshold = -35;
1180
+ static const int max_trailing_zeros = 7;
1181
+ };
1182
+
1183
+ template <> struct float_info<double> {
1184
+ using carrier_uint = uint64_t;
1185
+ static const int significand_bits = 52;
1186
+ static const int exponent_bits = 11;
1187
+ static const int min_exponent = -1022;
1188
+ static const int max_exponent = 1023;
1189
+ static const int exponent_bias = -1023;
1190
+ static const int decimal_digits = 17;
1191
+ static const int kappa = 2;
1192
+ static const int big_divisor = 1000;
1193
+ static const int small_divisor = 100;
1194
+ static const int min_k = -292;
1195
+ static const int max_k = 326;
1196
+ static const int cache_bits = 128;
1197
+ static const int divisibility_check_by_5_threshold = 86;
1198
+ static const int case_fc_pm_half_lower_threshold = -2;
1199
+ static const int case_fc_pm_half_upper_threshold = 9;
1200
+ static const int case_fc_lower_threshold = -4;
1201
+ static const int case_fc_upper_threshold = 9;
1202
+ static const int case_shorter_interval_left_endpoint_lower_threshold = 2;
1203
+ static const int case_shorter_interval_left_endpoint_upper_threshold = 3;
1204
+ static const int shorter_interval_tie_lower_threshold = -77;
1205
+ static const int shorter_interval_tie_upper_threshold = -77;
1206
+ static const int max_trailing_zeros = 16;
1207
+ };
1208
+
1209
+ template <typename T> struct decimal_fp {
1210
+ using significand_type = typename float_info<T>::carrier_uint;
1211
+ significand_type significand;
1212
+ int exponent;
1213
+ };
1214
+
1215
+ template <typename T>
1216
+ FMT_API auto to_decimal(T x) FMT_NOEXCEPT -> decimal_fp<T>;
1217
+ } // namespace dragonbox
1218
+
1219
+ template <typename T>
1220
+ constexpr auto exponent_mask() ->
1221
+ typename dragonbox::float_info<T>::carrier_uint {
1222
+ using uint = typename dragonbox::float_info<T>::carrier_uint;
1223
+ return ((uint(1) << dragonbox::float_info<T>::exponent_bits) - 1)
1224
+ << dragonbox::float_info<T>::significand_bits;
1225
+ }
1226
+
1227
+ // Writes the exponent exp in the form "[+-]d{2,3}" to buffer.
1228
+ template <typename Char, typename It>
1229
+ auto write_exponent(int exp, It it) -> It {
1230
+ FMT_ASSERT(-10000 < exp && exp < 10000, "exponent out of range");
1231
+ if (exp < 0) {
1232
+ *it++ = static_cast<Char>('-');
1233
+ exp = -exp;
1234
+ } else {
1235
+ *it++ = static_cast<Char>('+');
1236
+ }
1237
+ if (exp >= 100) {
1238
+ const char* top = data::digits[exp / 100];
1239
+ if (exp >= 1000) *it++ = static_cast<Char>(top[0]);
1240
+ *it++ = static_cast<Char>(top[1]);
1241
+ exp %= 100;
1242
+ }
1243
+ const char* d = data::digits[exp];
1244
+ *it++ = static_cast<Char>(d[0]);
1245
+ *it++ = static_cast<Char>(d[1]);
1246
+ return it;
1247
+ }
1248
+
1249
+ template <typename T>
1250
+ auto format_float(T value, int precision, float_specs specs, buffer<char>& buf)
1251
+ -> int;
1252
+
1253
+ // Formats a floating-point number with snprintf.
1254
+ template <typename T>
1255
+ auto snprintf_float(T value, int precision, float_specs specs,
1256
+ buffer<char>& buf) -> int;
1257
+
1258
+ template <typename T> auto promote_float(T value) -> T { return value; }
1259
+ inline auto promote_float(float value) -> double {
1260
+ return static_cast<double>(value);
1261
+ }
1262
+
1263
+ template <typename OutputIt, typename Char>
1264
+ FMT_NOINLINE FMT_CONSTEXPR auto fill(OutputIt it, size_t n,
1265
+ const fill_t<Char>& fill) -> OutputIt {
1266
+ auto fill_size = fill.size();
1267
+ if (fill_size == 1) return detail::fill_n(it, n, fill[0]);
1268
+ auto data = fill.data();
1269
+ for (size_t i = 0; i < n; ++i)
1270
+ it = copy_str<Char>(data, data + fill_size, it);
1271
+ return it;
1272
+ }
1273
+
1274
+ // Writes the output of f, padded according to format specifications in specs.
1275
+ // size: output size in code units.
1276
+ // width: output display width in (terminal) column positions.
1277
+ template <align::type align = align::left, typename OutputIt, typename Char,
1278
+ typename F>
1279
+ FMT_CONSTEXPR auto write_padded(OutputIt out,
1280
+ const basic_format_specs<Char>& specs,
1281
+ size_t size, size_t width, F&& f) -> OutputIt {
1282
+ static_assert(align == align::left || align == align::right, "");
1283
+ unsigned spec_width = to_unsigned(specs.width);
1284
+ size_t padding = spec_width > width ? spec_width - width : 0;
1285
+ auto* shifts = align == align::left ? data::left_padding_shifts
1286
+ : data::right_padding_shifts;
1287
+ size_t left_padding = padding >> shifts[specs.align];
1288
+ size_t right_padding = padding - left_padding;
1289
+ auto it = reserve(out, size + padding * specs.fill.size());
1290
+ if (left_padding != 0) it = fill(it, left_padding, specs.fill);
1291
+ it = f(it);
1292
+ if (right_padding != 0) it = fill(it, right_padding, specs.fill);
1293
+ return base_iterator(out, it);
1294
+ }
1295
+
1296
+ template <align::type align = align::left, typename OutputIt, typename Char,
1297
+ typename F>
1298
+ constexpr auto write_padded(OutputIt out, const basic_format_specs<Char>& specs,
1299
+ size_t size, F&& f) -> OutputIt {
1300
+ return write_padded<align>(out, specs, size, size, f);
1301
+ }
1302
+
1303
+ template <align::type align = align::left, typename Char, typename OutputIt>
1304
+ FMT_CONSTEXPR auto write_bytes(OutputIt out, string_view bytes,
1305
+ const basic_format_specs<Char>& specs)
1306
+ -> OutputIt {
1307
+ return write_padded<align>(
1308
+ out, specs, bytes.size(), [bytes](reserve_iterator<OutputIt> it) {
1309
+ const char* data = bytes.data();
1310
+ return copy_str<Char>(data, data + bytes.size(), it);
1311
+ });
1312
+ }
1313
+
1314
+ template <typename Char, typename OutputIt, typename UIntPtr>
1315
+ auto write_ptr(OutputIt out, UIntPtr value,
1316
+ const basic_format_specs<Char>* specs) -> OutputIt {
1317
+ int num_digits = count_digits<4>(value);
1318
+ auto size = to_unsigned(num_digits) + size_t(2);
1319
+ auto write = [=](reserve_iterator<OutputIt> it) {
1320
+ *it++ = static_cast<Char>('0');
1321
+ *it++ = static_cast<Char>('x');
1322
+ return format_uint<4, Char>(it, value, num_digits);
1323
+ };
1324
+ return specs ? write_padded<align::right>(out, *specs, size, write)
1325
+ : base_iterator(out, write(reserve(out, size)));
1326
+ }
1327
+
1328
+ template <typename Char, typename OutputIt>
1329
+ FMT_CONSTEXPR auto write_char(OutputIt out, Char value,
1330
+ const basic_format_specs<Char>& specs)
1331
+ -> OutputIt {
1332
+ return write_padded(out, specs, 1, [=](reserve_iterator<OutputIt> it) {
1333
+ *it++ = value;
1334
+ return it;
1335
+ });
1336
+ }
1337
+ template <typename Char, typename OutputIt>
1338
+ FMT_CONSTEXPR auto write(OutputIt out, Char value,
1339
+ const basic_format_specs<Char>& specs,
1340
+ locale_ref loc = {}) -> OutputIt {
1341
+ return check_char_specs(specs)
1342
+ ? write_char(out, value, specs)
1343
+ : write(out, static_cast<int>(value), specs, loc);
1344
+ }
1345
+
1346
+ // Data for write_int that doesn't depend on output iterator type. It is used to
1347
+ // avoid template code bloat.
1348
+ template <typename Char> struct write_int_data {
1349
+ size_t size;
1350
+ size_t padding;
1351
+
1352
+ FMT_CONSTEXPR write_int_data(int num_digits, unsigned prefix,
1353
+ const basic_format_specs<Char>& specs)
1354
+ : size((prefix >> 24) + to_unsigned(num_digits)), padding(0) {
1355
+ if (specs.align == align::numeric) {
1356
+ auto width = to_unsigned(specs.width);
1357
+ if (width > size) {
1358
+ padding = width - size;
1359
+ size = width;
1360
+ }
1361
+ } else if (specs.precision > num_digits) {
1362
+ size = (prefix >> 24) + to_unsigned(specs.precision);
1363
+ padding = to_unsigned(specs.precision - num_digits);
1364
+ }
1365
+ }
1366
+ };
1367
+
1368
+ // Writes an integer in the format
1369
+ // <left-padding><prefix><numeric-padding><digits><right-padding>
1370
+ // where <digits> are written by write_digits(it).
1371
+ // prefix contains chars in three lower bytes and the size in the fourth byte.
1372
+ template <typename OutputIt, typename Char, typename W>
1373
+ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, int num_digits,
1374
+ unsigned prefix,
1375
+ const basic_format_specs<Char>& specs,
1376
+ W write_digits) -> OutputIt {
1377
+ // Slightly faster check for specs.width == 0 && specs.precision == -1.
1378
+ if ((specs.width | (specs.precision + 1)) == 0) {
1379
+ auto it = reserve(out, to_unsigned(num_digits) + (prefix >> 24));
1380
+ if (prefix != 0) {
1381
+ for (unsigned p = prefix & 0xffffff; p != 0; p >>= 8)
1382
+ *it++ = static_cast<Char>(p & 0xff);
1383
+ }
1384
+ return base_iterator(out, write_digits(it));
1385
+ }
1386
+ auto data = write_int_data<Char>(num_digits, prefix, specs);
1387
+ return write_padded<align::right>(
1388
+ out, specs, data.size, [=](reserve_iterator<OutputIt> it) {
1389
+ for (unsigned p = prefix & 0xffffff; p != 0; p >>= 8)
1390
+ *it++ = static_cast<Char>(p & 0xff);
1391
+ it = detail::fill_n(it, data.padding, static_cast<Char>('0'));
1392
+ return write_digits(it);
1393
+ });
1394
+ }
1395
+
1396
+ template <typename OutputIt, typename UInt, typename Char>
1397
+ auto write_int_localized(OutputIt& out, UInt value, unsigned prefix,
1398
+ const basic_format_specs<Char>& specs, locale_ref loc)
1399
+ -> bool {
1400
+ static_assert(std::is_same<uint64_or_128_t<UInt>, UInt>::value, "");
1401
+ const auto sep_size = 1;
1402
+ auto ts = thousands_sep<Char>(loc);
1403
+ if (!ts.thousands_sep) return false;
1404
+ int num_digits = count_digits(value);
1405
+ int size = num_digits, n = num_digits;
1406
+ const std::string& groups = ts.grouping;
1407
+ std::string::const_iterator group = groups.cbegin();
1408
+ while (group != groups.cend() && n > *group && *group > 0 &&
1409
+ *group != max_value<char>()) {
1410
+ size += sep_size;
1411
+ n -= *group;
1412
+ ++group;
1413
+ }
1414
+ if (group == groups.cend()) size += sep_size * ((n - 1) / groups.back());
1415
+ char digits[40];
1416
+ format_decimal(digits, value, num_digits);
1417
+ basic_memory_buffer<Char> buffer;
1418
+ if (prefix != 0) ++size;
1419
+ const auto usize = to_unsigned(size);
1420
+ buffer.resize(usize);
1421
+ basic_string_view<Char> s(&ts.thousands_sep, sep_size);
1422
+ // Index of a decimal digit with the least significant digit having index 0.
1423
+ int digit_index = 0;
1424
+ group = groups.cbegin();
1425
+ auto p = buffer.data() + size - 1;
1426
+ for (int i = num_digits - 1; i > 0; --i) {
1427
+ *p-- = static_cast<Char>(digits[i]);
1428
+ if (*group <= 0 || ++digit_index % *group != 0 ||
1429
+ *group == max_value<char>())
1430
+ continue;
1431
+ if (group + 1 != groups.cend()) {
1432
+ digit_index = 0;
1433
+ ++group;
1434
+ }
1435
+ std::uninitialized_copy(s.data(), s.data() + s.size(),
1436
+ make_checked(p, s.size()));
1437
+ p -= s.size();
1438
+ }
1439
+ *p-- = static_cast<Char>(*digits);
1440
+ if (prefix != 0) *p = static_cast<Char>(prefix);
1441
+ auto data = buffer.data();
1442
+ out = write_padded<align::right>(
1443
+ out, specs, usize, usize, [=](reserve_iterator<OutputIt> it) {
1444
+ return copy_str<Char>(data, data + size, it);
1445
+ });
1446
+ return true;
1447
+ }
1448
+
1449
+ FMT_CONSTEXPR inline void prefix_append(unsigned& prefix, unsigned value) {
1450
+ prefix |= prefix != 0 ? value << 8 : value;
1451
+ prefix += (1u + (value > 0xff ? 1 : 0)) << 24;
1452
+ }
1453
+
1454
+ template <typename UInt> struct write_int_arg {
1455
+ UInt abs_value;
1456
+ unsigned prefix;
1457
+ };
1458
+
1459
+ template <typename T>
1460
+ FMT_CONSTEXPR auto make_write_int_arg(T value, sign_t sign)
1461
+ -> write_int_arg<uint32_or_64_or_128_t<T>> {
1462
+ auto prefix = 0u;
1463
+ auto abs_value = static_cast<uint32_or_64_or_128_t<T>>(value);
1464
+ if (is_negative(value)) {
1465
+ prefix = 0x01000000 | '-';
1466
+ abs_value = 0 - abs_value;
1467
+ } else {
1468
+ prefix = data::prefixes[sign];
1469
+ }
1470
+ return {abs_value, prefix};
1471
+ }
1472
+
1473
+ template <typename Char, typename OutputIt, typename T>
1474
+ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg<T> arg,
1475
+ const basic_format_specs<Char>& specs,
1476
+ locale_ref loc) -> OutputIt {
1477
+ static_assert(std::is_same<T, uint32_or_64_or_128_t<T>>::value, "");
1478
+ auto abs_value = arg.abs_value;
1479
+ auto prefix = arg.prefix;
1480
+ auto utype = static_cast<unsigned>(specs.type);
1481
+ switch (specs.type) {
1482
+ case 0:
1483
+ case 'd': {
1484
+ if (specs.localized &&
1485
+ write_int_localized(out, static_cast<uint64_or_128_t<T>>(abs_value),
1486
+ prefix, specs, loc)) {
1487
+ return out;
1488
+ }
1489
+ auto num_digits = count_digits(abs_value);
1490
+ return write_int(
1491
+ out, num_digits, prefix, specs, [=](reserve_iterator<OutputIt> it) {
1492
+ return format_decimal<Char>(it, abs_value, num_digits).end;
1493
+ });
1494
+ }
1495
+ case 'x':
1496
+ case 'X': {
1497
+ if (specs.alt) prefix_append(prefix, (utype << 8) | '0');
1498
+ bool upper = specs.type != 'x';
1499
+ int num_digits = count_digits<4>(abs_value);
1500
+ return write_int(
1501
+ out, num_digits, prefix, specs, [=](reserve_iterator<OutputIt> it) {
1502
+ return format_uint<4, Char>(it, abs_value, num_digits, upper);
1503
+ });
1504
+ }
1505
+ case 'b':
1506
+ case 'B': {
1507
+ if (specs.alt) prefix_append(prefix, (utype << 8) | '0');
1508
+ int num_digits = count_digits<1>(abs_value);
1509
+ return write_int(out, num_digits, prefix, specs,
1510
+ [=](reserve_iterator<OutputIt> it) {
1511
+ return format_uint<1, Char>(it, abs_value, num_digits);
1512
+ });
1513
+ }
1514
+ case 'o': {
1515
+ int num_digits = count_digits<3>(abs_value);
1516
+ if (specs.alt && specs.precision <= num_digits && abs_value != 0) {
1517
+ // Octal prefix '0' is counted as a digit, so only add it if precision
1518
+ // is not greater than the number of digits.
1519
+ prefix_append(prefix, '0');
1520
+ }
1521
+ return write_int(out, num_digits, prefix, specs,
1522
+ [=](reserve_iterator<OutputIt> it) {
1523
+ return format_uint<3, Char>(it, abs_value, num_digits);
1524
+ });
1525
+ }
1526
+ case 'c':
1527
+ return write_char(out, static_cast<Char>(abs_value), specs);
1528
+ default:
1529
+ FMT_THROW(format_error("invalid type specifier"));
1530
+ }
1531
+ return out;
1532
+ }
1533
+ template <typename Char, typename OutputIt, typename T,
1534
+ FMT_ENABLE_IF(is_integral<T>::value &&
1535
+ !std::is_same<T, bool>::value &&
1536
+ std::is_same<OutputIt, buffer_appender<Char>>::value)>
1537
+ FMT_CONSTEXPR auto write(OutputIt out, T value,
1538
+ const basic_format_specs<Char>& specs, locale_ref loc)
1539
+ -> OutputIt {
1540
+ return write_int(out, make_write_int_arg(value, specs.sign), specs, loc);
1541
+ }
1542
+ // An inlined version of write used in format string compilation.
1543
+ template <typename Char, typename OutputIt, typename T,
1544
+ FMT_ENABLE_IF(is_integral<T>::value &&
1545
+ !std::is_same<T, bool>::value &&
1546
+ !std::is_same<OutputIt, buffer_appender<Char>>::value)>
1547
+ FMT_CONSTEXPR FMT_INLINE auto write(OutputIt out, T value,
1548
+ const basic_format_specs<Char>& specs,
1549
+ locale_ref loc) -> OutputIt {
1550
+ return write_int(out, make_write_int_arg(value, specs.sign), specs, loc);
1551
+ }
1552
+
1553
+ template <typename Char, typename OutputIt>
1554
+ FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> s,
1555
+ const basic_format_specs<Char>& specs) -> OutputIt {
1556
+ auto data = s.data();
1557
+ auto size = s.size();
1558
+ if (specs.precision >= 0 && to_unsigned(specs.precision) < size)
1559
+ size = code_point_index(s, to_unsigned(specs.precision));
1560
+ auto width =
1561
+ specs.width != 0 ? compute_width(basic_string_view<Char>(data, size)) : 0;
1562
+ return write_padded(out, specs, size, width,
1563
+ [=](reserve_iterator<OutputIt> it) {
1564
+ return copy_str<Char>(data, data + size, it);
1565
+ });
1566
+ }
1567
+ template <typename Char, typename OutputIt>
1568
+ FMT_CONSTEXPR auto write(OutputIt out,
1569
+ basic_string_view<type_identity_t<Char>> s,
1570
+ const basic_format_specs<Char>& specs, locale_ref)
1571
+ -> OutputIt {
1572
+ check_string_type_spec(specs.type);
1573
+ return write(out, s, specs);
1574
+ }
1575
+ template <typename Char, typename OutputIt>
1576
+ FMT_CONSTEXPR auto write(OutputIt out, const Char* s,
1577
+ const basic_format_specs<Char>& specs, locale_ref)
1578
+ -> OutputIt {
1579
+ return check_cstring_type_spec(specs.type)
1580
+ ? write(out, basic_string_view<Char>(s), specs, {})
1581
+ : write_ptr<Char>(out, to_uintptr(s), &specs);
1582
+ }
1583
+
1584
+ template <typename Char, typename OutputIt>
1585
+ auto write_nonfinite(OutputIt out, bool isinf, basic_format_specs<Char> specs,
1586
+ const float_specs& fspecs) -> OutputIt {
1587
+ auto str =
1588
+ isinf ? (fspecs.upper ? "INF" : "inf") : (fspecs.upper ? "NAN" : "nan");
1589
+ constexpr size_t str_size = 3;
1590
+ auto sign = fspecs.sign;
1591
+ auto size = str_size + (sign ? 1 : 0);
1592
+ // Replace '0'-padding with space for non-finite values.
1593
+ const bool is_zero_fill =
1594
+ specs.fill.size() == 1 && *specs.fill.data() == static_cast<Char>('0');
1595
+ if (is_zero_fill) specs.fill[0] = static_cast<Char>(' ');
1596
+ return write_padded(out, specs, size, [=](reserve_iterator<OutputIt> it) {
1597
+ if (sign) *it++ = static_cast<Char>(data::signs[sign]);
1598
+ return copy_str<Char>(str, str + str_size, it);
1599
+ });
1600
+ }
1601
+
1602
+ // A decimal floating-point number significand * pow(10, exp).
1603
+ struct big_decimal_fp {
1604
+ const char* significand;
1605
+ int significand_size;
1606
+ int exponent;
1607
+ };
1608
+
1609
+ inline auto get_significand_size(const big_decimal_fp& fp) -> int {
1610
+ return fp.significand_size;
1611
+ }
1612
+ template <typename T>
1613
+ inline auto get_significand_size(const dragonbox::decimal_fp<T>& fp) -> int {
1614
+ return count_digits(fp.significand);
1615
+ }
1616
+
1617
+ template <typename Char, typename OutputIt>
1618
+ inline auto write_significand(OutputIt out, const char* significand,
1619
+ int& significand_size) -> OutputIt {
1620
+ return copy_str<Char>(significand, significand + significand_size, out);
1621
+ }
1622
+ template <typename Char, typename OutputIt, typename UInt>
1623
+ inline auto write_significand(OutputIt out, UInt significand,
1624
+ int significand_size) -> OutputIt {
1625
+ return format_decimal<Char>(out, significand, significand_size).end;
1626
+ }
1627
+
1628
+ template <typename Char, typename UInt,
1629
+ FMT_ENABLE_IF(std::is_integral<UInt>::value)>
1630
+ inline auto write_significand(Char* out, UInt significand, int significand_size,
1631
+ int integral_size, Char decimal_point) -> Char* {
1632
+ if (!decimal_point)
1633
+ return format_decimal(out, significand, significand_size).end;
1634
+ auto end = format_decimal(out + 1, significand, significand_size).end;
1635
+ if (integral_size == 1) {
1636
+ out[0] = out[1];
1637
+ } else {
1638
+ std::uninitialized_copy_n(out + 1, integral_size,
1639
+ make_checked(out, to_unsigned(integral_size)));
1640
+ }
1641
+ out[integral_size] = decimal_point;
1642
+ return end;
1643
+ }
1644
+
1645
+ template <typename OutputIt, typename UInt, typename Char,
1646
+ FMT_ENABLE_IF(!std::is_pointer<remove_cvref_t<OutputIt>>::value)>
1647
+ inline auto write_significand(OutputIt out, UInt significand,
1648
+ int significand_size, int integral_size,
1649
+ Char decimal_point) -> OutputIt {
1650
+ // Buffer is large enough to hold digits (digits10 + 1) and a decimal point.
1651
+ Char buffer[digits10<UInt>() + 2];
1652
+ auto end = write_significand(buffer, significand, significand_size,
1653
+ integral_size, decimal_point);
1654
+ return detail::copy_str_noinline<Char>(buffer, end, out);
1655
+ }
1656
+
1657
+ template <typename OutputIt, typename Char>
1658
+ inline auto write_significand(OutputIt out, const char* significand,
1659
+ int significand_size, int integral_size,
1660
+ Char decimal_point) -> OutputIt {
1661
+ out = detail::copy_str_noinline<Char>(significand,
1662
+ significand + integral_size, out);
1663
+ if (!decimal_point) return out;
1664
+ *out++ = decimal_point;
1665
+ return detail::copy_str_noinline<Char>(significand + integral_size,
1666
+ significand + significand_size, out);
1667
+ }
1668
+
1669
+ template <typename OutputIt, typename DecimalFP, typename Char>
1670
+ auto write_float(OutputIt out, const DecimalFP& fp,
1671
+ const basic_format_specs<Char>& specs, float_specs fspecs,
1672
+ Char decimal_point) -> OutputIt {
1673
+ auto significand = fp.significand;
1674
+ int significand_size = get_significand_size(fp);
1675
+ static const Char zero = static_cast<Char>('0');
1676
+ auto sign = fspecs.sign;
1677
+ size_t size = to_unsigned(significand_size) + (sign ? 1 : 0);
1678
+ using iterator = reserve_iterator<OutputIt>;
1679
+
1680
+ int output_exp = fp.exponent + significand_size - 1;
1681
+ auto use_exp_format = [=]() {
1682
+ if (fspecs.format == float_format::exp) return true;
1683
+ if (fspecs.format != float_format::general) return false;
1684
+ // Use the fixed notation if the exponent is in [exp_lower, exp_upper),
1685
+ // e.g. 0.0001 instead of 1e-04. Otherwise use the exponent notation.
1686
+ const int exp_lower = -4, exp_upper = 16;
1687
+ return output_exp < exp_lower ||
1688
+ output_exp >= (fspecs.precision > 0 ? fspecs.precision : exp_upper);
1689
+ };
1690
+ if (use_exp_format()) {
1691
+ int num_zeros = 0;
1692
+ if (fspecs.showpoint) {
1693
+ num_zeros = fspecs.precision - significand_size;
1694
+ if (num_zeros < 0) num_zeros = 0;
1695
+ size += to_unsigned(num_zeros);
1696
+ } else if (significand_size == 1) {
1697
+ decimal_point = Char();
1698
+ }
1699
+ auto abs_output_exp = output_exp >= 0 ? output_exp : -output_exp;
1700
+ int exp_digits = 2;
1701
+ if (abs_output_exp >= 100) exp_digits = abs_output_exp >= 1000 ? 4 : 3;
1702
+
1703
+ size += to_unsigned((decimal_point ? 1 : 0) + 2 + exp_digits);
1704
+ char exp_char = fspecs.upper ? 'E' : 'e';
1705
+ auto write = [=](iterator it) {
1706
+ if (sign) *it++ = static_cast<Char>(data::signs[sign]);
1707
+ // Insert a decimal point after the first digit and add an exponent.
1708
+ it = write_significand(it, significand, significand_size, 1,
1709
+ decimal_point);
1710
+ if (num_zeros > 0) it = detail::fill_n(it, num_zeros, zero);
1711
+ *it++ = static_cast<Char>(exp_char);
1712
+ return write_exponent<Char>(output_exp, it);
1713
+ };
1714
+ return specs.width > 0 ? write_padded<align::right>(out, specs, size, write)
1715
+ : base_iterator(out, write(reserve(out, size)));
1716
+ }
1717
+
1718
+ int exp = fp.exponent + significand_size;
1719
+ if (fp.exponent >= 0) {
1720
+ // 1234e5 -> 123400000[.0+]
1721
+ size += to_unsigned(fp.exponent);
1722
+ int num_zeros = fspecs.precision - exp;
1723
+ #ifdef FMT_FUZZ
1724
+ if (num_zeros > 5000)
1725
+ throw std::runtime_error("fuzz mode - avoiding excessive cpu use");
1726
+ #endif
1727
+ if (fspecs.showpoint) {
1728
+ if (num_zeros <= 0 && fspecs.format != float_format::fixed) num_zeros = 1;
1729
+ if (num_zeros > 0) size += to_unsigned(num_zeros) + 1;
1730
+ }
1731
+ return write_padded<align::right>(out, specs, size, [&](iterator it) {
1732
+ if (sign) *it++ = static_cast<Char>(data::signs[sign]);
1733
+ it = write_significand<Char>(it, significand, significand_size);
1734
+ it = detail::fill_n(it, fp.exponent, zero);
1735
+ if (!fspecs.showpoint) return it;
1736
+ *it++ = decimal_point;
1737
+ return num_zeros > 0 ? detail::fill_n(it, num_zeros, zero) : it;
1738
+ });
1739
+ } else if (exp > 0) {
1740
+ // 1234e-2 -> 12.34[0+]
1741
+ int num_zeros = fspecs.showpoint ? fspecs.precision - significand_size : 0;
1742
+ size += 1 + to_unsigned(num_zeros > 0 ? num_zeros : 0);
1743
+ return write_padded<align::right>(out, specs, size, [&](iterator it) {
1744
+ if (sign) *it++ = static_cast<Char>(data::signs[sign]);
1745
+ it = write_significand(it, significand, significand_size, exp,
1746
+ decimal_point);
1747
+ return num_zeros > 0 ? detail::fill_n(it, num_zeros, zero) : it;
1748
+ });
1749
+ }
1750
+ // 1234e-6 -> 0.001234
1751
+ int num_zeros = -exp;
1752
+ if (significand_size == 0 && fspecs.precision >= 0 &&
1753
+ fspecs.precision < num_zeros) {
1754
+ num_zeros = fspecs.precision;
1755
+ }
1756
+ bool pointy = num_zeros != 0 || significand_size != 0 || fspecs.showpoint;
1757
+ size += 1 + (pointy ? 1 : 0) + to_unsigned(num_zeros);
1758
+ return write_padded<align::right>(out, specs, size, [&](iterator it) {
1759
+ if (sign) *it++ = static_cast<Char>(data::signs[sign]);
1760
+ *it++ = zero;
1761
+ if (!pointy) return it;
1762
+ *it++ = decimal_point;
1763
+ it = detail::fill_n(it, num_zeros, zero);
1764
+ return write_significand<Char>(it, significand, significand_size);
1765
+ });
1766
+ }
1767
+
1768
+ template <typename Char, typename OutputIt, typename T,
1769
+ FMT_ENABLE_IF(std::is_floating_point<T>::value)>
1770
+ auto write(OutputIt out, T value, basic_format_specs<Char> specs,
1771
+ locale_ref loc = {}) -> OutputIt {
1772
+ if (const_check(!is_supported_floating_point(value))) return out;
1773
+ float_specs fspecs = parse_float_type_spec(specs);
1774
+ fspecs.sign = specs.sign;
1775
+ if (std::signbit(value)) { // value < 0 is false for NaN so use signbit.
1776
+ fspecs.sign = sign::minus;
1777
+ value = -value;
1778
+ } else if (fspecs.sign == sign::minus) {
1779
+ fspecs.sign = sign::none;
1780
+ }
1781
+
1782
+ if (!std::isfinite(value))
1783
+ return write_nonfinite(out, std::isinf(value), specs, fspecs);
1784
+
1785
+ if (specs.align == align::numeric && fspecs.sign) {
1786
+ auto it = reserve(out, 1);
1787
+ *it++ = static_cast<Char>(data::signs[fspecs.sign]);
1788
+ out = base_iterator(out, it);
1789
+ fspecs.sign = sign::none;
1790
+ if (specs.width != 0) --specs.width;
1791
+ }
1792
+
1793
+ memory_buffer buffer;
1794
+ if (fspecs.format == float_format::hex) {
1795
+ if (fspecs.sign) buffer.push_back(data::signs[fspecs.sign]);
1796
+ snprintf_float(promote_float(value), specs.precision, fspecs, buffer);
1797
+ return write_bytes<align::right>(out, {buffer.data(), buffer.size()},
1798
+ specs);
1799
+ }
1800
+ int precision = specs.precision >= 0 || !specs.type ? specs.precision : 6;
1801
+ if (fspecs.format == float_format::exp) {
1802
+ if (precision == max_value<int>())
1803
+ FMT_THROW(format_error("number is too big"));
1804
+ else
1805
+ ++precision;
1806
+ }
1807
+ if (const_check(std::is_same<T, float>())) fspecs.binary32 = true;
1808
+ fspecs.use_grisu = is_fast_float<T>();
1809
+ int exp = format_float(promote_float(value), precision, fspecs, buffer);
1810
+ fspecs.precision = precision;
1811
+ Char point =
1812
+ fspecs.locale ? decimal_point<Char>(loc) : static_cast<Char>('.');
1813
+ auto fp = big_decimal_fp{buffer.data(), static_cast<int>(buffer.size()), exp};
1814
+ return write_float(out, fp, specs, fspecs, point);
1815
+ }
1816
+
1817
+ template <typename Char, typename OutputIt, typename T,
1818
+ FMT_ENABLE_IF(is_fast_float<T>::value)>
1819
+ auto write(OutputIt out, T value) -> OutputIt {
1820
+ if (const_check(!is_supported_floating_point(value))) return out;
1821
+
1822
+ using floaty = conditional_t<std::is_same<T, long double>::value, double, T>;
1823
+ using uint = typename dragonbox::float_info<floaty>::carrier_uint;
1824
+ auto bits = bit_cast<uint>(value);
1825
+
1826
+ auto fspecs = float_specs();
1827
+ auto sign_bit = bits & (uint(1) << (num_bits<uint>() - 1));
1828
+ if (sign_bit != 0) {
1829
+ fspecs.sign = sign::minus;
1830
+ value = -value;
1831
+ }
1832
+
1833
+ static const auto specs = basic_format_specs<Char>();
1834
+ uint mask = exponent_mask<floaty>();
1835
+ if ((bits & mask) == mask)
1836
+ return write_nonfinite(out, std::isinf(value), specs, fspecs);
1837
+
1838
+ auto dec = dragonbox::to_decimal(static_cast<floaty>(value));
1839
+ return write_float(out, dec, specs, fspecs, static_cast<Char>('.'));
1840
+ }
1841
+
1842
+ template <typename Char, typename OutputIt, typename T,
1843
+ FMT_ENABLE_IF(std::is_floating_point<T>::value &&
1844
+ !is_fast_float<T>::value)>
1845
+ inline auto write(OutputIt out, T value) -> OutputIt {
1846
+ return write(out, value, basic_format_specs<Char>());
1847
+ }
1848
+
1849
+ template <typename Char, typename OutputIt>
1850
+ auto write(OutputIt out, monostate, basic_format_specs<Char> = {},
1851
+ locale_ref = {}) -> OutputIt {
1852
+ FMT_ASSERT(false, "");
1853
+ return out;
1854
+ }
1855
+
1856
+ template <typename Char, typename OutputIt>
1857
+ FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> value)
1858
+ -> OutputIt {
1859
+ auto it = reserve(out, value.size());
1860
+ it = copy_str_noinline<Char>(value.begin(), value.end(), it);
1861
+ return base_iterator(out, it);
1862
+ }
1863
+
1864
+ template <typename Char, typename OutputIt, typename T,
1865
+ FMT_ENABLE_IF(is_string<T>::value)>
1866
+ constexpr auto write(OutputIt out, const T& value) -> OutputIt {
1867
+ return write<Char>(out, to_string_view(value));
1868
+ }
1869
+
1870
+ template <typename Char, typename OutputIt, typename T,
1871
+ FMT_ENABLE_IF(is_integral<T>::value &&
1872
+ !std::is_same<T, bool>::value &&
1873
+ !std::is_same<T, Char>::value)>
1874
+ FMT_CONSTEXPR auto write(OutputIt out, T value) -> OutputIt {
1875
+ auto abs_value = static_cast<uint32_or_64_or_128_t<T>>(value);
1876
+ bool negative = is_negative(value);
1877
+ // Don't do -abs_value since it trips unsigned-integer-overflow sanitizer.
1878
+ if (negative) abs_value = ~abs_value + 1;
1879
+ int num_digits = count_digits(abs_value);
1880
+ auto size = (negative ? 1 : 0) + static_cast<size_t>(num_digits);
1881
+ auto it = reserve(out, size);
1882
+ if (auto ptr = to_pointer<Char>(it, size)) {
1883
+ if (negative) *ptr++ = static_cast<Char>('-');
1884
+ format_decimal<Char>(ptr, abs_value, num_digits);
1885
+ return out;
1886
+ }
1887
+ if (negative) *it++ = static_cast<Char>('-');
1888
+ it = format_decimal<Char>(it, abs_value, num_digits).end;
1889
+ return base_iterator(out, it);
1890
+ }
1891
+
1892
+ // FMT_ENABLE_IF() condition separated to workaround MSVC bug
1893
+ template <
1894
+ typename Char, typename OutputIt, typename T,
1895
+ bool check =
1896
+ std::is_enum<T>::value && !std::is_same<T, Char>::value &&
1897
+ mapped_type_constant<T, basic_format_context<OutputIt, Char>>::value !=
1898
+ type::custom_type,
1899
+ FMT_ENABLE_IF(check)>
1900
+ FMT_CONSTEXPR auto write(OutputIt out, T value) -> OutputIt {
1901
+ return write<Char>(
1902
+ out, static_cast<typename std::underlying_type<T>::type>(value));
1903
+ }
1904
+
1905
+ template <typename Char, typename OutputIt, typename T,
1906
+ FMT_ENABLE_IF(std::is_same<T, bool>::value)>
1907
+ FMT_CONSTEXPR auto write(OutputIt out, T value,
1908
+ const basic_format_specs<Char>& specs = {},
1909
+ locale_ref = {}) -> OutputIt {
1910
+ return specs.type && specs.type != 's'
1911
+ ? write(out, value ? 1 : 0, specs, {})
1912
+ : write_bytes(out, value ? "true" : "false", specs);
1913
+ }
1914
+
1915
+ template <typename Char, typename OutputIt>
1916
+ FMT_CONSTEXPR auto write(OutputIt out, Char value) -> OutputIt {
1917
+ auto it = reserve(out, 1);
1918
+ *it++ = value;
1919
+ return base_iterator(out, it);
1920
+ }
1921
+
1922
+ template <typename Char, typename OutputIt>
1923
+ FMT_CONSTEXPR_CHAR_TRAITS auto write(OutputIt out, const Char* value)
1924
+ -> OutputIt {
1925
+ if (!value) {
1926
+ FMT_THROW(format_error("string pointer is null"));
1927
+ } else {
1928
+ auto length = std::char_traits<Char>::length(value);
1929
+ out = write(out, basic_string_view<Char>(value, length));
1930
+ }
1931
+ return out;
1932
+ }
1933
+
1934
+ template <typename Char, typename OutputIt, typename T,
1935
+ FMT_ENABLE_IF(std::is_same<T, void>::value)>
1936
+ auto write(OutputIt out, const T* value,
1937
+ const basic_format_specs<Char>& specs = {}, locale_ref = {})
1938
+ -> OutputIt {
1939
+ check_pointer_type_spec(specs.type, error_handler());
1940
+ return write_ptr<Char>(out, to_uintptr(value), &specs);
1941
+ }
1942
+
1943
+ template <typename Char, typename OutputIt, typename T>
1944
+ FMT_CONSTEXPR auto write(OutputIt out, const T& value) ->
1945
+ typename std::enable_if<
1946
+ mapped_type_constant<T, basic_format_context<OutputIt, Char>>::value ==
1947
+ type::custom_type,
1948
+ OutputIt>::type {
1949
+ using context_type = basic_format_context<OutputIt, Char>;
1950
+ using formatter_type =
1951
+ conditional_t<has_formatter<T, context_type>::value,
1952
+ typename context_type::template formatter_type<T>,
1953
+ fallback_formatter<T, Char>>;
1954
+ context_type ctx(out, {}, {});
1955
+ return formatter_type().format(value, ctx);
1956
+ }
1957
+
1958
+ // An argument visitor that formats the argument and writes it via the output
1959
+ // iterator. It's a class and not a generic lambda for compatibility with C++11.
1960
+ template <typename Char> struct default_arg_formatter {
1961
+ using iterator = buffer_appender<Char>;
1962
+ using context = buffer_context<Char>;
1963
+
1964
+ iterator out;
1965
+ basic_format_args<context> args;
1966
+ locale_ref loc;
1967
+
1968
+ template <typename T> auto operator()(T value) -> iterator {
1969
+ return write<Char>(out, value);
1970
+ }
1971
+ auto operator()(typename basic_format_arg<context>::handle h) -> iterator {
1972
+ basic_format_parse_context<Char> parse_ctx({});
1973
+ context format_ctx(out, args, loc);
1974
+ h.format(parse_ctx, format_ctx);
1975
+ return format_ctx.out();
1976
+ }
1977
+ };
1978
+
1979
+ template <typename Char> struct arg_formatter {
1980
+ using iterator = buffer_appender<Char>;
1981
+ using context = buffer_context<Char>;
1982
+
1983
+ iterator out;
1984
+ const basic_format_specs<Char>& specs;
1985
+ locale_ref locale;
1986
+
1987
+ template <typename T>
1988
+ FMT_CONSTEXPR FMT_INLINE auto operator()(T value) -> iterator {
1989
+ return detail::write(out, value, specs, locale);
1990
+ }
1991
+ auto operator()(typename basic_format_arg<context>::handle) -> iterator {
1992
+ // User-defined types are handled separately because they require access
1993
+ // to the parse context.
1994
+ return out;
1995
+ }
1996
+ };
1997
+
1998
+ template <typename Char> struct custom_formatter {
1999
+ basic_format_parse_context<Char>& parse_ctx;
2000
+ buffer_context<Char>& ctx;
2001
+
2002
+ void operator()(
2003
+ typename basic_format_arg<buffer_context<Char>>::handle h) const {
2004
+ h.format(parse_ctx, ctx);
2005
+ }
2006
+ template <typename T> void operator()(T) const {}
2007
+ };
2008
+
2009
+ template <typename T>
2010
+ using is_integer =
2011
+ bool_constant<is_integral<T>::value && !std::is_same<T, bool>::value &&
2012
+ !std::is_same<T, char>::value &&
2013
+ !std::is_same<T, wchar_t>::value>;
2014
+
2015
+ template <typename ErrorHandler> class width_checker {
2016
+ public:
2017
+ explicit FMT_CONSTEXPR width_checker(ErrorHandler& eh) : handler_(eh) {}
2018
+
2019
+ template <typename T, FMT_ENABLE_IF(is_integer<T>::value)>
2020
+ FMT_CONSTEXPR auto operator()(T value) -> unsigned long long {
2021
+ if (is_negative(value)) handler_.on_error("negative width");
2022
+ return static_cast<unsigned long long>(value);
2023
+ }
2024
+
2025
+ template <typename T, FMT_ENABLE_IF(!is_integer<T>::value)>
2026
+ FMT_CONSTEXPR auto operator()(T) -> unsigned long long {
2027
+ handler_.on_error("width is not integer");
2028
+ return 0;
2029
+ }
2030
+
2031
+ private:
2032
+ ErrorHandler& handler_;
2033
+ };
2034
+
2035
+ template <typename ErrorHandler> class precision_checker {
2036
+ public:
2037
+ explicit FMT_CONSTEXPR precision_checker(ErrorHandler& eh) : handler_(eh) {}
2038
+
2039
+ template <typename T, FMT_ENABLE_IF(is_integer<T>::value)>
2040
+ FMT_CONSTEXPR auto operator()(T value) -> unsigned long long {
2041
+ if (is_negative(value)) handler_.on_error("negative precision");
2042
+ return static_cast<unsigned long long>(value);
2043
+ }
2044
+
2045
+ template <typename T, FMT_ENABLE_IF(!is_integer<T>::value)>
2046
+ FMT_CONSTEXPR auto operator()(T) -> unsigned long long {
2047
+ handler_.on_error("precision is not integer");
2048
+ return 0;
2049
+ }
2050
+
2051
+ private:
2052
+ ErrorHandler& handler_;
2053
+ };
2054
+
2055
+ template <template <typename> class Handler, typename FormatArg,
2056
+ typename ErrorHandler>
2057
+ FMT_CONSTEXPR auto get_dynamic_spec(FormatArg arg, ErrorHandler eh) -> int {
2058
+ unsigned long long value = visit_format_arg(Handler<ErrorHandler>(eh), arg);
2059
+ if (value > to_unsigned(max_value<int>())) eh.on_error("number is too big");
2060
+ return static_cast<int>(value);
2061
+ }
2062
+
2063
+ template <typename Context, typename ID>
2064
+ FMT_CONSTEXPR auto get_arg(Context& ctx, ID id) ->
2065
+ typename Context::format_arg {
2066
+ auto arg = ctx.arg(id);
2067
+ if (!arg) ctx.on_error("argument not found");
2068
+ return arg;
2069
+ }
2070
+
2071
+ // The standard format specifier handler with checking.
2072
+ template <typename Char> class specs_handler : public specs_setter<Char> {
2073
+ private:
2074
+ basic_format_parse_context<Char>& parse_context_;
2075
+ buffer_context<Char>& context_;
2076
+
2077
+ // This is only needed for compatibility with gcc 4.4.
2078
+ using format_arg = basic_format_arg<buffer_context<Char>>;
2079
+
2080
+ FMT_CONSTEXPR auto get_arg(auto_id) -> format_arg {
2081
+ return detail::get_arg(context_, parse_context_.next_arg_id());
2082
+ }
2083
+
2084
+ FMT_CONSTEXPR auto get_arg(int arg_id) -> format_arg {
2085
+ parse_context_.check_arg_id(arg_id);
2086
+ return detail::get_arg(context_, arg_id);
2087
+ }
2088
+
2089
+ FMT_CONSTEXPR auto get_arg(basic_string_view<Char> arg_id) -> format_arg {
2090
+ parse_context_.check_arg_id(arg_id);
2091
+ return detail::get_arg(context_, arg_id);
2092
+ }
2093
+
2094
+ public:
2095
+ FMT_CONSTEXPR specs_handler(basic_format_specs<Char>& specs,
2096
+ basic_format_parse_context<Char>& parse_ctx,
2097
+ buffer_context<Char>& ctx)
2098
+ : specs_setter<Char>(specs), parse_context_(parse_ctx), context_(ctx) {}
2099
+
2100
+ template <typename Id> FMT_CONSTEXPR void on_dynamic_width(Id arg_id) {
2101
+ this->specs_.width = get_dynamic_spec<width_checker>(
2102
+ get_arg(arg_id), context_.error_handler());
2103
+ }
2104
+
2105
+ template <typename Id> FMT_CONSTEXPR void on_dynamic_precision(Id arg_id) {
2106
+ this->specs_.precision = get_dynamic_spec<precision_checker>(
2107
+ get_arg(arg_id), context_.error_handler());
2108
+ }
2109
+
2110
+ void on_error(const char* message) { context_.on_error(message); }
2111
+ };
2112
+
2113
+ template <template <typename> class Handler, typename Context>
2114
+ FMT_CONSTEXPR void handle_dynamic_spec(int& value,
2115
+ arg_ref<typename Context::char_type> ref,
2116
+ Context& ctx) {
2117
+ switch (ref.kind) {
2118
+ case arg_id_kind::none:
2119
+ break;
2120
+ case arg_id_kind::index:
2121
+ value = detail::get_dynamic_spec<Handler>(ctx.arg(ref.val.index),
2122
+ ctx.error_handler());
2123
+ break;
2124
+ case arg_id_kind::name:
2125
+ value = detail::get_dynamic_spec<Handler>(ctx.arg(ref.val.name),
2126
+ ctx.error_handler());
2127
+ break;
2128
+ }
2129
+ }
2130
+
2131
+ #define FMT_STRING_IMPL(s, base, explicit) \
2132
+ [] { \
2133
+ /* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \
2134
+ /* Use a macro-like name to avoid shadowing warnings. */ \
2135
+ struct FMT_GCC_VISIBILITY_HIDDEN FMT_COMPILE_STRING : base { \
2136
+ using char_type = fmt::remove_cvref_t<decltype(s[0])>; \
2137
+ FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit \
2138
+ operator fmt::basic_string_view<char_type>() const { \
2139
+ return fmt::detail_exported::compile_string_to_view<char_type>(s); \
2140
+ } \
2141
+ }; \
2142
+ return FMT_COMPILE_STRING(); \
2143
+ }()
2144
+
2145
+ /**
2146
+ \rst
2147
+ Constructs a compile-time format string from a string literal *s*.
2148
+
2149
+ **Example**::
2150
+
2151
+ // A compile-time error because 'd' is an invalid specifier for strings.
2152
+ std::string s = fmt::format(FMT_STRING("{:d}"), "foo");
2153
+ \endrst
2154
+ */
2155
+ #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::compile_string, )
2156
+
2157
+ #if FMT_USE_USER_DEFINED_LITERALS
2158
+ template <typename Char> struct udl_formatter {
2159
+ basic_string_view<Char> str;
2160
+
2161
+ template <typename... T>
2162
+ auto operator()(T&&... args) const -> std::basic_string<Char> {
2163
+ return vformat(str, fmt::make_args_checked<T...>(str, args...));
2164
+ }
2165
+ };
2166
+
2167
+ # if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2168
+ template <typename T, typename Char, size_t N,
2169
+ fmt::detail_exported::fixed_string<Char, N> Str>
2170
+ struct statically_named_arg : view {
2171
+ static constexpr auto name = Str.data;
2172
+
2173
+ const T& value;
2174
+ statically_named_arg(const T& v) : value(v) {}
2175
+ };
2176
+
2177
+ template <typename T, typename Char, size_t N,
2178
+ fmt::detail_exported::fixed_string<Char, N> Str>
2179
+ struct is_named_arg<statically_named_arg<T, Char, N, Str>> : std::true_type {};
2180
+
2181
+ template <typename T, typename Char, size_t N,
2182
+ fmt::detail_exported::fixed_string<Char, N> Str>
2183
+ struct is_statically_named_arg<statically_named_arg<T, Char, N, Str>>
2184
+ : std::true_type {};
2185
+
2186
+ template <typename Char, size_t N,
2187
+ fmt::detail_exported::fixed_string<Char, N> Str>
2188
+ struct udl_arg {
2189
+ template <typename T> auto operator=(T&& value) const {
2190
+ return statically_named_arg<T, Char, N, Str>(std::forward<T>(value));
2191
+ }
2192
+ };
2193
+ # else
2194
+ template <typename Char> struct udl_arg {
2195
+ const Char* str;
2196
+
2197
+ template <typename T> auto operator=(T&& value) const -> named_arg<Char, T> {
2198
+ return {str, std::forward<T>(value)};
2199
+ }
2200
+ };
2201
+ # endif
2202
+ #endif // FMT_USE_USER_DEFINED_LITERALS
2203
+
2204
+ template <typename Locale, typename Char>
2205
+ auto vformat(const Locale& loc, basic_string_view<Char> format_str,
2206
+ basic_format_args<buffer_context<type_identity_t<Char>>> args)
2207
+ -> std::basic_string<Char> {
2208
+ basic_memory_buffer<Char> buffer;
2209
+ detail::vformat_to(buffer, format_str, args, detail::locale_ref(loc));
2210
+ return {buffer.data(), buffer.size()};
2211
+ }
2212
+
2213
+ using format_func = void (*)(detail::buffer<char>&, int, const char*);
2214
+
2215
+ FMT_API void format_error_code(buffer<char>& out, int error_code,
2216
+ string_view message) FMT_NOEXCEPT;
2217
+
2218
+ FMT_API void report_error(format_func func, int error_code,
2219
+ const char* message) FMT_NOEXCEPT;
2220
+ FMT_END_DETAIL_NAMESPACE
2221
+
2222
+ FMT_API auto vsystem_error(int error_code, string_view format_str,
2223
+ format_args args) -> std::system_error;
2224
+
2225
+ /**
2226
+ \rst
2227
+ Constructs :class:`std::system_error` with a message formatted with
2228
+ ``fmt::format(fmt, args...)``.
2229
+ *error_code* is a system error code as given by ``errno``.
2230
+
2231
+ **Example**::
2232
+
2233
+ // This throws std::system_error with the description
2234
+ // cannot open file 'madeup': No such file or directory
2235
+ // or similar (system message may vary).
2236
+ const char* filename = "madeup";
2237
+ std::FILE* file = std::fopen(filename, "r");
2238
+ if (!file)
2239
+ throw fmt::system_error(errno, "cannot open file '{}'", filename);
2240
+ \endrst
2241
+ */
2242
+ template <typename... T>
2243
+ auto system_error(int error_code, format_string<T...> fmt, T&&... args)
2244
+ -> std::system_error {
2245
+ return vsystem_error(error_code, fmt, fmt::make_format_args(args...));
2246
+ }
2247
+
2248
+ /**
2249
+ \rst
2250
+ Formats an error message for an error returned by an operating system or a
2251
+ language runtime, for example a file opening error, and writes it to *out*.
2252
+ The format is the same as the one used by ``std::system_error(ec, message)``
2253
+ where ``ec`` is ``std::error_code(error_code, std::generic_category()})``.
2254
+ It is implementation-defined but normally looks like:
2255
+
2256
+ .. parsed-literal::
2257
+ *<message>*: *<system-message>*
2258
+
2259
+ where *<message>* is the passed message and *<system-message>* is the system
2260
+ message corresponding to the error code.
2261
+ *error_code* is a system error code as given by ``errno``.
2262
+ \endrst
2263
+ */
2264
+ FMT_API void format_system_error(detail::buffer<char>& out, int error_code,
2265
+ const char* message) FMT_NOEXCEPT;
2266
+
2267
+ // Reports a system error without throwing an exception.
2268
+ // Can be used to report errors from destructors.
2269
+ FMT_API void report_system_error(int error_code,
2270
+ const char* message) FMT_NOEXCEPT;
2271
+
2272
+ /** Fast integer formatter. */
2273
+ class format_int {
2274
+ private:
2275
+ // Buffer should be large enough to hold all digits (digits10 + 1),
2276
+ // a sign and a null character.
2277
+ enum { buffer_size = std::numeric_limits<unsigned long long>::digits10 + 3 };
2278
+ mutable char buffer_[buffer_size];
2279
+ char* str_;
2280
+
2281
+ template <typename UInt> auto format_unsigned(UInt value) -> char* {
2282
+ auto n = static_cast<detail::uint32_or_64_or_128_t<UInt>>(value);
2283
+ return detail::format_decimal(buffer_, n, buffer_size - 1).begin;
2284
+ }
2285
+
2286
+ template <typename Int> auto format_signed(Int value) -> char* {
2287
+ auto abs_value = static_cast<detail::uint32_or_64_or_128_t<Int>>(value);
2288
+ bool negative = value < 0;
2289
+ if (negative) abs_value = 0 - abs_value;
2290
+ auto begin = format_unsigned(abs_value);
2291
+ if (negative) *--begin = '-';
2292
+ return begin;
2293
+ }
2294
+
2295
+ public:
2296
+ explicit format_int(int value) : str_(format_signed(value)) {}
2297
+ explicit format_int(long value) : str_(format_signed(value)) {}
2298
+ explicit format_int(long long value) : str_(format_signed(value)) {}
2299
+ explicit format_int(unsigned value) : str_(format_unsigned(value)) {}
2300
+ explicit format_int(unsigned long value) : str_(format_unsigned(value)) {}
2301
+ explicit format_int(unsigned long long value)
2302
+ : str_(format_unsigned(value)) {}
2303
+
2304
+ /** Returns the number of characters written to the output buffer. */
2305
+ auto size() const -> size_t {
2306
+ return detail::to_unsigned(buffer_ - str_ + buffer_size - 1);
2307
+ }
2308
+
2309
+ /**
2310
+ Returns a pointer to the output buffer content. No terminating null
2311
+ character is appended.
2312
+ */
2313
+ auto data() const -> const char* { return str_; }
2314
+
2315
+ /**
2316
+ Returns a pointer to the output buffer content with terminating null
2317
+ character appended.
2318
+ */
2319
+ auto c_str() const -> const char* {
2320
+ buffer_[buffer_size - 1] = '\0';
2321
+ return str_;
2322
+ }
2323
+
2324
+ /**
2325
+ \rst
2326
+ Returns the content of the output buffer as an ``std::string``.
2327
+ \endrst
2328
+ */
2329
+ auto str() const -> std::string { return std::string(str_, size()); }
2330
+ };
2331
+
2332
+ template <typename T, typename Char>
2333
+ template <typename FormatContext>
2334
+ FMT_CONSTEXPR FMT_INLINE auto
2335
+ formatter<T, Char,
2336
+ enable_if_t<detail::type_constant<T, Char>::value !=
2337
+ detail::type::custom_type>>::format(const T& val,
2338
+ FormatContext& ctx)
2339
+ const -> decltype(ctx.out()) {
2340
+ if (specs_.width_ref.kind != detail::arg_id_kind::none ||
2341
+ specs_.precision_ref.kind != detail::arg_id_kind::none) {
2342
+ auto specs = specs_;
2343
+ detail::handle_dynamic_spec<detail::width_checker>(specs.width,
2344
+ specs.width_ref, ctx);
2345
+ detail::handle_dynamic_spec<detail::precision_checker>(
2346
+ specs.precision, specs.precision_ref, ctx);
2347
+ return detail::write<Char>(ctx.out(), val, specs, ctx.locale());
2348
+ }
2349
+ return detail::write<Char>(ctx.out(), val, specs_, ctx.locale());
2350
+ }
2351
+
2352
+ #define FMT_FORMAT_AS(Type, Base) \
2353
+ template <typename Char> \
2354
+ struct formatter<Type, Char> : formatter<Base, Char> { \
2355
+ template <typename FormatContext> \
2356
+ auto format(Type const& val, FormatContext& ctx) const \
2357
+ -> decltype(ctx.out()) { \
2358
+ return formatter<Base, Char>::format(static_cast<Base>(val), ctx); \
2359
+ } \
2360
+ }
2361
+
2362
+ FMT_FORMAT_AS(signed char, int);
2363
+ FMT_FORMAT_AS(unsigned char, unsigned);
2364
+ FMT_FORMAT_AS(short, int);
2365
+ FMT_FORMAT_AS(unsigned short, unsigned);
2366
+ FMT_FORMAT_AS(long, long long);
2367
+ FMT_FORMAT_AS(unsigned long, unsigned long long);
2368
+ FMT_FORMAT_AS(Char*, const Char*);
2369
+ FMT_FORMAT_AS(std::basic_string<Char>, basic_string_view<Char>);
2370
+ FMT_FORMAT_AS(std::nullptr_t, const void*);
2371
+ FMT_FORMAT_AS(detail::std_string_view<Char>, basic_string_view<Char>);
2372
+
2373
+ template <typename Char>
2374
+ struct formatter<void*, Char> : formatter<const void*, Char> {
2375
+ template <typename FormatContext>
2376
+ auto format(void* val, FormatContext& ctx) const -> decltype(ctx.out()) {
2377
+ return formatter<const void*, Char>::format(val, ctx);
2378
+ }
2379
+ };
2380
+
2381
+ template <typename Char, size_t N>
2382
+ struct formatter<Char[N], Char> : formatter<basic_string_view<Char>, Char> {
2383
+ template <typename FormatContext>
2384
+ FMT_CONSTEXPR auto format(const Char* val, FormatContext& ctx) const
2385
+ -> decltype(ctx.out()) {
2386
+ return formatter<basic_string_view<Char>, Char>::format(val, ctx);
2387
+ }
2388
+ };
2389
+
2390
+ // A formatter for types known only at run time such as variant alternatives.
2391
+ //
2392
+ // Usage:
2393
+ // using variant = std::variant<int, std::string>;
2394
+ // template <>
2395
+ // struct formatter<variant>: dynamic_formatter<> {
2396
+ // auto format(const variant& v, format_context& ctx) {
2397
+ // return visit([&](const auto& val) {
2398
+ // return dynamic_formatter<>::format(val, ctx);
2399
+ // }, v);
2400
+ // }
2401
+ // };
2402
+ template <typename Char = char> class dynamic_formatter {
2403
+ private:
2404
+ detail::dynamic_format_specs<Char> specs_;
2405
+ const Char* format_str_;
2406
+
2407
+ struct null_handler : detail::error_handler {
2408
+ void on_align(align_t) {}
2409
+ void on_sign(sign_t) {}
2410
+ void on_hash() {}
2411
+ };
2412
+
2413
+ template <typename Context> void handle_specs(Context& ctx) {
2414
+ detail::handle_dynamic_spec<detail::width_checker>(specs_.width,
2415
+ specs_.width_ref, ctx);
2416
+ detail::handle_dynamic_spec<detail::precision_checker>(
2417
+ specs_.precision, specs_.precision_ref, ctx);
2418
+ }
2419
+
2420
+ public:
2421
+ template <typename ParseContext>
2422
+ FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
2423
+ format_str_ = ctx.begin();
2424
+ // Checks are deferred to formatting time when the argument type is known.
2425
+ detail::dynamic_specs_handler<ParseContext> handler(specs_, ctx);
2426
+ return detail::parse_format_specs(ctx.begin(), ctx.end(), handler);
2427
+ }
2428
+
2429
+ template <typename T, typename FormatContext>
2430
+ auto format(const T& val, FormatContext& ctx) -> decltype(ctx.out()) {
2431
+ handle_specs(ctx);
2432
+ detail::specs_checker<null_handler> checker(
2433
+ null_handler(), detail::mapped_type_constant<T, FormatContext>::value);
2434
+ checker.on_align(specs_.align);
2435
+ if (specs_.sign != sign::none) checker.on_sign(specs_.sign);
2436
+ if (specs_.alt) checker.on_hash();
2437
+ if (specs_.precision >= 0) checker.end_precision();
2438
+ return detail::write<Char>(ctx.out(), val, specs_, ctx.locale());
2439
+ }
2440
+ };
2441
+
2442
+ /**
2443
+ \rst
2444
+ Converts ``p`` to ``const void*`` for pointer formatting.
2445
+
2446
+ **Example**::
2447
+
2448
+ auto s = fmt::format("{}", fmt::ptr(p));
2449
+ \endrst
2450
+ */
2451
+ template <typename T> auto ptr(T p) -> const void* {
2452
+ static_assert(std::is_pointer<T>::value, "");
2453
+ return detail::bit_cast<const void*>(p);
2454
+ }
2455
+ template <typename T> auto ptr(const std::unique_ptr<T>& p) -> const void* {
2456
+ return p.get();
2457
+ }
2458
+ template <typename T> auto ptr(const std::shared_ptr<T>& p) -> const void* {
2459
+ return p.get();
2460
+ }
2461
+
2462
+ class bytes {
2463
+ private:
2464
+ string_view data_;
2465
+ friend struct formatter<bytes>;
2466
+
2467
+ public:
2468
+ explicit bytes(string_view data) : data_(data) {}
2469
+ };
2470
+
2471
+ template <> struct formatter<bytes> {
2472
+ private:
2473
+ detail::dynamic_format_specs<char> specs_;
2474
+
2475
+ public:
2476
+ template <typename ParseContext>
2477
+ FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
2478
+ using handler_type = detail::dynamic_specs_handler<ParseContext>;
2479
+ detail::specs_checker<handler_type> handler(handler_type(specs_, ctx),
2480
+ detail::type::string_type);
2481
+ auto it = parse_format_specs(ctx.begin(), ctx.end(), handler);
2482
+ detail::check_string_type_spec(specs_.type, ctx.error_handler());
2483
+ return it;
2484
+ }
2485
+
2486
+ template <typename FormatContext>
2487
+ auto format(bytes b, FormatContext& ctx) -> decltype(ctx.out()) {
2488
+ detail::handle_dynamic_spec<detail::width_checker>(specs_.width,
2489
+ specs_.width_ref, ctx);
2490
+ detail::handle_dynamic_spec<detail::precision_checker>(
2491
+ specs_.precision, specs_.precision_ref, ctx);
2492
+ return detail::write_bytes(ctx.out(), b.data_, specs_);
2493
+ }
2494
+ };
2495
+
2496
+ template <typename It, typename Sentinel, typename Char = char>
2497
+ struct join_view : detail::view {
2498
+ It begin;
2499
+ Sentinel end;
2500
+ basic_string_view<Char> sep;
2501
+
2502
+ join_view(It b, Sentinel e, basic_string_view<Char> s)
2503
+ : begin(b), end(e), sep(s) {}
2504
+ };
2505
+
2506
+ template <typename It, typename Sentinel, typename Char>
2507
+ using arg_join FMT_DEPRECATED_ALIAS = join_view<It, Sentinel, Char>;
2508
+
2509
+ template <typename It, typename Sentinel, typename Char>
2510
+ struct formatter<join_view<It, Sentinel, Char>, Char> {
2511
+ private:
2512
+ using value_type = typename std::iterator_traits<It>::value_type;
2513
+ using context = buffer_context<Char>;
2514
+ using mapper = detail::arg_mapper<context>;
2515
+
2516
+ template <typename T, FMT_ENABLE_IF(has_formatter<T, context>::value)>
2517
+ static auto map(const T& value) -> const T& {
2518
+ return value;
2519
+ }
2520
+ template <typename T, FMT_ENABLE_IF(!has_formatter<T, context>::value)>
2521
+ static auto map(const T& value) -> decltype(mapper().map(value)) {
2522
+ return mapper().map(value);
2523
+ }
2524
+
2525
+ using formatter_type =
2526
+ conditional_t<is_formattable<value_type, Char>::value,
2527
+ formatter<remove_cvref_t<decltype(map(
2528
+ std::declval<const value_type&>()))>,
2529
+ Char>,
2530
+ detail::fallback_formatter<value_type, Char>>;
2531
+
2532
+ formatter_type value_formatter_;
2533
+
2534
+ public:
2535
+ template <typename ParseContext>
2536
+ FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
2537
+ return value_formatter_.parse(ctx);
2538
+ }
2539
+
2540
+ template <typename FormatContext>
2541
+ auto format(const join_view<It, Sentinel, Char>& value, FormatContext& ctx)
2542
+ -> decltype(ctx.out()) {
2543
+ auto it = value.begin;
2544
+ auto out = ctx.out();
2545
+ if (it != value.end) {
2546
+ out = value_formatter_.format(map(*it++), ctx);
2547
+ while (it != value.end) {
2548
+ out = detail::copy_str<Char>(value.sep.begin(), value.sep.end(), out);
2549
+ ctx.advance_to(out);
2550
+ out = value_formatter_.format(map(*it++), ctx);
2551
+ }
2552
+ }
2553
+ return out;
2554
+ }
2555
+ };
2556
+
2557
+ /**
2558
+ Returns an object that formats the iterator range `[begin, end)` with
2559
+ elements separated by `sep`.
2560
+ */
2561
+ template <typename It, typename Sentinel>
2562
+ auto join(It begin, Sentinel end, string_view sep) -> join_view<It, Sentinel> {
2563
+ return {begin, end, sep};
2564
+ }
2565
+
2566
+ /**
2567
+ \rst
2568
+ Returns an object that formats `range` with elements separated by `sep`.
2569
+
2570
+ **Example**::
2571
+
2572
+ std::vector<int> v = {1, 2, 3};
2573
+ fmt::print("{}", fmt::join(v, ", "));
2574
+ // Output: "1, 2, 3"
2575
+
2576
+ ``fmt::join`` applies passed format specifiers to the range elements::
2577
+
2578
+ fmt::print("{:02}", fmt::join(v, ", "));
2579
+ // Output: "01, 02, 03"
2580
+ \endrst
2581
+ */
2582
+ template <typename Range>
2583
+ auto join(Range&& range, string_view sep)
2584
+ -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>> {
2585
+ return join(std::begin(range), std::end(range), sep);
2586
+ }
2587
+
2588
+ /**
2589
+ \rst
2590
+ Converts *value* to ``std::string`` using the default format for type *T*.
2591
+
2592
+ **Example**::
2593
+
2594
+ #include <fmt/format.h>
2595
+
2596
+ std::string answer = fmt::to_string(42);
2597
+ \endrst
2598
+ */
2599
+ template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
2600
+ inline auto to_string(const T& value) -> std::string {
2601
+ auto result = std::string();
2602
+ detail::write<char>(std::back_inserter(result), value);
2603
+ return result;
2604
+ }
2605
+
2606
+ template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
2607
+ inline auto to_string(T value) -> std::string {
2608
+ // The buffer should be large enough to store the number including the sign
2609
+ // or "false" for bool.
2610
+ constexpr int max_size = detail::digits10<T>() + 2;
2611
+ char buffer[max_size > 5 ? static_cast<unsigned>(max_size) : 5];
2612
+ char* begin = buffer;
2613
+ return std::string(begin, detail::write<char>(begin, value));
2614
+ }
2615
+
2616
+ template <typename Char, size_t SIZE>
2617
+ auto to_string(const basic_memory_buffer<Char, SIZE>& buf)
2618
+ -> std::basic_string<Char> {
2619
+ auto size = buf.size();
2620
+ detail::assume(size < std::basic_string<Char>().max_size());
2621
+ return std::basic_string<Char>(buf.data(), size);
2622
+ }
2623
+
2624
+ FMT_BEGIN_DETAIL_NAMESPACE
2625
+
2626
+ template <typename Char>
2627
+ void vformat_to(
2628
+ buffer<Char>& buf, basic_string_view<Char> fmt,
2629
+ basic_format_args<FMT_BUFFER_CONTEXT(type_identity_t<Char>)> args,
2630
+ locale_ref loc) {
2631
+ // workaround for msvc bug regarding name-lookup in module
2632
+ // link names into function scope
2633
+ using detail::arg_formatter;
2634
+ using detail::buffer_appender;
2635
+ using detail::custom_formatter;
2636
+ using detail::default_arg_formatter;
2637
+ using detail::get_arg;
2638
+ using detail::locale_ref;
2639
+ using detail::parse_format_specs;
2640
+ using detail::specs_checker;
2641
+ using detail::specs_handler;
2642
+ using detail::to_unsigned;
2643
+ using detail::type;
2644
+ using detail::write;
2645
+ auto out = buffer_appender<Char>(buf);
2646
+ if (fmt.size() == 2 && equal2(fmt.data(), "{}")) {
2647
+ auto arg = args.get(0);
2648
+ if (!arg) error_handler().on_error("argument not found");
2649
+ visit_format_arg(default_arg_formatter<Char>{out, args, loc}, arg);
2650
+ return;
2651
+ }
2652
+
2653
+ struct format_handler : error_handler {
2654
+ basic_format_parse_context<Char> parse_context;
2655
+ buffer_context<Char> context;
2656
+
2657
+ format_handler(buffer_appender<Char> out, basic_string_view<Char> str,
2658
+ basic_format_args<buffer_context<Char>> args, locale_ref loc)
2659
+ : parse_context(str), context(out, args, loc) {}
2660
+
2661
+ void on_text(const Char* begin, const Char* end) {
2662
+ auto text = basic_string_view<Char>(begin, to_unsigned(end - begin));
2663
+ context.advance_to(write<Char>(context.out(), text));
2664
+ }
2665
+
2666
+ FMT_CONSTEXPR auto on_arg_id() -> int {
2667
+ return parse_context.next_arg_id();
2668
+ }
2669
+ FMT_CONSTEXPR auto on_arg_id(int id) -> int {
2670
+ return parse_context.check_arg_id(id), id;
2671
+ }
2672
+ FMT_CONSTEXPR auto on_arg_id(basic_string_view<Char> id) -> int {
2673
+ int arg_id = context.arg_id(id);
2674
+ if (arg_id < 0) on_error("argument not found");
2675
+ return arg_id;
2676
+ }
2677
+
2678
+ FMT_INLINE void on_replacement_field(int id, const Char*) {
2679
+ auto arg = get_arg(context, id);
2680
+ context.advance_to(visit_format_arg(
2681
+ default_arg_formatter<Char>{context.out(), context.args(),
2682
+ context.locale()},
2683
+ arg));
2684
+ }
2685
+
2686
+ auto on_format_specs(int id, const Char* begin, const Char* end)
2687
+ -> const Char* {
2688
+ auto arg = get_arg(context, id);
2689
+ if (arg.type() == type::custom_type) {
2690
+ parse_context.advance_to(parse_context.begin() +
2691
+ (begin - &*parse_context.begin()));
2692
+ visit_format_arg(custom_formatter<Char>{parse_context, context}, arg);
2693
+ return parse_context.begin();
2694
+ }
2695
+ auto specs = basic_format_specs<Char>();
2696
+ specs_checker<specs_handler<Char>> handler(
2697
+ specs_handler<Char>(specs, parse_context, context), arg.type());
2698
+ begin = parse_format_specs(begin, end, handler);
2699
+ if (begin == end || *begin != '}')
2700
+ on_error("missing '}' in format string");
2701
+ auto f = arg_formatter<Char>{context.out(), specs, context.locale()};
2702
+ context.advance_to(visit_format_arg(f, arg));
2703
+ return begin;
2704
+ }
2705
+ };
2706
+ detail::parse_format_string<false>(fmt, format_handler(out, fmt, args, loc));
2707
+ }
2708
+
2709
+ #ifndef FMT_HEADER_ONLY
2710
+ extern template FMT_API auto thousands_sep_impl<char>(locale_ref)
2711
+ -> thousands_sep_result<char>;
2712
+ extern template FMT_API auto thousands_sep_impl<wchar_t>(locale_ref)
2713
+ -> thousands_sep_result<wchar_t>;
2714
+ extern template FMT_API auto decimal_point_impl(locale_ref) -> char;
2715
+ extern template FMT_API auto decimal_point_impl(locale_ref) -> wchar_t;
2716
+ extern template auto format_float<double>(double value, int precision,
2717
+ float_specs specs, buffer<char>& buf)
2718
+ -> int;
2719
+ extern template auto format_float<long double>(long double value, int precision,
2720
+ float_specs specs,
2721
+ buffer<char>& buf) -> int;
2722
+ void snprintf_float(float, int, float_specs, buffer<char>&) = delete;
2723
+ extern template auto snprintf_float<double>(double value, int precision,
2724
+ float_specs specs,
2725
+ buffer<char>& buf) -> int;
2726
+ extern template auto snprintf_float<long double>(long double value,
2727
+ int precision,
2728
+ float_specs specs,
2729
+ buffer<char>& buf) -> int;
2730
+ #endif // FMT_HEADER_ONLY
2731
+
2732
+ FMT_END_DETAIL_NAMESPACE
2733
+
2734
+ #if FMT_USE_USER_DEFINED_LITERALS
2735
+ inline namespace literals {
2736
+ /**
2737
+ \rst
2738
+ User-defined literal equivalent of :func:`fmt::arg`.
2739
+
2740
+ **Example**::
2741
+
2742
+ using namespace fmt::literals;
2743
+ fmt::print("Elapsed time: {s:.2f} seconds", "s"_a=1.23);
2744
+ \endrst
2745
+ */
2746
+ # if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2747
+ template <detail_exported::fixed_string Str>
2748
+ constexpr auto operator""_a()
2749
+ -> detail::udl_arg<remove_cvref_t<decltype(Str.data[0])>,
2750
+ sizeof(Str.data) / sizeof(decltype(Str.data[0])), Str> {
2751
+ return {};
2752
+ }
2753
+ # else
2754
+ constexpr auto operator"" _a(const char* s, size_t) -> detail::udl_arg<char> {
2755
+ return {s};
2756
+ }
2757
+ # endif
2758
+
2759
+ /**
2760
+ \rst
2761
+ User-defined literal equivalent of :func:`fmt::format`.
2762
+
2763
+ **Example**::
2764
+
2765
+ using namespace fmt::literals;
2766
+ std::string message = "The answer is {}"_format(42);
2767
+ \endrst
2768
+ */
2769
+ constexpr auto operator"" _format(const char* s, size_t n)
2770
+ -> detail::udl_formatter<char> {
2771
+ return {{s, n}};
2772
+ }
2773
+ } // namespace literals
2774
+ #endif // FMT_USE_USER_DEFINED_LITERALS
2775
+
2776
+ template <typename Locale, FMT_ENABLE_IF(detail::is_locale<Locale>::value)>
2777
+ inline auto vformat(const Locale& loc, string_view fmt, format_args args)
2778
+ -> std::string {
2779
+ return detail::vformat(loc, fmt, args);
2780
+ }
2781
+
2782
+ template <typename Locale, typename... T,
2783
+ FMT_ENABLE_IF(detail::is_locale<Locale>::value)>
2784
+ inline auto format(const Locale& loc, format_string<T...> fmt, T&&... args)
2785
+ -> std::string {
2786
+ return vformat(loc, string_view(fmt), fmt::make_format_args(args...));
2787
+ }
2788
+
2789
+ template <typename... T, size_t SIZE, typename Allocator>
2790
+ FMT_DEPRECATED auto format_to(basic_memory_buffer<char, SIZE, Allocator>& buf,
2791
+ format_string<T...> fmt, T&&... args)
2792
+ -> appender {
2793
+ detail::vformat_to(buf, string_view(fmt), fmt::make_format_args(args...));
2794
+ return appender(buf);
2795
+ }
2796
+
2797
+ template <typename OutputIt, typename Locale,
2798
+ FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value&&
2799
+ detail::is_locale<Locale>::value)>
2800
+ auto vformat_to(OutputIt out, const Locale& loc, string_view fmt,
2801
+ format_args args) -> OutputIt {
2802
+ using detail::get_buffer;
2803
+ auto&& buf = get_buffer<char>(out);
2804
+ detail::vformat_to(buf, fmt, args, detail::locale_ref(loc));
2805
+ return detail::get_iterator(buf);
2806
+ }
2807
+
2808
+ template <typename OutputIt, typename Locale, typename... T,
2809
+ FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value&&
2810
+ detail::is_locale<Locale>::value)>
2811
+ FMT_INLINE auto format_to(OutputIt out, const Locale& loc,
2812
+ format_string<T...> fmt, T&&... args) -> OutputIt {
2813
+ return vformat_to(out, loc, fmt, fmt::make_format_args(args...));
2814
+ }
2815
+
2816
+ FMT_MODULE_EXPORT_END
2817
+ FMT_END_NAMESPACE
2818
+
2819
+ #ifdef FMT_DEPRECATED_INCLUDE_XCHAR
2820
+ # include "xchar.h"
2821
+ #endif
2822
+
2823
+ #ifdef FMT_HEADER_ONLY
2824
+ # define FMT_FUNC inline
2825
+ # include "format-inl.h"
2826
+ #else
2827
+ # define FMT_FUNC
2828
+ #endif
2829
+
2830
+ #endif // FMT_FORMAT_H_