rn-leveldb 3.11.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 (595) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -0
  3. package/android/.project +34 -0
  4. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  5. package/android/CMakeLists.txt +69 -0
  6. package/android/build.gradle +125 -0
  7. package/android/cpp-adapter.cpp +19 -0
  8. package/android/gradle.properties +6 -0
  9. package/android/src/main/AndroidManifest.xml +4 -0
  10. package/android/src/main/java/com/reactnativeleveldb/LeveldbModule.java +57 -0
  11. package/android/src/main/java/com/reactnativeleveldb/LeveldbPackage.java +28 -0
  12. package/cpp/leveldb/.appveyor.yml +36 -0
  13. package/cpp/leveldb/.clang-format +18 -0
  14. package/cpp/leveldb/.travis.yml +88 -0
  15. package/cpp/leveldb/AUTHORS +12 -0
  16. package/cpp/leveldb/CMakeLists.txt +495 -0
  17. package/cpp/leveldb/CONTRIBUTING.md +36 -0
  18. package/cpp/leveldb/LICENSE +27 -0
  19. package/cpp/leveldb/NEWS +17 -0
  20. package/cpp/leveldb/README.md +231 -0
  21. package/cpp/leveldb/TODO +14 -0
  22. package/cpp/leveldb/benchmarks/db_bench.cc +990 -0
  23. package/cpp/leveldb/benchmarks/db_bench_sqlite3.cc +726 -0
  24. package/cpp/leveldb/benchmarks/db_bench_tree_db.cc +531 -0
  25. package/cpp/leveldb/cmake/leveldbConfig.cmake.in +9 -0
  26. package/cpp/leveldb/db/autocompact_test.cc +115 -0
  27. package/cpp/leveldb/db/builder.cc +82 -0
  28. package/cpp/leveldb/db/builder.h +30 -0
  29. package/cpp/leveldb/db/c.cc +562 -0
  30. package/cpp/leveldb/db/c_test.c +384 -0
  31. package/cpp/leveldb/db/corruption_test.cc +367 -0
  32. package/cpp/leveldb/db/db_impl.cc +1554 -0
  33. package/cpp/leveldb/db/db_impl.h +217 -0
  34. package/cpp/leveldb/db/db_iter.cc +318 -0
  35. package/cpp/leveldb/db/db_iter.h +26 -0
  36. package/cpp/leveldb/db/db_test.cc +2305 -0
  37. package/cpp/leveldb/db/dbformat.cc +136 -0
  38. package/cpp/leveldb/db/dbformat.h +224 -0
  39. package/cpp/leveldb/db/dbformat_test.cc +133 -0
  40. package/cpp/leveldb/db/dumpfile.cc +232 -0
  41. package/cpp/leveldb/db/fault_injection_test.cc +555 -0
  42. package/cpp/leveldb/db/filename.cc +141 -0
  43. package/cpp/leveldb/db/filename.h +83 -0
  44. package/cpp/leveldb/db/filename_test.cc +132 -0
  45. package/cpp/leveldb/db/leveldbutil.cc +64 -0
  46. package/cpp/leveldb/db/log_format.h +35 -0
  47. package/cpp/leveldb/db/log_reader.cc +274 -0
  48. package/cpp/leveldb/db/log_reader.h +112 -0
  49. package/cpp/leveldb/db/log_test.cc +563 -0
  50. package/cpp/leveldb/db/log_writer.cc +111 -0
  51. package/cpp/leveldb/db/log_writer.h +54 -0
  52. package/cpp/leveldb/db/memtable.cc +137 -0
  53. package/cpp/leveldb/db/memtable.h +87 -0
  54. package/cpp/leveldb/db/recovery_test.cc +339 -0
  55. package/cpp/leveldb/db/repair.cc +451 -0
  56. package/cpp/leveldb/db/skiplist.h +382 -0
  57. package/cpp/leveldb/db/skiplist_test.cc +373 -0
  58. package/cpp/leveldb/db/snapshot.h +95 -0
  59. package/cpp/leveldb/db/table_cache.cc +120 -0
  60. package/cpp/leveldb/db/table_cache.h +57 -0
  61. package/cpp/leveldb/db/version_edit.cc +257 -0
  62. package/cpp/leveldb/db/version_edit.h +106 -0
  63. package/cpp/leveldb/db/version_edit_test.cc +46 -0
  64. package/cpp/leveldb/db/version_set.cc +1562 -0
  65. package/cpp/leveldb/db/version_set.h +393 -0
  66. package/cpp/leveldb/db/version_set_test.cc +336 -0
  67. package/cpp/leveldb/db/write_batch.cc +150 -0
  68. package/cpp/leveldb/db/write_batch_internal.h +45 -0
  69. package/cpp/leveldb/db/write_batch_test.cc +137 -0
  70. package/cpp/leveldb/doc/benchmark.html +459 -0
  71. package/cpp/leveldb/doc/impl.md +172 -0
  72. package/cpp/leveldb/doc/index.md +523 -0
  73. package/cpp/leveldb/doc/log_format.md +75 -0
  74. package/cpp/leveldb/doc/table_format.md +107 -0
  75. package/cpp/leveldb/helpers/memenv/memenv.cc +390 -0
  76. package/cpp/leveldb/helpers/memenv/memenv.h +22 -0
  77. package/cpp/leveldb/helpers/memenv/memenv_test.cc +264 -0
  78. package/cpp/leveldb/include/leveldb/c.h +270 -0
  79. package/cpp/leveldb/include/leveldb/cache.h +111 -0
  80. package/cpp/leveldb/include/leveldb/comparator.h +64 -0
  81. package/cpp/leveldb/include/leveldb/db.h +167 -0
  82. package/cpp/leveldb/include/leveldb/dumpfile.h +28 -0
  83. package/cpp/leveldb/include/leveldb/env.h +417 -0
  84. package/cpp/leveldb/include/leveldb/export.h +33 -0
  85. package/cpp/leveldb/include/leveldb/filter_policy.h +72 -0
  86. package/cpp/leveldb/include/leveldb/iterator.h +112 -0
  87. package/cpp/leveldb/include/leveldb/options.h +187 -0
  88. package/cpp/leveldb/include/leveldb/slice.h +114 -0
  89. package/cpp/leveldb/include/leveldb/status.h +122 -0
  90. package/cpp/leveldb/include/leveldb/table.h +84 -0
  91. package/cpp/leveldb/include/leveldb/table_builder.h +93 -0
  92. package/cpp/leveldb/include/leveldb/write_batch.h +83 -0
  93. package/cpp/leveldb/issues/issue178_test.cc +90 -0
  94. package/cpp/leveldb/issues/issue200_test.cc +59 -0
  95. package/cpp/leveldb/issues/issue320_test.cc +131 -0
  96. package/cpp/leveldb/port/README.md +10 -0
  97. package/cpp/leveldb/port/port.h +19 -0
  98. package/cpp/leveldb/port/port_config.h.in +33 -0
  99. package/cpp/leveldb/port/port_example.h +100 -0
  100. package/cpp/leveldb/port/port_stdcxx.h +151 -0
  101. package/cpp/leveldb/port/thread_annotations.h +108 -0
  102. package/cpp/leveldb/table/block.cc +267 -0
  103. package/cpp/leveldb/table/block.h +44 -0
  104. package/cpp/leveldb/table/block_builder.cc +107 -0
  105. package/cpp/leveldb/table/block_builder.h +54 -0
  106. package/cpp/leveldb/table/filter_block.cc +106 -0
  107. package/cpp/leveldb/table/filter_block.h +68 -0
  108. package/cpp/leveldb/table/filter_block_test.cc +127 -0
  109. package/cpp/leveldb/table/format.cc +141 -0
  110. package/cpp/leveldb/table/format.h +99 -0
  111. package/cpp/leveldb/table/iterator.cc +76 -0
  112. package/cpp/leveldb/table/iterator_wrapper.h +92 -0
  113. package/cpp/leveldb/table/merger.cc +191 -0
  114. package/cpp/leveldb/table/merger.h +26 -0
  115. package/cpp/leveldb/table/table.cc +271 -0
  116. package/cpp/leveldb/table/table_builder.cc +265 -0
  117. package/cpp/leveldb/table/table_test.cc +834 -0
  118. package/cpp/leveldb/table/two_level_iterator.cc +171 -0
  119. package/cpp/leveldb/table/two_level_iterator.h +31 -0
  120. package/cpp/leveldb/third_party/benchmark/.clang-format +5 -0
  121. package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  122. package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  123. package/cpp/leveldb/third_party/benchmark/.github/workflows/build-and-test.yml +38 -0
  124. package/cpp/leveldb/third_party/benchmark/.github/workflows/pylint.yml +26 -0
  125. package/cpp/leveldb/third_party/benchmark/.github/workflows/test_bindings.yml +24 -0
  126. package/cpp/leveldb/third_party/benchmark/.travis-libcxx-setup.sh +28 -0
  127. package/cpp/leveldb/third_party/benchmark/.travis.yml +231 -0
  128. package/cpp/leveldb/third_party/benchmark/.ycm_extra_conf.py +115 -0
  129. package/cpp/leveldb/third_party/benchmark/AUTHORS +58 -0
  130. package/cpp/leveldb/third_party/benchmark/BUILD.bazel +44 -0
  131. package/cpp/leveldb/third_party/benchmark/CMakeLists.txt +287 -0
  132. package/cpp/leveldb/third_party/benchmark/CONTRIBUTING.md +58 -0
  133. package/cpp/leveldb/third_party/benchmark/CONTRIBUTORS +83 -0
  134. package/cpp/leveldb/third_party/benchmark/LICENSE +202 -0
  135. package/cpp/leveldb/third_party/benchmark/README.md +1323 -0
  136. package/cpp/leveldb/third_party/benchmark/WORKSPACE +51 -0
  137. package/cpp/leveldb/third_party/benchmark/_config.yml +1 -0
  138. package/cpp/leveldb/third_party/benchmark/appveyor.yml +50 -0
  139. package/cpp/leveldb/third_party/benchmark/bindings/python/BUILD +3 -0
  140. package/cpp/leveldb/third_party/benchmark/bindings/python/build_defs.bzl +25 -0
  141. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/BUILD +38 -0
  142. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/__init__.py +156 -0
  143. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/benchmark.cc +180 -0
  144. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/example.py +136 -0
  145. package/cpp/leveldb/third_party/benchmark/bindings/python/pybind11.BUILD +20 -0
  146. package/cpp/leveldb/third_party/benchmark/bindings/python/python_headers.BUILD +6 -0
  147. package/cpp/leveldb/third_party/benchmark/bindings/python/requirements.txt +2 -0
  148. package/cpp/leveldb/third_party/benchmark/cmake/AddCXXCompilerFlag.cmake +74 -0
  149. package/cpp/leveldb/third_party/benchmark/cmake/CXXFeatureCheck.cmake +69 -0
  150. package/cpp/leveldb/third_party/benchmark/cmake/Config.cmake.in +1 -0
  151. package/cpp/leveldb/third_party/benchmark/cmake/GetGitVersion.cmake +54 -0
  152. package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake +41 -0
  153. package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake.in +58 -0
  154. package/cpp/leveldb/third_party/benchmark/cmake/benchmark.pc.in +12 -0
  155. package/cpp/leveldb/third_party/benchmark/cmake/gnu_posix_regex.cpp +12 -0
  156. package/cpp/leveldb/third_party/benchmark/cmake/llvm-toolchain.cmake +8 -0
  157. package/cpp/leveldb/third_party/benchmark/cmake/posix_regex.cpp +14 -0
  158. package/cpp/leveldb/third_party/benchmark/cmake/split_list.cmake +3 -0
  159. package/cpp/leveldb/third_party/benchmark/cmake/std_regex.cpp +10 -0
  160. package/cpp/leveldb/third_party/benchmark/cmake/steady_clock.cpp +7 -0
  161. package/cpp/leveldb/third_party/benchmark/cmake/thread_safety_attributes.cpp +4 -0
  162. package/cpp/leveldb/third_party/benchmark/conan/CMakeLists.txt +7 -0
  163. package/cpp/leveldb/third_party/benchmark/conan/test_package/CMakeLists.txt +10 -0
  164. package/cpp/leveldb/third_party/benchmark/conan/test_package/conanfile.py +19 -0
  165. package/cpp/leveldb/third_party/benchmark/conan/test_package/test_package.cpp +18 -0
  166. package/cpp/leveldb/third_party/benchmark/conanfile.py +79 -0
  167. package/cpp/leveldb/third_party/benchmark/dependencies.md +18 -0
  168. package/cpp/leveldb/third_party/benchmark/docs/AssemblyTests.md +147 -0
  169. package/cpp/leveldb/third_party/benchmark/docs/_config.yml +1 -0
  170. package/cpp/leveldb/third_party/benchmark/docs/releasing.md +16 -0
  171. package/cpp/leveldb/third_party/benchmark/docs/tools.md +203 -0
  172. package/cpp/leveldb/third_party/benchmark/include/benchmark/benchmark.h +1604 -0
  173. package/cpp/leveldb/third_party/benchmark/requirements.txt +2 -0
  174. package/cpp/leveldb/third_party/benchmark/setup.py +140 -0
  175. package/cpp/leveldb/third_party/benchmark/src/CMakeLists.txt +114 -0
  176. package/cpp/leveldb/third_party/benchmark/src/arraysize.h +33 -0
  177. package/cpp/leveldb/third_party/benchmark/src/benchmark.cc +499 -0
  178. package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.cc +15 -0
  179. package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.h +53 -0
  180. package/cpp/leveldb/third_party/benchmark/src/benchmark_main.cc +17 -0
  181. package/cpp/leveldb/third_party/benchmark/src/benchmark_name.cc +58 -0
  182. package/cpp/leveldb/third_party/benchmark/src/benchmark_register.cc +515 -0
  183. package/cpp/leveldb/third_party/benchmark/src/benchmark_register.h +108 -0
  184. package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.cc +362 -0
  185. package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.h +51 -0
  186. package/cpp/leveldb/third_party/benchmark/src/check.h +82 -0
  187. package/cpp/leveldb/third_party/benchmark/src/colorprint.cc +188 -0
  188. package/cpp/leveldb/third_party/benchmark/src/colorprint.h +33 -0
  189. package/cpp/leveldb/third_party/benchmark/src/commandlineflags.cc +228 -0
  190. package/cpp/leveldb/third_party/benchmark/src/commandlineflags.h +103 -0
  191. package/cpp/leveldb/third_party/benchmark/src/complexity.cc +238 -0
  192. package/cpp/leveldb/third_party/benchmark/src/complexity.h +55 -0
  193. package/cpp/leveldb/third_party/benchmark/src/console_reporter.cc +177 -0
  194. package/cpp/leveldb/third_party/benchmark/src/counter.cc +80 -0
  195. package/cpp/leveldb/third_party/benchmark/src/counter.h +32 -0
  196. package/cpp/leveldb/third_party/benchmark/src/csv_reporter.cc +154 -0
  197. package/cpp/leveldb/third_party/benchmark/src/cycleclock.h +211 -0
  198. package/cpp/leveldb/third_party/benchmark/src/internal_macros.h +102 -0
  199. package/cpp/leveldb/third_party/benchmark/src/json_reporter.cc +255 -0
  200. package/cpp/leveldb/third_party/benchmark/src/log.h +74 -0
  201. package/cpp/leveldb/third_party/benchmark/src/mutex.h +155 -0
  202. package/cpp/leveldb/third_party/benchmark/src/re.h +158 -0
  203. package/cpp/leveldb/third_party/benchmark/src/reporter.cc +105 -0
  204. package/cpp/leveldb/third_party/benchmark/src/sleep.cc +67 -0
  205. package/cpp/leveldb/third_party/benchmark/src/sleep.h +15 -0
  206. package/cpp/leveldb/third_party/benchmark/src/statistics.cc +193 -0
  207. package/cpp/leveldb/third_party/benchmark/src/statistics.h +37 -0
  208. package/cpp/leveldb/third_party/benchmark/src/string_util.cc +255 -0
  209. package/cpp/leveldb/third_party/benchmark/src/string_util.h +59 -0
  210. package/cpp/leveldb/third_party/benchmark/src/sysinfo.cc +716 -0
  211. package/cpp/leveldb/third_party/benchmark/src/thread_manager.h +64 -0
  212. package/cpp/leveldb/third_party/benchmark/src/thread_timer.h +86 -0
  213. package/cpp/leveldb/third_party/benchmark/src/timers.cc +245 -0
  214. package/cpp/leveldb/third_party/benchmark/src/timers.h +48 -0
  215. package/cpp/leveldb/third_party/benchmark/test/AssemblyTests.cmake +46 -0
  216. package/cpp/leveldb/third_party/benchmark/test/BUILD +73 -0
  217. package/cpp/leveldb/third_party/benchmark/test/CMakeLists.txt +263 -0
  218. package/cpp/leveldb/third_party/benchmark/test/args_product_test.cc +77 -0
  219. package/cpp/leveldb/third_party/benchmark/test/basic_test.cc +136 -0
  220. package/cpp/leveldb/third_party/benchmark/test/benchmark_gtest.cc +134 -0
  221. package/cpp/leveldb/third_party/benchmark/test/benchmark_name_gtest.cc +74 -0
  222. package/cpp/leveldb/third_party/benchmark/test/benchmark_test.cc +245 -0
  223. package/cpp/leveldb/third_party/benchmark/test/clobber_memory_assembly_test.cc +64 -0
  224. package/cpp/leveldb/third_party/benchmark/test/commandlineflags_gtest.cc +201 -0
  225. package/cpp/leveldb/third_party/benchmark/test/complexity_test.cc +213 -0
  226. package/cpp/leveldb/third_party/benchmark/test/cxx03_test.cc +63 -0
  227. package/cpp/leveldb/third_party/benchmark/test/diagnostics_test.cc +80 -0
  228. package/cpp/leveldb/third_party/benchmark/test/display_aggregates_only_test.cc +43 -0
  229. package/cpp/leveldb/third_party/benchmark/test/donotoptimize_assembly_test.cc +163 -0
  230. package/cpp/leveldb/third_party/benchmark/test/donotoptimize_test.cc +52 -0
  231. package/cpp/leveldb/third_party/benchmark/test/filter_test.cc +104 -0
  232. package/cpp/leveldb/third_party/benchmark/test/fixture_test.cc +51 -0
  233. package/cpp/leveldb/third_party/benchmark/test/internal_threading_test.cc +184 -0
  234. package/cpp/leveldb/third_party/benchmark/test/link_main_test.cc +8 -0
  235. package/cpp/leveldb/third_party/benchmark/test/map_test.cc +57 -0
  236. package/cpp/leveldb/third_party/benchmark/test/memory_manager_test.cc +44 -0
  237. package/cpp/leveldb/third_party/benchmark/test/multiple_ranges_test.cc +96 -0
  238. package/cpp/leveldb/third_party/benchmark/test/options_test.cc +75 -0
  239. package/cpp/leveldb/third_party/benchmark/test/output_test.h +213 -0
  240. package/cpp/leveldb/third_party/benchmark/test/output_test_helper.cc +515 -0
  241. package/cpp/leveldb/third_party/benchmark/test/register_benchmark_test.cc +184 -0
  242. package/cpp/leveldb/third_party/benchmark/test/report_aggregates_only_test.cc +39 -0
  243. package/cpp/leveldb/third_party/benchmark/test/reporter_output_test.cc +747 -0
  244. package/cpp/leveldb/third_party/benchmark/test/skip_with_error_test.cc +195 -0
  245. package/cpp/leveldb/third_party/benchmark/test/state_assembly_test.cc +68 -0
  246. package/cpp/leveldb/third_party/benchmark/test/statistics_gtest.cc +28 -0
  247. package/cpp/leveldb/third_party/benchmark/test/string_util_gtest.cc +153 -0
  248. package/cpp/leveldb/third_party/benchmark/test/templated_fixture_test.cc +28 -0
  249. package/cpp/leveldb/third_party/benchmark/test/user_counters_tabular_test.cc +285 -0
  250. package/cpp/leveldb/third_party/benchmark/test/user_counters_test.cc +531 -0
  251. package/cpp/leveldb/third_party/benchmark/test/user_counters_thousands_test.cc +173 -0
  252. package/cpp/leveldb/third_party/benchmark/tools/BUILD.bazel +19 -0
  253. package/cpp/leveldb/third_party/benchmark/tools/compare.py +429 -0
  254. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run1.json +119 -0
  255. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run2.json +119 -0
  256. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test2_run.json +81 -0
  257. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run0.json +65 -0
  258. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run1.json +65 -0
  259. package/cpp/leveldb/third_party/benchmark/tools/gbench/__init__.py +8 -0
  260. package/cpp/leveldb/third_party/benchmark/tools/gbench/report.py +903 -0
  261. package/cpp/leveldb/third_party/benchmark/tools/gbench/util.py +163 -0
  262. package/cpp/leveldb/third_party/benchmark/tools/requirements.txt +1 -0
  263. package/cpp/leveldb/third_party/benchmark/tools/strip_asm.py +151 -0
  264. package/cpp/leveldb/third_party/googletest/.clang-format +4 -0
  265. package/cpp/leveldb/third_party/googletest/.travis.yml +73 -0
  266. package/cpp/leveldb/third_party/googletest/BUILD.bazel +179 -0
  267. package/cpp/leveldb/third_party/googletest/CMakeLists.txt +36 -0
  268. package/cpp/leveldb/third_party/googletest/CONTRIBUTING.md +142 -0
  269. package/cpp/leveldb/third_party/googletest/LICENSE +28 -0
  270. package/cpp/leveldb/third_party/googletest/README.md +132 -0
  271. package/cpp/leveldb/third_party/googletest/WORKSPACE +23 -0
  272. package/cpp/leveldb/third_party/googletest/appveyor.yml +154 -0
  273. package/cpp/leveldb/third_party/googletest/ci/build-linux-bazel.sh +37 -0
  274. package/cpp/leveldb/third_party/googletest/ci/build-platformio.sh +2 -0
  275. package/cpp/leveldb/third_party/googletest/ci/env-linux.sh +41 -0
  276. package/cpp/leveldb/third_party/googletest/ci/env-osx.sh +47 -0
  277. package/cpp/leveldb/third_party/googletest/ci/get-nprocessors.sh +48 -0
  278. package/cpp/leveldb/third_party/googletest/ci/install-linux.sh +49 -0
  279. package/cpp/leveldb/third_party/googletest/ci/install-osx.sh +40 -0
  280. package/cpp/leveldb/third_party/googletest/ci/install-platformio.sh +5 -0
  281. package/cpp/leveldb/third_party/googletest/ci/log-config.sh +51 -0
  282. package/cpp/leveldb/third_party/googletest/ci/travis.sh +44 -0
  283. package/cpp/leveldb/third_party/googletest/googlemock/CMakeLists.txt +233 -0
  284. package/cpp/leveldb/third_party/googletest/googlemock/CONTRIBUTORS +40 -0
  285. package/cpp/leveldb/third_party/googletest/googlemock/LICENSE +28 -0
  286. package/cpp/leveldb/third_party/googletest/googlemock/README.md +44 -0
  287. package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock.pc.in +10 -0
  288. package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock_main.pc.in +10 -0
  289. package/cpp/leveldb/third_party/googletest/googlemock/docs/cheat_sheet.md +770 -0
  290. package/cpp/leveldb/third_party/googletest/googlemock/docs/cook_book.md +4270 -0
  291. package/cpp/leveldb/third_party/googletest/googlemock/docs/for_dummies.md +700 -0
  292. package/cpp/leveldb/third_party/googletest/googlemock/docs/gmock_faq.md +396 -0
  293. package/cpp/leveldb/third_party/googletest/googlemock/docs/pump_manual.md +187 -0
  294. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-actions.h +1193 -0
  295. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-cardinalities.h +157 -0
  296. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-function-mocker.h +276 -0
  297. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h +1884 -0
  298. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump +627 -0
  299. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h +752 -0
  300. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +227 -0
  301. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h +1097 -0
  302. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump +346 -0
  303. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-matchers.h +4591 -0
  304. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h +162 -0
  305. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-matchers.h +92 -0
  306. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h +215 -0
  307. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-spec-builders.h +1985 -0
  308. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock.h +101 -0
  309. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/README.md +16 -0
  310. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +10 -0
  311. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +12 -0
  312. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h +36 -0
  313. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-port.h +39 -0
  314. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h +472 -0
  315. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h +87 -0
  316. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-pp.h +271 -0
  317. package/cpp/leveldb/third_party/googletest/googlemock/scripts/README.md +5 -0
  318. package/cpp/leveldb/third_party/googletest/googlemock/scripts/fuse_gmock_files.py +240 -0
  319. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/LICENSE +203 -0
  320. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README +34 -0
  321. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README.cppclean +115 -0
  322. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  323. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/ast.py +1761 -0
  324. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class.py +248 -0
  325. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class_test.py +540 -0
  326. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/keywords.py +56 -0
  327. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/tokenize.py +284 -0
  328. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/utils.py +37 -0
  329. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/gmock_gen.py +30 -0
  330. package/cpp/leveldb/third_party/googletest/googlemock/scripts/pump.py +856 -0
  331. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-all.cc +46 -0
  332. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-cardinalities.cc +155 -0
  333. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-internal-utils.cc +200 -0
  334. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-matchers.cc +462 -0
  335. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-spec-builders.cc +892 -0
  336. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock.cc +213 -0
  337. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock_main.cc +72 -0
  338. package/cpp/leveldb/third_party/googletest/googlemock/test/BUILD.bazel +110 -0
  339. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-actions_test.cc +1507 -0
  340. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-cardinalities_test.cc +429 -0
  341. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc.cc +16 -0
  342. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc_test.py +43 -0
  343. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_test.cc +696 -0
  344. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-actions_test.cc +1064 -0
  345. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-function-mockers_test.cc +659 -0
  346. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-matchers_test.cc +1323 -0
  347. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-internal-utils_test.cc +732 -0
  348. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-matchers_test.cc +6913 -0
  349. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-more-actions_test.cc +698 -0
  350. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc +500 -0
  351. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-port_test.cc +42 -0
  352. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp-string_test.cc +206 -0
  353. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp_test.cc +83 -0
  354. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-spec-builders_test.cc +2775 -0
  355. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_all_test.cc +49 -0
  356. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_ex_test.cc +80 -0
  357. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test.py +104 -0
  358. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test_.cc +99 -0
  359. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link2_test.cc +39 -0
  360. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.cc +39 -0
  361. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.h +690 -0
  362. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test.py +183 -0
  363. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_.cc +309 -0
  364. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_golden.txt +317 -0
  365. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_stress_test.cc +240 -0
  366. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test.cc +181 -0
  367. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test_utils.py +108 -0
  368. package/cpp/leveldb/third_party/googletest/googlemock/test/pump_test.py +182 -0
  369. package/cpp/leveldb/third_party/googletest/googletest/CMakeLists.txt +329 -0
  370. package/cpp/leveldb/third_party/googletest/googletest/CONTRIBUTORS +38 -0
  371. package/cpp/leveldb/third_party/googletest/googletest/LICENSE +28 -0
  372. package/cpp/leveldb/third_party/googletest/googletest/README.md +244 -0
  373. package/cpp/leveldb/third_party/googletest/googletest/cmake/Config.cmake.in +9 -0
  374. package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest.pc.in +9 -0
  375. package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest_main.pc.in +10 -0
  376. package/cpp/leveldb/third_party/googletest/googletest/cmake/internal_utils.cmake +358 -0
  377. package/cpp/leveldb/third_party/googletest/googletest/cmake/libgtest.la.in +21 -0
  378. package/cpp/leveldb/third_party/googletest/googletest/docs/advanced.md +2567 -0
  379. package/cpp/leveldb/third_party/googletest/googletest/docs/faq.md +753 -0
  380. package/cpp/leveldb/third_party/googletest/googletest/docs/pkgconfig.md +219 -0
  381. package/cpp/leveldb/third_party/googletest/googletest/docs/primer.md +579 -0
  382. package/cpp/leveldb/third_party/googletest/googletest/docs/samples.md +22 -0
  383. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-death-test.h +343 -0
  384. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-matchers.h +750 -0
  385. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-message.h +219 -0
  386. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-param-test.h +514 -0
  387. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-printers.h +928 -0
  388. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-spi.h +238 -0
  389. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-test-part.h +184 -0
  390. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-typed-test.h +337 -0
  391. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest.h +2477 -0
  392. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_pred_impl.h +359 -0
  393. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_prod.h +61 -0
  394. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/README.md +56 -0
  395. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-port.h +37 -0
  396. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  397. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest.h +37 -0
  398. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h +304 -0
  399. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h +211 -0
  400. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h +1411 -0
  401. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h +880 -0
  402. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h +111 -0
  403. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port.h +2227 -0
  404. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-string.h +171 -0
  405. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h +183 -0
  406. package/cpp/leveldb/third_party/googletest/googletest/samples/prime_tables.h +126 -0
  407. package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.cc +66 -0
  408. package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.h +41 -0
  409. package/cpp/leveldb/third_party/googletest/googletest/samples/sample10_unittest.cc +139 -0
  410. package/cpp/leveldb/third_party/googletest/googletest/samples/sample1_unittest.cc +151 -0
  411. package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.cc +54 -0
  412. package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.h +81 -0
  413. package/cpp/leveldb/third_party/googletest/googletest/samples/sample2_unittest.cc +107 -0
  414. package/cpp/leveldb/third_party/googletest/googletest/samples/sample3-inl.h +172 -0
  415. package/cpp/leveldb/third_party/googletest/googletest/samples/sample3_unittest.cc +149 -0
  416. package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.cc +54 -0
  417. package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.h +53 -0
  418. package/cpp/leveldb/third_party/googletest/googletest/samples/sample4_unittest.cc +53 -0
  419. package/cpp/leveldb/third_party/googletest/googletest/samples/sample5_unittest.cc +196 -0
  420. package/cpp/leveldb/third_party/googletest/googletest/samples/sample6_unittest.cc +224 -0
  421. package/cpp/leveldb/third_party/googletest/googletest/samples/sample7_unittest.cc +117 -0
  422. package/cpp/leveldb/third_party/googletest/googletest/samples/sample8_unittest.cc +154 -0
  423. package/cpp/leveldb/third_party/googletest/googletest/samples/sample9_unittest.cc +156 -0
  424. package/cpp/leveldb/third_party/googletest/googletest/scripts/README.md +5 -0
  425. package/cpp/leveldb/third_party/googletest/googletest/scripts/common.py +83 -0
  426. package/cpp/leveldb/third_party/googletest/googletest/scripts/fuse_gtest_files.py +253 -0
  427. package/cpp/leveldb/third_party/googletest/googletest/scripts/gen_gtest_pred_impl.py +734 -0
  428. package/cpp/leveldb/third_party/googletest/googletest/scripts/gtest-config.in +274 -0
  429. package/cpp/leveldb/third_party/googletest/googletest/scripts/release_docs.py +158 -0
  430. package/cpp/leveldb/third_party/googletest/googletest/scripts/run_with_path.py +32 -0
  431. package/cpp/leveldb/third_party/googletest/googletest/scripts/upload.py +1402 -0
  432. package/cpp/leveldb/third_party/googletest/googletest/scripts/upload_gtest.py +78 -0
  433. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-all.cc +48 -0
  434. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-death-test.cc +1653 -0
  435. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-filepath.cc +382 -0
  436. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-internal-inl.h +1211 -0
  437. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-matchers.cc +97 -0
  438. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-port.cc +1399 -0
  439. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-printers.cc +442 -0
  440. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-test-part.cc +108 -0
  441. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-typed-test.cc +118 -0
  442. package/cpp/leveldb/third_party/googletest/googletest/src/gtest.cc +6180 -0
  443. package/cpp/leveldb/third_party/googletest/googletest/src/gtest_main.cc +54 -0
  444. package/cpp/leveldb/third_party/googletest/googletest/test/BUILD.bazel +529 -0
  445. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest.py +208 -0
  446. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest_.cc +86 -0
  447. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test.py +236 -0
  448. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test_.cc +293 -0
  449. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test.py +127 -0
  450. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test_.cc +62 -0
  451. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test-test.cc +1516 -0
  452. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test_ex_test.cc +92 -0
  453. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test.py +117 -0
  454. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test_.cc +122 -0
  455. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filepath-test.cc +649 -0
  456. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest.py +639 -0
  457. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest_.cc +137 -0
  458. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-outfiles-test.py +191 -0
  459. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-output-unittest.py +778 -0
  460. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest.py +205 -0
  461. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest_.cc +156 -0
  462. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-listener-test.cc +518 -0
  463. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-message-test.cc +158 -0
  464. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-options-test.cc +216 -0
  465. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt +1137 -0
  466. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test.py +346 -0
  467. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test_.cc +1149 -0
  468. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test.py +63 -0
  469. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test_.cc +50 -0
  470. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test.py +62 -0
  471. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test_.cc +55 -0
  472. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.cc +1086 -0
  473. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.h +51 -0
  474. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test2-test.cc +61 -0
  475. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-port-test.cc +1272 -0
  476. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-printers-test.cc +1619 -0
  477. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test.py +323 -0
  478. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test_.cc +101 -0
  479. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test-part-test.cc +230 -0
  480. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test2_test.cc +61 -0
  481. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test.py +168 -0
  482. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test_.cc +71 -0
  483. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test.py +67 -0
  484. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test_.cc +42 -0
  485. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test2_test.cc +44 -0
  486. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.cc +462 -0
  487. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.h +65 -0
  488. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-unittest-api_test.cc +341 -0
  489. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_all_test.cc +46 -0
  490. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_assert_by_exception_test.cc +116 -0
  491. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_environment_test.cc +188 -0
  492. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test.py +170 -0
  493. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test_.cc +45 -0
  494. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_json_test_utils.py +60 -0
  495. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest.py +141 -0
  496. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest_.cc +51 -0
  497. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_main_unittest.cc +44 -0
  498. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_no_test_unittest.cc +54 -0
  499. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
  500. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_premature_exit_test.cc +126 -0
  501. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_prod_test.cc +56 -0
  502. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_repeat_test.cc +233 -0
  503. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_check_output_test.py +59 -0
  504. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_environment_check_output_test.py +54 -0
  505. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc +49 -0
  506. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_test.cc +55 -0
  507. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_sole_header_test.cc +56 -0
  508. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_stress_test.cc +248 -0
  509. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_macro_stack_footprint_test.cc +89 -0
  510. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_utils.py +314 -0
  511. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test.py +63 -0
  512. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test_.cc +43 -0
  513. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_throw_on_failure_ex_test.cc +90 -0
  514. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_unittest.cc +7496 -0
  515. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile1_test_.cc +43 -0
  516. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile2_test_.cc +43 -0
  517. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfiles_test.py +135 -0
  518. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest.py +389 -0
  519. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest_.cc +188 -0
  520. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_test_utils.py +196 -0
  521. package/cpp/leveldb/third_party/googletest/googletest/test/production.cc +35 -0
  522. package/cpp/leveldb/third_party/googletest/googletest/test/production.h +54 -0
  523. package/cpp/leveldb/third_party/googletest/library.json +66 -0
  524. package/cpp/leveldb/third_party/googletest/platformio.ini +47 -0
  525. package/cpp/leveldb/util/arena.cc +66 -0
  526. package/cpp/leveldb/util/arena.h +71 -0
  527. package/cpp/leveldb/util/arena_test.cc +66 -0
  528. package/cpp/leveldb/util/bloom.cc +92 -0
  529. package/cpp/leveldb/util/bloom_test.cc +159 -0
  530. package/cpp/leveldb/util/cache.cc +401 -0
  531. package/cpp/leveldb/util/cache_test.cc +229 -0
  532. package/cpp/leveldb/util/coding.cc +166 -0
  533. package/cpp/leveldb/util/coding.h +122 -0
  534. package/cpp/leveldb/util/coding_test.cc +198 -0
  535. package/cpp/leveldb/util/comparator.cc +75 -0
  536. package/cpp/leveldb/util/crc32c.cc +380 -0
  537. package/cpp/leveldb/util/crc32c.h +43 -0
  538. package/cpp/leveldb/util/crc32c_test.cc +61 -0
  539. package/cpp/leveldb/util/env.cc +108 -0
  540. package/cpp/leveldb/util/env_posix.cc +893 -0
  541. package/cpp/leveldb/util/env_posix_test.cc +353 -0
  542. package/cpp/leveldb/util/env_posix_test_helper.h +28 -0
  543. package/cpp/leveldb/util/env_test.cc +240 -0
  544. package/cpp/leveldb/util/env_windows.cc +796 -0
  545. package/cpp/leveldb/util/env_windows_test.cc +65 -0
  546. package/cpp/leveldb/util/env_windows_test_helper.h +25 -0
  547. package/cpp/leveldb/util/filter_policy.cc +11 -0
  548. package/cpp/leveldb/util/hash.cc +55 -0
  549. package/cpp/leveldb/util/hash.h +19 -0
  550. package/cpp/leveldb/util/hash_test.cc +46 -0
  551. package/cpp/leveldb/util/histogram.cc +272 -0
  552. package/cpp/leveldb/util/histogram.h +44 -0
  553. package/cpp/leveldb/util/logging.cc +82 -0
  554. package/cpp/leveldb/util/logging.h +44 -0
  555. package/cpp/leveldb/util/logging_test.cc +145 -0
  556. package/cpp/leveldb/util/mutexlock.h +39 -0
  557. package/cpp/leveldb/util/no_destructor.h +46 -0
  558. package/cpp/leveldb/util/no_destructor_test.cc +49 -0
  559. package/cpp/leveldb/util/options.cc +14 -0
  560. package/cpp/leveldb/util/posix_logger.h +130 -0
  561. package/cpp/leveldb/util/random.h +63 -0
  562. package/cpp/leveldb/util/status.cc +77 -0
  563. package/cpp/leveldb/util/status_test.cc +44 -0
  564. package/cpp/leveldb/util/testutil.cc +51 -0
  565. package/cpp/leveldb/util/testutil.h +82 -0
  566. package/cpp/leveldb/util/windows_logger.h +124 -0
  567. package/cpp/react-native-leveldb.cpp +694 -0
  568. package/cpp/react-native-leveldb.h +4 -0
  569. package/ios/Leveldb.h +9 -0
  570. package/ios/Leveldb.mm +35 -0
  571. package/ios/Leveldb.xcodeproj/project.pbxproj +288 -0
  572. package/lib/commonjs/fake.js +181 -0
  573. package/lib/commonjs/fake.js.map +1 -0
  574. package/lib/commonjs/fake.test.js +30 -0
  575. package/lib/commonjs/fake.test.js.map +1 -0
  576. package/lib/commonjs/index.js +172 -0
  577. package/lib/commonjs/index.js.map +1 -0
  578. package/lib/commonjs/package.json +1 -0
  579. package/lib/module/fake.js +171 -0
  580. package/lib/module/fake.js.map +1 -0
  581. package/lib/module/fake.test.js +30 -0
  582. package/lib/module/fake.test.js.map +1 -0
  583. package/lib/module/index.js +165 -0
  584. package/lib/module/index.js.map +1 -0
  585. package/lib/typescript/fake.d.ts +34 -0
  586. package/lib/typescript/fake.d.ts.map +1 -0
  587. package/lib/typescript/fake.test.d.ts +2 -0
  588. package/lib/typescript/fake.test.d.ts.map +1 -0
  589. package/lib/typescript/index.d.ts +72 -0
  590. package/lib/typescript/index.d.ts.map +1 -0
  591. package/package.json +157 -0
  592. package/rn-leveldb.podspec +30 -0
  593. package/src/fake.test.ts +37 -0
  594. package/src/fake.ts +203 -0
  595. package/src/index.ts +291 -0
@@ -0,0 +1,396 @@
1
+ ## Legacy gMock FAQ {#GMockFaq}
2
+
3
+ <!-- GOOGLETEST_CM0021 DO NOT DELETE -->
4
+
5
+ ### When I call a method on my mock object, the method for the real object is invoked instead. What's the problem?
6
+
7
+ In order for a method to be mocked, it must be *virtual*, unless you use the
8
+ [high-perf dependency injection technique](#MockingNonVirtualMethods).
9
+
10
+ ### Can I mock a variadic function?
11
+
12
+ You cannot mock a variadic function (i.e. a function taking ellipsis (`...`)
13
+ arguments) directly in gMock.
14
+
15
+ The problem is that in general, there is *no way* for a mock object to know how
16
+ many arguments are passed to the variadic method, and what the arguments' types
17
+ are. Only the *author of the base class* knows the protocol, and we cannot look
18
+ into his or her head.
19
+
20
+ Therefore, to mock such a function, the *user* must teach the mock object how to
21
+ figure out the number of arguments and their types. One way to do it is to
22
+ provide overloaded versions of the function.
23
+
24
+ Ellipsis arguments are inherited from C and not really a C++ feature. They are
25
+ unsafe to use and don't work with arguments that have constructors or
26
+ destructors. Therefore we recommend to avoid them in C++ as much as possible.
27
+
28
+ ### MSVC gives me warning C4301 or C4373 when I define a mock method with a const parameter. Why?
29
+
30
+ If you compile this using Microsoft Visual C++ 2005 SP1:
31
+
32
+ ```cpp
33
+ class Foo {
34
+ ...
35
+ virtual void Bar(const int i) = 0;
36
+ };
37
+
38
+ class MockFoo : public Foo {
39
+ ...
40
+ MOCK_METHOD(void, Bar, (const int i), (override));
41
+ };
42
+ ```
43
+
44
+ You may get the following warning:
45
+
46
+ ```shell
47
+ warning C4301: 'MockFoo::Bar': overriding virtual function only differs from 'Foo::Bar' by const/volatile qualifier
48
+ ```
49
+
50
+ This is a MSVC bug. The same code compiles fine with gcc, for example. If you
51
+ use Visual C++ 2008 SP1, you would get the warning:
52
+
53
+ ```shell
54
+ warning C4373: 'MockFoo::Bar': virtual function overrides 'Foo::Bar', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
55
+ ```
56
+
57
+ In C++, if you *declare* a function with a `const` parameter, the `const`
58
+ modifier is ignored. Therefore, the `Foo` base class above is equivalent to:
59
+
60
+ ```cpp
61
+ class Foo {
62
+ ...
63
+ virtual void Bar(int i) = 0; // int or const int? Makes no difference.
64
+ };
65
+ ```
66
+
67
+ In fact, you can *declare* `Bar()` with an `int` parameter, and define it with a
68
+ `const int` parameter. The compiler will still match them up.
69
+
70
+ Since making a parameter `const` is meaningless in the method declaration, we
71
+ recommend to remove it in both `Foo` and `MockFoo`. That should workaround the
72
+ VC bug.
73
+
74
+ Note that we are talking about the *top-level* `const` modifier here. If the
75
+ function parameter is passed by pointer or reference, declaring the pointee or
76
+ referee as `const` is still meaningful. For example, the following two
77
+ declarations are *not* equivalent:
78
+
79
+ ```cpp
80
+ void Bar(int* p); // Neither p nor *p is const.
81
+ void Bar(const int* p); // p is not const, but *p is.
82
+ ```
83
+
84
+ <!-- GOOGLETEST_CM0030 DO NOT DELETE -->
85
+
86
+ ### I can't figure out why gMock thinks my expectations are not satisfied. What should I do?
87
+
88
+ You might want to run your test with `--gmock_verbose=info`. This flag lets
89
+ gMock print a trace of every mock function call it receives. By studying the
90
+ trace, you'll gain insights on why the expectations you set are not met.
91
+
92
+ If you see the message "The mock function has no default action set, and its
93
+ return type has no default value set.", then try
94
+ [adding a default action](for_dummies.md#DefaultValue). Due to a known issue,
95
+ unexpected calls on mocks without default actions don't print out a detailed
96
+ comparison between the actual arguments and the expected arguments.
97
+
98
+ ### My program crashed and `ScopedMockLog` spit out tons of messages. Is it a gMock bug?
99
+
100
+ gMock and `ScopedMockLog` are likely doing the right thing here.
101
+
102
+ When a test crashes, the failure signal handler will try to log a lot of
103
+ information (the stack trace, and the address map, for example). The messages
104
+ are compounded if you have many threads with depth stacks. When `ScopedMockLog`
105
+ intercepts these messages and finds that they don't match any expectations, it
106
+ prints an error for each of them.
107
+
108
+ You can learn to ignore the errors, or you can rewrite your expectations to make
109
+ your test more robust, for example, by adding something like:
110
+
111
+ ```cpp
112
+ using ::testing::AnyNumber;
113
+ using ::testing::Not;
114
+ ...
115
+ // Ignores any log not done by us.
116
+ EXPECT_CALL(log, Log(_, Not(EndsWith("/my_file.cc")), _))
117
+ .Times(AnyNumber());
118
+ ```
119
+
120
+ ### How can I assert that a function is NEVER called?
121
+
122
+ ```cpp
123
+ using ::testing::_;
124
+ ...
125
+ EXPECT_CALL(foo, Bar(_))
126
+ .Times(0);
127
+ ```
128
+
129
+ <!-- GOOGLETEST_CM0031 DO NOT DELETE -->
130
+
131
+ ### I have a failed test where gMock tells me TWICE that a particular expectation is not satisfied. Isn't this redundant?
132
+
133
+ When gMock detects a failure, it prints relevant information (the mock function
134
+ arguments, the state of relevant expectations, and etc) to help the user debug.
135
+ If another failure is detected, gMock will do the same, including printing the
136
+ state of relevant expectations.
137
+
138
+ Sometimes an expectation's state didn't change between two failures, and you'll
139
+ see the same description of the state twice. They are however *not* redundant,
140
+ as they refer to *different points in time*. The fact they are the same *is*
141
+ interesting information.
142
+
143
+ ### I get a heapcheck failure when using a mock object, but using a real object is fine. What can be wrong?
144
+
145
+ Does the class (hopefully a pure interface) you are mocking have a virtual
146
+ destructor?
147
+
148
+ Whenever you derive from a base class, make sure its destructor is virtual.
149
+ Otherwise Bad Things will happen. Consider the following code:
150
+
151
+ ```cpp
152
+ class Base {
153
+ public:
154
+ // Not virtual, but should be.
155
+ ~Base() { ... }
156
+ ...
157
+ };
158
+
159
+ class Derived : public Base {
160
+ public:
161
+ ...
162
+ private:
163
+ std::string value_;
164
+ };
165
+
166
+ ...
167
+ Base* p = new Derived;
168
+ ...
169
+ delete p; // Surprise! ~Base() will be called, but ~Derived() will not
170
+ // - value_ is leaked.
171
+ ```
172
+
173
+ By changing `~Base()` to virtual, `~Derived()` will be correctly called when
174
+ `delete p` is executed, and the heap checker will be happy.
175
+
176
+ ### The "newer expectations override older ones" rule makes writing expectations awkward. Why does gMock do that?
177
+
178
+ When people complain about this, often they are referring to code like:
179
+
180
+ ```cpp
181
+ using ::testing::Return;
182
+ ...
183
+ // foo.Bar() should be called twice, return 1 the first time, and return
184
+ // 2 the second time. However, I have to write the expectations in the
185
+ // reverse order. This sucks big time!!!
186
+ EXPECT_CALL(foo, Bar())
187
+ .WillOnce(Return(2))
188
+ .RetiresOnSaturation();
189
+ EXPECT_CALL(foo, Bar())
190
+ .WillOnce(Return(1))
191
+ .RetiresOnSaturation();
192
+ ```
193
+
194
+ The problem, is that they didn't pick the **best** way to express the test's
195
+ intent.
196
+
197
+ By default, expectations don't have to be matched in *any* particular order. If
198
+ you want them to match in a certain order, you need to be explicit. This is
199
+ gMock's (and jMock's) fundamental philosophy: it's easy to accidentally
200
+ over-specify your tests, and we want to make it harder to do so.
201
+
202
+ There are two better ways to write the test spec. You could either put the
203
+ expectations in sequence:
204
+
205
+ ```cpp
206
+ using ::testing::Return;
207
+ ...
208
+ // foo.Bar() should be called twice, return 1 the first time, and return
209
+ // 2 the second time. Using a sequence, we can write the expectations
210
+ // in their natural order.
211
+ {
212
+ InSequence s;
213
+ EXPECT_CALL(foo, Bar())
214
+ .WillOnce(Return(1))
215
+ .RetiresOnSaturation();
216
+ EXPECT_CALL(foo, Bar())
217
+ .WillOnce(Return(2))
218
+ .RetiresOnSaturation();
219
+ }
220
+ ```
221
+
222
+ or you can put the sequence of actions in the same expectation:
223
+
224
+ ```cpp
225
+ using ::testing::Return;
226
+ ...
227
+ // foo.Bar() should be called twice, return 1 the first time, and return
228
+ // 2 the second time.
229
+ EXPECT_CALL(foo, Bar())
230
+ .WillOnce(Return(1))
231
+ .WillOnce(Return(2))
232
+ .RetiresOnSaturation();
233
+ ```
234
+
235
+ Back to the original questions: why does gMock search the expectations (and
236
+ `ON_CALL`s) from back to front? Because this allows a user to set up a mock's
237
+ behavior for the common case early (e.g. in the mock's constructor or the test
238
+ fixture's set-up phase) and customize it with more specific rules later. If
239
+ gMock searches from front to back, this very useful pattern won't be possible.
240
+
241
+ ### gMock prints a warning when a function without EXPECT_CALL is called, even if I have set its behavior using ON_CALL. Would it be reasonable not to show the warning in this case?
242
+
243
+ When choosing between being neat and being safe, we lean toward the latter. So
244
+ the answer is that we think it's better to show the warning.
245
+
246
+ Often people write `ON_CALL`s in the mock object's constructor or `SetUp()`, as
247
+ the default behavior rarely changes from test to test. Then in the test body
248
+ they set the expectations, which are often different for each test. Having an
249
+ `ON_CALL` in the set-up part of a test doesn't mean that the calls are expected.
250
+ If there's no `EXPECT_CALL` and the method is called, it's possibly an error. If
251
+ we quietly let the call go through without notifying the user, bugs may creep in
252
+ unnoticed.
253
+
254
+ If, however, you are sure that the calls are OK, you can write
255
+
256
+ ```cpp
257
+ using ::testing::_;
258
+ ...
259
+ EXPECT_CALL(foo, Bar(_))
260
+ .WillRepeatedly(...);
261
+ ```
262
+
263
+ instead of
264
+
265
+ ```cpp
266
+ using ::testing::_;
267
+ ...
268
+ ON_CALL(foo, Bar(_))
269
+ .WillByDefault(...);
270
+ ```
271
+
272
+ This tells gMock that you do expect the calls and no warning should be printed.
273
+
274
+ Also, you can control the verbosity by specifying `--gmock_verbose=error`. Other
275
+ values are `info` and `warning`. If you find the output too noisy when
276
+ debugging, just choose a less verbose level.
277
+
278
+ ### How can I delete the mock function's argument in an action?
279
+
280
+ If your mock function takes a pointer argument and you want to delete that
281
+ argument, you can use testing::DeleteArg<N>() to delete the N'th (zero-indexed)
282
+ argument:
283
+
284
+ ```cpp
285
+ using ::testing::_;
286
+ ...
287
+ MOCK_METHOD(void, Bar, (X* x, const Y& y));
288
+ ...
289
+ EXPECT_CALL(mock_foo_, Bar(_, _))
290
+ .WillOnce(testing::DeleteArg<0>()));
291
+ ```
292
+
293
+ ### How can I perform an arbitrary action on a mock function's argument?
294
+
295
+ If you find yourself needing to perform some action that's not supported by
296
+ gMock directly, remember that you can define your own actions using
297
+ [`MakeAction()`](#NewMonoActions) or
298
+ [`MakePolymorphicAction()`](#NewPolyActions), or you can write a stub function
299
+ and invoke it using [`Invoke()`](#FunctionsAsActions).
300
+
301
+ ```cpp
302
+ using ::testing::_;
303
+ using ::testing::Invoke;
304
+ ...
305
+ MOCK_METHOD(void, Bar, (X* p));
306
+ ...
307
+ EXPECT_CALL(mock_foo_, Bar(_))
308
+ .WillOnce(Invoke(MyAction(...)));
309
+ ```
310
+
311
+ ### My code calls a static/global function. Can I mock it?
312
+
313
+ You can, but you need to make some changes.
314
+
315
+ In general, if you find yourself needing to mock a static function, it's a sign
316
+ that your modules are too tightly coupled (and less flexible, less reusable,
317
+ less testable, etc). You are probably better off defining a small interface and
318
+ call the function through that interface, which then can be easily mocked. It's
319
+ a bit of work initially, but usually pays for itself quickly.
320
+
321
+ This Google Testing Blog
322
+ [post](https://testing.googleblog.com/2008/06/defeat-static-cling.html) says it
323
+ excellently. Check it out.
324
+
325
+ ### My mock object needs to do complex stuff. It's a lot of pain to specify the actions. gMock sucks!
326
+
327
+ I know it's not a question, but you get an answer for free any way. :-)
328
+
329
+ With gMock, you can create mocks in C++ easily. And people might be tempted to
330
+ use them everywhere. Sometimes they work great, and sometimes you may find them,
331
+ well, a pain to use. So, what's wrong in the latter case?
332
+
333
+ When you write a test without using mocks, you exercise the code and assert that
334
+ it returns the correct value or that the system is in an expected state. This is
335
+ sometimes called "state-based testing".
336
+
337
+ Mocks are great for what some call "interaction-based" testing: instead of
338
+ checking the system state at the very end, mock objects verify that they are
339
+ invoked the right way and report an error as soon as it arises, giving you a
340
+ handle on the precise context in which the error was triggered. This is often
341
+ more effective and economical to do than state-based testing.
342
+
343
+ If you are doing state-based testing and using a test double just to simulate
344
+ the real object, you are probably better off using a fake. Using a mock in this
345
+ case causes pain, as it's not a strong point for mocks to perform complex
346
+ actions. If you experience this and think that mocks suck, you are just not
347
+ using the right tool for your problem. Or, you might be trying to solve the
348
+ wrong problem. :-)
349
+
350
+ ### I got a warning "Uninteresting function call encountered - default action taken.." Should I panic?
351
+
352
+ By all means, NO! It's just an FYI. :-)
353
+
354
+ What it means is that you have a mock function, you haven't set any expectations
355
+ on it (by gMock's rule this means that you are not interested in calls to this
356
+ function and therefore it can be called any number of times), and it is called.
357
+ That's OK - you didn't say it's not OK to call the function!
358
+
359
+ What if you actually meant to disallow this function to be called, but forgot to
360
+ write `EXPECT_CALL(foo, Bar()).Times(0)`? While one can argue that it's the
361
+ user's fault, gMock tries to be nice and prints you a note.
362
+
363
+ So, when you see the message and believe that there shouldn't be any
364
+ uninteresting calls, you should investigate what's going on. To make your life
365
+ easier, gMock dumps the stack trace when an uninteresting call is encountered.
366
+ From that you can figure out which mock function it is, and how it is called.
367
+
368
+ ### I want to define a custom action. Should I use Invoke() or implement the ActionInterface interface?
369
+
370
+ Either way is fine - you want to choose the one that's more convenient for your
371
+ circumstance.
372
+
373
+ Usually, if your action is for a particular function type, defining it using
374
+ `Invoke()` should be easier; if your action can be used in functions of
375
+ different types (e.g. if you are defining `Return(*value*)`),
376
+ `MakePolymorphicAction()` is easiest. Sometimes you want precise control on what
377
+ types of functions the action can be used in, and implementing `ActionInterface`
378
+ is the way to go here. See the implementation of `Return()` in
379
+ `testing/base/public/gmock-actions.h` for an example.
380
+
381
+ ### I use SetArgPointee() in WillOnce(), but gcc complains about "conflicting return type specified". What does it mean?
382
+
383
+ You got this error as gMock has no idea what value it should return when the
384
+ mock method is called. `SetArgPointee()` says what the side effect is, but
385
+ doesn't say what the return value should be. You need `DoAll()` to chain a
386
+ `SetArgPointee()` with a `Return()` that provides a value appropriate to the API
387
+ being mocked.
388
+
389
+ See this [recipe](cook_book.md#mocking-side-effects) for more details and an
390
+ example.
391
+
392
+ ### I have a huge mock class, and Microsoft Visual C++ runs out of memory when compiling it. What can I do?
393
+
394
+ We've noticed that when the `/clr` compiler flag is used, Visual C++ uses 5~6
395
+ times as much memory when compiling a mock class. We suggest to avoid `/clr`
396
+ when compiling native C++ mocks.
@@ -0,0 +1,187 @@
1
+ <b>P</b>ump is <b>U</b>seful for <b>M</b>eta <b>P</b>rogramming.
2
+
3
+ # The Problem
4
+
5
+ Template and macro libraries often need to define many classes, functions, or
6
+ macros that vary only (or almost only) in the number of arguments they take.
7
+ It's a lot of repetitive, mechanical, and error-prone work.
8
+
9
+ Our experience is that it's tedious to write custom scripts, which tend to
10
+ reflect the structure of the generated code poorly and are often hard to read
11
+ and edit. For example, a small change needed in the generated code may require
12
+ some non-intuitive, non-trivial changes in the script. This is especially
13
+ painful when experimenting with the code.
14
+
15
+ This script may be useful for generating meta code, for example a series of
16
+ macros of FOO1, FOO2, etc. Nevertheless, please make it your last resort
17
+ technique by favouring C++ template metaprogramming or variadic macros.
18
+
19
+ # Our Solution
20
+
21
+ Pump (for Pump is Useful for Meta Programming, Pretty Useful for Meta
22
+ Programming, or Practical Utility for Meta Programming, whichever you prefer) is
23
+ a simple meta-programming tool for C++. The idea is that a programmer writes a
24
+ `foo.pump` file which contains C++ code plus meta code that manipulates the C++
25
+ code. The meta code can handle iterations over a range, nested iterations, local
26
+ meta variable definitions, simple arithmetic, and conditional expressions. You
27
+ can view it as a small Domain-Specific Language. The meta language is designed
28
+ to be non-intrusive (s.t. it won't confuse Emacs' C++ mode, for example) and
29
+ concise, making Pump code intuitive and easy to maintain.
30
+
31
+ ## Highlights
32
+
33
+ * The implementation is in a single Python script and thus ultra portable: no
34
+ build or installation is needed and it works cross platforms.
35
+ * Pump tries to be smart with respect to
36
+ [Google's style guide](https://github.com/google/styleguide): it breaks long
37
+ lines (easy to have when they are generated) at acceptable places to fit
38
+ within 80 columns and indent the continuation lines correctly.
39
+ * The format is human-readable and more concise than XML.
40
+ * The format works relatively well with Emacs' C++ mode.
41
+
42
+ ## Examples
43
+
44
+ The following Pump code (where meta keywords start with `$`, `[[` and `]]` are
45
+ meta brackets, and `$$` starts a meta comment that ends with the line):
46
+
47
+ ```
48
+ $var n = 3 $$ Defines a meta variable n.
49
+ $range i 0..n $$ Declares the range of meta iterator i (inclusive).
50
+ $for i [[
51
+ $$ Meta loop.
52
+ // Foo$i does blah for $i-ary predicates.
53
+ $range j 1..i
54
+ template <size_t N $for j [[, typename A$j]]>
55
+ class Foo$i {
56
+ $if i == 0 [[
57
+ blah a;
58
+ ]] $elif i <= 2 [[
59
+ blah b;
60
+ ]] $else [[
61
+ blah c;
62
+ ]]
63
+ };
64
+
65
+ ]]
66
+ ```
67
+
68
+ will be translated by the Pump compiler to:
69
+
70
+ ```cpp
71
+ // Foo0 does blah for 0-ary predicates.
72
+ template <size_t N>
73
+ class Foo0 {
74
+ blah a;
75
+ };
76
+
77
+ // Foo1 does blah for 1-ary predicates.
78
+ template <size_t N, typename A1>
79
+ class Foo1 {
80
+ blah b;
81
+ };
82
+
83
+ // Foo2 does blah for 2-ary predicates.
84
+ template <size_t N, typename A1, typename A2>
85
+ class Foo2 {
86
+ blah b;
87
+ };
88
+
89
+ // Foo3 does blah for 3-ary predicates.
90
+ template <size_t N, typename A1, typename A2, typename A3>
91
+ class Foo3 {
92
+ blah c;
93
+ };
94
+ ```
95
+
96
+ In another example,
97
+
98
+ ```
99
+ $range i 1..n
100
+ Func($for i + [[a$i]]);
101
+ $$ The text between i and [[ is the separator between iterations.
102
+ ```
103
+
104
+ will generate one of the following lines (without the comments), depending on
105
+ the value of `n`:
106
+
107
+ ```cpp
108
+ Func(); // If n is 0.
109
+ Func(a1); // If n is 1.
110
+ Func(a1 + a2); // If n is 2.
111
+ Func(a1 + a2 + a3); // If n is 3.
112
+ // And so on...
113
+ ```
114
+
115
+ ## Constructs
116
+
117
+ We support the following meta programming constructs:
118
+
119
+ | `$var id = exp` | Defines a named constant value. `$id` is |
120
+ : : valid util the end of the current meta :
121
+ : : lexical block. :
122
+ | :------------------------------- | :--------------------------------------- |
123
+ | `$range id exp..exp` | Sets the range of an iteration variable, |
124
+ : : which can be reused in multiple loops :
125
+ : : later. :
126
+ | `$for id sep [[ code ]]` | Iteration. The range of `id` must have |
127
+ : : been defined earlier. `$id` is valid in :
128
+ : : `code`. :
129
+ | `$($)` | Generates a single `$` character. |
130
+ | `$id` | Value of the named constant or iteration |
131
+ : : variable. :
132
+ | `$(exp)` | Value of the expression. |
133
+ | `$if exp [[ code ]] else_branch` | Conditional. |
134
+ | `[[ code ]]` | Meta lexical block. |
135
+ | `cpp_code` | Raw C++ code. |
136
+ | `$$ comment` | Meta comment. |
137
+
138
+ **Note:** To give the user some freedom in formatting the Pump source code, Pump
139
+ ignores a new-line character if it's right after `$for foo` or next to `[[` or
140
+ `]]`. Without this rule you'll often be forced to write very long lines to get
141
+ the desired output. Therefore sometimes you may need to insert an extra new-line
142
+ in such places for a new-line to show up in your output.
143
+
144
+ ## Grammar
145
+
146
+ ```ebnf
147
+ code ::= atomic_code*
148
+ atomic_code ::= $var id = exp
149
+ | $var id = [[ code ]]
150
+ | $range id exp..exp
151
+ | $for id sep [[ code ]]
152
+ | $($)
153
+ | $id
154
+ | $(exp)
155
+ | $if exp [[ code ]] else_branch
156
+ | [[ code ]]
157
+ | cpp_code
158
+ sep ::= cpp_code | empty_string
159
+ else_branch ::= $else [[ code ]]
160
+ | $elif exp [[ code ]] else_branch
161
+ | empty_string
162
+ exp ::= simple_expression_in_Python_syntax
163
+ ```
164
+
165
+ ## Code
166
+
167
+ You can find the source code of Pump in [scripts/pump.py](../scripts/pump.py).
168
+ It is still very unpolished and lacks automated tests, although it has been
169
+ successfully used many times. If you find a chance to use it in your project,
170
+ please let us know what you think! We also welcome help on improving Pump.
171
+
172
+ ## Real Examples
173
+
174
+ You can find real-world applications of Pump in
175
+ [Google Test](https://github.com/google/googletest/tree/master/googletest) and
176
+ [Google Mock](https://github.com/google/googletest/tree/master/googlemock). The
177
+ source file `foo.h.pump` generates `foo.h`.
178
+
179
+ ## Tips
180
+
181
+ * If a meta variable is followed by a letter or digit, you can separate them
182
+ using `[[]]`, which inserts an empty string. For example `Foo$j[[]]Helper`
183
+ generate `Foo1Helper` when `j` is 1.
184
+ * To avoid extra-long Pump source lines, you can break a line anywhere you
185
+ want by inserting `[[]]` followed by a new line. Since any new-line
186
+ character next to `[[` or `]]` is ignored, the generated code won't contain
187
+ this new line.