@react-native-ohos/react-native-mmkv 3.3.1-1

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 (1115) hide show
  1. package/MMKV/Core/CMakeLists.txt +172 -0
  2. package/MMKV/Core/CodedInputData.cpp +252 -0
  3. package/MMKV/Core/CodedInputData.h +87 -0
  4. package/MMKV/Core/CodedInputDataCrypt.cpp +280 -0
  5. package/MMKV/Core/CodedInputDataCrypt.h +87 -0
  6. package/MMKV/Core/CodedInputDataCrypt_OSX.cpp +62 -0
  7. package/MMKV/Core/CodedInputData_OSX.cpp +92 -0
  8. package/MMKV/Core/CodedOutputData.cpp +186 -0
  9. package/MMKV/Core/CodedOutputData.h +88 -0
  10. package/MMKV/Core/Core.xcodeproj/project.pbxproj +707 -0
  11. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  12. package/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  13. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +67 -0
  14. package/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +67 -0
  15. package/MMKV/Core/InterProcessLock.cpp +186 -0
  16. package/MMKV/Core/InterProcessLock.h +119 -0
  17. package/MMKV/Core/InterProcessLock_Android.cpp +103 -0
  18. package/MMKV/Core/InterProcessLock_Win32.cpp +108 -0
  19. package/MMKV/Core/KeyValueHolder.cpp +236 -0
  20. package/MMKV/Core/KeyValueHolder.h +122 -0
  21. package/MMKV/Core/MMBuffer.cpp +210 -0
  22. package/MMKV/Core/MMBuffer.h +111 -0
  23. package/MMKV/Core/MMKV.cpp +1702 -0
  24. package/MMKV/Core/MMKV.h +595 -0
  25. package/MMKV/Core/MMKVLog.cpp +127 -0
  26. package/MMKV/Core/MMKVLog.h +86 -0
  27. package/MMKV/Core/MMKVLog_Android.cpp +134 -0
  28. package/MMKV/Core/MMKVMetaInfo.hpp +99 -0
  29. package/MMKV/Core/MMKVPredef.h +293 -0
  30. package/MMKV/Core/MMKV_Android.cpp +261 -0
  31. package/MMKV/Core/MMKV_IO.cpp +1905 -0
  32. package/MMKV/Core/MMKV_IO.h +57 -0
  33. package/MMKV/Core/MMKV_OSX.cpp +423 -0
  34. package/MMKV/Core/MMKV_OSX.h +57 -0
  35. package/MMKV/Core/MemoryFile.cpp +603 -0
  36. package/MMKV/Core/MemoryFile.h +194 -0
  37. package/MMKV/Core/MemoryFile_Android.cpp +236 -0
  38. package/MMKV/Core/MemoryFile_Linux.cpp +125 -0
  39. package/MMKV/Core/MemoryFile_OSX.cpp +142 -0
  40. package/MMKV/Core/MemoryFile_Win32.cpp +554 -0
  41. package/MMKV/Core/MiniPBCoder.cpp +672 -0
  42. package/MMKV/Core/MiniPBCoder.h +151 -0
  43. package/MMKV/Core/MiniPBCoder_OSX.cpp +237 -0
  44. package/MMKV/Core/PBEncodeItem.hpp +104 -0
  45. package/MMKV/Core/PBUtility.cpp +61 -0
  46. package/MMKV/Core/PBUtility.h +148 -0
  47. package/MMKV/Core/ScopedLock.hpp +69 -0
  48. package/MMKV/Core/ThreadLock.cpp +75 -0
  49. package/MMKV/Core/ThreadLock.h +81 -0
  50. package/MMKV/Core/ThreadLock_Win32.cpp +89 -0
  51. package/MMKV/Core/aes/AESCrypt.cpp +273 -0
  52. package/MMKV/Core/aes/AESCrypt.h +112 -0
  53. package/MMKV/Core/aes/openssl/openssl_aes-armv4.S +1243 -0
  54. package/MMKV/Core/aes/openssl/openssl_aes.h +130 -0
  55. package/MMKV/Core/aes/openssl/openssl_aes_core.cpp +1044 -0
  56. package/MMKV/Core/aes/openssl/openssl_aes_locl.h +38 -0
  57. package/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +308 -0
  58. package/MMKV/Core/aes/openssl/openssl_arm_arch.h +84 -0
  59. package/MMKV/Core/aes/openssl/openssl_cfb128.cpp +97 -0
  60. package/MMKV/Core/aes/openssl/openssl_md32_common.h +254 -0
  61. package/MMKV/Core/aes/openssl/openssl_md5.h +49 -0
  62. package/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +166 -0
  63. package/MMKV/Core/aes/openssl/openssl_md5_locl.h +75 -0
  64. package/MMKV/Core/aes/openssl/openssl_md5_one.cpp +30 -0
  65. package/MMKV/Core/aes/openssl/openssl_opensslconf.h +271 -0
  66. package/MMKV/Core/core.vcxproj +288 -0
  67. package/MMKV/Core/core.vcxproj.filters +150 -0
  68. package/MMKV/Core/crc32/Checksum.h +75 -0
  69. package/MMKV/Core/crc32/crc32_armv8.cpp +134 -0
  70. package/MMKV/Core/crc32/zlib/CMakeLists.txt +60 -0
  71. package/MMKV/Core/crc32/zlib/crc32.cpp +55 -0
  72. package/MMKV/Core/crc32/zlib/crc32.h +48 -0
  73. package/MMKV/Core/crc32/zlib/zconf.h +380 -0
  74. package/MMKV/Core/crc32/zlib/zutil.h +25 -0
  75. package/MMKV/LICENSE.TXT +193 -0
  76. package/MMKV/README.md +354 -0
  77. package/README.md +5 -0
  78. package/cpp/MMKVManagedBuffer.h +32 -0
  79. package/cpp/MmkvHostObject.cpp +355 -0
  80. package/cpp/MmkvHostObject.h +32 -0
  81. package/cpp/MmkvLogger.h +35 -0
  82. package/cpp/NativeMmkvModule.cpp +43 -0
  83. package/cpp/NativeMmkvModule.h +38 -0
  84. package/harmony/reactNativeMMKV/BuildProfile.ets +17 -0
  85. package/harmony/reactNativeMMKV/LICENSE +20 -0
  86. package/harmony/reactNativeMMKV/NOTICE +34 -0
  87. package/harmony/reactNativeMMKV/README.OpenSource +11 -0
  88. package/harmony/reactNativeMMKV/build-profile.json5 +9 -0
  89. package/harmony/reactNativeMMKV/hvigorfile.ts +6 -0
  90. package/harmony/reactNativeMMKV/index.ets +24 -0
  91. package/harmony/reactNativeMMKV/oh-package.json5 +15 -0
  92. package/harmony/reactNativeMMKV/src/main/cpp/CMakeLists.txt +15 -0
  93. package/harmony/reactNativeMMKV/src/main/cpp/ComponentDescriptors.h +39 -0
  94. package/harmony/reactNativeMMKV/src/main/cpp/EventEmitters.cpp +41 -0
  95. package/harmony/reactNativeMMKV/src/main/cpp/EventEmitters.h +182 -0
  96. package/harmony/reactNativeMMKV/src/main/cpp/HarmonyLogger.cpp +32 -0
  97. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.clang-format +36 -0
  98. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.dockerignore +2 -0
  99. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.github/FUNDING.yml +14 -0
  100. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.github/ISSUE_TEMPLATE/bug_report.md +45 -0
  101. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.gitmodules +3 -0
  102. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/build.gradle +54 -0
  103. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/checkstyle.xml +156 -0
  104. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/debug.keystore +0 -0
  105. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/android-publish-private.gradle +207 -0
  106. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/android-publish.gradle +276 -0
  107. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/build_library.gradle +62 -0
  108. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/check.gradle +76 -0
  109. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/wrapper/gradle-wrapper.jar +0 -0
  110. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/wrapper/gradle-wrapper.properties +6 -0
  111. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle.properties +25 -0
  112. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradlew +172 -0
  113. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradlew.bat +84 -0
  114. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/CMakeLists.txt +56 -0
  115. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/build.gradle +238 -0
  116. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/gradle.properties +2 -0
  117. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/proguard-rules.pro +9 -0
  118. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/AndroidManifest.xml +11 -0
  119. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/java/com/tencent/mmkv/MMKVTest.java +270 -0
  120. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/java/com/tencent/mmkv/MMKVTestService.java +79 -0
  121. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/AndroidManifest.xml +3 -0
  122. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/aidl/com/tencent/mmkv/ParcelableMMKV.aidl +4 -0
  123. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/cpp/flutter-bridge.cpp +706 -0
  124. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/cpp/native-bridge.cpp +1244 -0
  125. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKV.java +2024 -0
  126. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVContentChangeNotification.java +34 -0
  127. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVContentProvider.java +174 -0
  128. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVHandler.java +63 -0
  129. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVLogLevel.java +52 -0
  130. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVProcessUtil.java +100 -0
  131. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVRecoverStrategic.java +36 -0
  132. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/NameSpace.java +214 -0
  133. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/NativeBuffer.java +36 -0
  134. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/ParcelableMMKV.java +108 -0
  135. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/UnsupportedArchitectureException.java +27 -0
  136. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/build.gradle +34 -0
  137. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/src/main/AndroidManifest.xml +3 -0
  138. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/src/main/java/dalvik/annotation/optimization/FastNative.java +104 -0
  139. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/build.gradle +116 -0
  140. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/proguard-rules.pro +24 -0
  141. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/AndroidManifest.xml +54 -0
  142. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/aidl/com/tencent/mmkvdemo/IAshmemMMKV.aidl +8 -0
  143. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/cpp/CMakeLists.txt +50 -0
  144. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/cpp/mmkvdemo.cpp +245 -0
  145. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/Baseline.java +297 -0
  146. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/BenchMarkBaseService.java +363 -0
  147. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/FakeInfo.java +67 -0
  148. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/Info.java +69 -0
  149. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MainActivity.java +1029 -0
  150. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MultiProcessSharedPreferences.java +710 -0
  151. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyApplication.java +130 -0
  152. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyService.java +105 -0
  153. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyService_1.java +92 -0
  154. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/SQLiteKV.java +143 -0
  155. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/TestParcelable.java +70 -0
  156. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/kotlin/KotlinUsecase.kt +67 -0
  157. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/drawable/ic_launcher_background.xml +170 -0
  158. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
  159. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/layout/activity_main.xml +76 -0
  160. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  161. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  162. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  163. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  164. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  165. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  166. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  167. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  168. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  169. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  170. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  171. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  172. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/colors.xml +6 -0
  173. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/strings.xml +3 -0
  174. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/styles.xml +11 -0
  175. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/pmd-ruleset.xml +44 -0
  176. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/proguard-rules/proguard-rules-android-lib.pro +54 -0
  177. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/proguard-rules/proguard-rules-test.pro +6 -0
  178. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/settings.gradle +3 -0
  179. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CHANGELOG.md +979 -0
  180. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CODE_OF_CONDUCT.md +76 -0
  181. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CONTRIBUTING.md +61 -0
  182. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CMakeLists.txt +207 -0
  183. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData.cpp +248 -0
  184. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData.h +86 -0
  185. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt.cpp +276 -0
  186. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt.h +86 -0
  187. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt_OSX.cpp +62 -0
  188. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData_OSX.cpp +92 -0
  189. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedOutputData.cpp +182 -0
  190. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedOutputData.h +86 -0
  191. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.pbxproj +703 -0
  192. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  193. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  194. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +67 -0
  195. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +67 -0
  196. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock.cpp +211 -0
  197. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock.h +124 -0
  198. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock_Android.cpp +104 -0
  199. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock_Win32.cpp +108 -0
  200. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/KeyValueHolder.cpp +237 -0
  201. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/KeyValueHolder.h +122 -0
  202. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMBuffer.cpp +207 -0
  203. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMBuffer.h +119 -0
  204. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV.cpp +1791 -0
  205. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV.h +781 -0
  206. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog.cpp +127 -0
  207. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog.h +86 -0
  208. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog_Android.cpp +134 -0
  209. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVMetaInfo.hpp +99 -0
  210. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVPredef.h +310 -0
  211. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_Android.cpp +365 -0
  212. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_IO.cpp +2049 -0
  213. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_IO.h +85 -0
  214. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_OSX.cpp +589 -0
  215. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_OSX.h +30 -0
  216. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile.cpp +716 -0
  217. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile.h +212 -0
  218. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Android.cpp +247 -0
  219. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Linux.cpp +126 -0
  220. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_OSX.cpp +173 -0
  221. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Win32.cpp +655 -0
  222. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder.cpp +668 -0
  223. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder.h +150 -0
  224. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder_OSX.cpp +237 -0
  225. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBEncodeItem.hpp +102 -0
  226. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBUtility.cpp +61 -0
  227. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBUtility.h +148 -0
  228. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ScopedLock.hpp +69 -0
  229. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock.cpp +75 -0
  230. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock.h +81 -0
  231. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock_Win32.cpp +89 -0
  232. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/AESCrypt.cpp +293 -0
  233. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/AESCrypt.h +117 -0
  234. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes.h +98 -0
  235. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes_core.cpp +1044 -0
  236. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes_locl.h +38 -0
  237. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +308 -0
  238. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_arm_arch.h +84 -0
  239. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_cfb128.cpp +97 -0
  240. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md32_common.h +254 -0
  241. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5.h +49 -0
  242. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +166 -0
  243. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_locl.h +75 -0
  244. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_one.cpp +30 -0
  245. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_opensslconf.h +271 -0
  246. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/core.vcxproj +288 -0
  247. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/core.vcxproj.filters +150 -0
  248. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/CMakeLists.txt +60 -0
  249. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/Checksum.h +76 -0
  250. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/crc32_armv8.cpp +134 -0
  251. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/crc32.cpp +55 -0
  252. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/crc32.h +48 -0
  253. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/zconf.h +380 -0
  254. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/zutil.h +25 -0
  255. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Dockerfile +25 -0
  256. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/LICENSE.TXT +193 -0
  257. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.podspec +40 -0
  258. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.xcworkspace/contents.xcworkspacedata +10 -0
  259. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  260. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVAppExtension.podspec +37 -0
  261. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVCore.podspec +47 -0
  262. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVWatchExtension.podspec +38 -0
  263. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Makefile +10 -0
  264. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/app.json5 +10 -0
  265. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/resources/base/element/string.json +8 -0
  266. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/resources/base/media/app_icon.png +0 -0
  267. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/BuildProfile.ets +17 -0
  268. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/CHANGELOG.md +75 -0
  269. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/Index.ets +4 -0
  270. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/LICENSE +193 -0
  271. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/README.md +208 -0
  272. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/build-profile.json5 +40 -0
  273. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/consumer-rules.txt +61 -0
  274. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/example/Index.ets +686 -0
  275. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/example/Util.ets +31 -0
  276. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/hvigorfile.ts +6 -0
  277. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/obfuscation-rules.txt +18 -0
  278. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/oh-package.json5 +22 -0
  279. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/CMakeLists.txt +43 -0
  280. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/flutter-bridge.cpp +703 -0
  281. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/native_bridge.cpp +1840 -0
  282. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/types/libmmkv/index.d.ts +80 -0
  283. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/types/libmmkv/oh-package.json5 +6 -0
  284. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKV.ets +1073 -0
  285. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKVHandler.ets +111 -0
  286. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKVLogLevel.ets +50 -0
  287. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/NativeBuffer.ets +34 -0
  288. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/Util.ts +24 -0
  289. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/module.json5 +12 -0
  290. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/build-profile.json5 +62 -0
  291. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/dependencies/hvigor-4.3.0.tgz +0 -0
  292. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/dependencies/hvigor-ohos-plugin-4.3.0.tgz +0 -0
  293. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/build-profile.json5 +39 -0
  294. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/hvigorfile.ts +6 -0
  295. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/obfuscation-rules.txt +25 -0
  296. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/oh-package.json5 +13 -0
  297. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/CMakeLists.txt +54 -0
  298. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/napi_init.cpp +233 -0
  299. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/types/libentry/index.d.ts +1 -0
  300. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/types/libentry/oh-package.json5 +6 -0
  301. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/Baseline.ets +188 -0
  302. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/MyMMKVHandler.ets +76 -0
  303. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/Util.ets +220 -0
  304. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/entryability/EntryAbility.ets +107 -0
  305. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/pages/Index.ets +766 -0
  306. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/process/DemoProcess.ets +31 -0
  307. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/module.json5 +38 -0
  308. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/element/color.json +8 -0
  309. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/element/string.json +16 -0
  310. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/background.png +0 -0
  311. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/foreground.png +0 -0
  312. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/layered_image.json +7 -0
  313. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/startIcon.png +0 -0
  314. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
  315. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/en_US/element/string.json +16 -0
  316. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/zh_CN/element/string.json +16 -0
  317. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/mock/mock-config.json5 +2 -0
  318. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/test/Ability.test.ets +55 -0
  319. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/test/List.test.ets +25 -0
  320. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testability/TestAbility.ets +67 -0
  321. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testability/pages/Index.ets +37 -0
  322. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +110 -0
  323. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/module.json5 +38 -0
  324. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/element/color.json +8 -0
  325. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/element/string.json +16 -0
  326. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/media/icon.png +0 -0
  327. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/profile/test_pages.json +5 -0
  328. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/test/List.test.ets +25 -0
  329. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/test/LocalUnit.test.ets +53 -0
  330. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/hvigor/hvigor-config.json5 +21 -0
  331. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/hvigorfile.ts +6 -0
  332. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/oh-package.json5 +15 -0
  333. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/CMakeLists.txt +27 -0
  334. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/CMakeLists.txt +65 -0
  335. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/TestInterProcessLock.cpp +130 -0
  336. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/UnitTest.cpp +272 -0
  337. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/demo.cpp +1431 -0
  338. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/process.cpp +78 -0
  339. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/CMakeLists.txt +87 -0
  340. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/callback.go +121 -0
  341. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/go.mod +3 -0
  342. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/golang-bridge.cpp +731 -0
  343. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/golang-bridge.h +131 -0
  344. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/mmkv.go +817 -0
  345. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/mmkv_test.go +33 -0
  346. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/test/go.mod +7 -0
  347. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/test/main.go +455 -0
  348. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/src/CMakeLists.txt +83 -0
  349. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/src/libmmkv.cpp +21 -0
  350. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/CMakeLists.txt +62 -0
  351. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/README.md +6 -0
  352. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/demo.py +368 -0
  353. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/libmmkv_python.cpp +454 -0
  354. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.appveyor.yml +35 -0
  355. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.clang-format +38 -0
  356. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.clang-tidy +77 -0
  357. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.cmake-format.yaml +73 -0
  358. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.codespell-ignore-lines +24 -0
  359. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.gitattributes +1 -0
  360. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/CODEOWNERS +9 -0
  361. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/CONTRIBUTING.md +388 -0
  362. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +61 -0
  363. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/ISSUE_TEMPLATE/config.yml +8 -0
  364. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/dependabot.yml +15 -0
  365. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/labeler.yml +13 -0
  366. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/labeler_merged.yml +8 -0
  367. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/matchers/pylint.json +32 -0
  368. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/pull_request_template.md +19 -0
  369. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/ci.yml +1233 -0
  370. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/configure.yml +92 -0
  371. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/format.yml +60 -0
  372. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/labeler.yml +25 -0
  373. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/pip.yml +117 -0
  374. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/upstream.yml +116 -0
  375. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.pre-commit-config.yaml +156 -0
  376. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.readthedocs.yml +20 -0
  377. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/CMakeLists.txt +375 -0
  378. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/LICENSE +29 -0
  379. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/MANIFEST.in +6 -0
  380. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/README.rst +181 -0
  381. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/SECURITY.md +13 -0
  382. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/Doxyfile +21 -0
  383. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/_static/css/custom.css +3 -0
  384. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/chrono.rst +81 -0
  385. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/custom.rst +93 -0
  386. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/eigen.rst +310 -0
  387. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/functional.rst +109 -0
  388. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/index.rst +43 -0
  389. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/overview.rst +170 -0
  390. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/stl.rst +249 -0
  391. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/strings.rst +296 -0
  392. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/classes.rst +1335 -0
  393. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/embedding.rst +262 -0
  394. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/exceptions.rst +401 -0
  395. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/functions.rst +614 -0
  396. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/misc.rst +429 -0
  397. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/index.rst +13 -0
  398. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/numpy.rst +453 -0
  399. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/object.rst +286 -0
  400. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/utilities.rst +155 -0
  401. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/smart_ptrs.rst +174 -0
  402. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/basics.rst +307 -0
  403. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/benchmark.py +89 -0
  404. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/benchmark.rst +95 -0
  405. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/changelog.rst +3121 -0
  406. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/classes.rst +555 -0
  407. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/cmake/index.rst +8 -0
  408. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/compiling.rst +726 -0
  409. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/conf.py +369 -0
  410. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/faq.rst +308 -0
  411. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/index.rst +48 -0
  412. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/installing.rst +105 -0
  413. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/limitations.rst +72 -0
  414. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11-logo.png +0 -0
  415. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  416. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python1.svg +427 -0
  417. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  418. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python2.svg +427 -0
  419. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/reference.rst +130 -0
  420. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/release.rst +143 -0
  421. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/requirements.in +6 -0
  422. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/requirements.txt +275 -0
  423. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/upgrade.rst +594 -0
  424. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/attr.h +690 -0
  425. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/buffer_info.h +208 -0
  426. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/cast.h +1848 -0
  427. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/chrono.h +225 -0
  428. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/common.h +2 -0
  429. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/complex.h +74 -0
  430. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/class.h +754 -0
  431. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/common.h +1268 -0
  432. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/descr.h +172 -0
  433. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/init.h +434 -0
  434. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/internals.h +749 -0
  435. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/type_caster_base.h +1214 -0
  436. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/typeid.h +65 -0
  437. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/common.h +9 -0
  438. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/matrix.h +714 -0
  439. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/tensor.h +517 -0
  440. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen.h +12 -0
  441. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/embed.h +313 -0
  442. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eval.h +156 -0
  443. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/functional.h +138 -0
  444. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/gil.h +219 -0
  445. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/gil_safe_call_once.h +91 -0
  446. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/iostream.h +265 -0
  447. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/numpy.h +2135 -0
  448. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/operators.h +202 -0
  449. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/options.h +92 -0
  450. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/pybind11.h +3026 -0
  451. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/pytypes.h +2604 -0
  452. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl/filesystem.h +115 -0
  453. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl.h +448 -0
  454. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl_bind.h +822 -0
  455. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/type_caster_pyobject_ptr.h +61 -0
  456. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/typing.h +239 -0
  457. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/noxfile.py +107 -0
  458. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/__init__.py +19 -0
  459. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/__main__.py +63 -0
  460. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/_version.py +12 -0
  461. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/commands.py +39 -0
  462. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/py.typed +0 -0
  463. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/setup_helpers.py +500 -0
  464. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pyproject.toml +87 -0
  465. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/setup.cfg +43 -0
  466. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/setup.py +149 -0
  467. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/CMakeLists.txt +589 -0
  468. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/conftest.py +224 -0
  469. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/constructor_stats.h +322 -0
  470. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/cross_module_gil_utils.cpp +111 -0
  471. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/cross_module_interleaved_error_already_set.cpp +54 -0
  472. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/eigen_tensor_avoid_stl_array.cpp +16 -0
  473. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/env.py +31 -0
  474. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_python_package/pytest.ini +0 -0
  475. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_python_package/test_files.py +296 -0
  476. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  477. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_setuptools/test_setuphelper.py +153 -0
  478. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/local_bindings.h +92 -0
  479. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/object.h +205 -0
  480. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_cross_module_tests.cpp +149 -0
  481. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_tests.cpp +131 -0
  482. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_tests.h +98 -0
  483. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pytest.ini +23 -0
  484. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/requirements.txt +13 -0
  485. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_async.cpp +25 -0
  486. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_async.py +26 -0
  487. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_buffers.cpp +259 -0
  488. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_buffers.py +230 -0
  489. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_builtin_casters.cpp +387 -0
  490. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_builtin_casters.py +530 -0
  491. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_call_policies.cpp +113 -0
  492. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_call_policies.py +249 -0
  493. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_callbacks.cpp +280 -0
  494. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_callbacks.py +227 -0
  495. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_chrono.cpp +81 -0
  496. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_chrono.py +207 -0
  497. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_class.cpp +656 -0
  498. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_class.py +503 -0
  499. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/CMakeLists.txt +80 -0
  500. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/embed.cpp +23 -0
  501. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +28 -0
  502. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +39 -0
  503. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +46 -0
  504. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/main.cpp +6 -0
  505. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +47 -0
  506. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +41 -0
  507. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +47 -0
  508. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/test.py +10 -0
  509. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_const_name.cpp +55 -0
  510. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_const_name.py +31 -0
  511. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_constants_and_functions.cpp +158 -0
  512. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_constants_and_functions.py +58 -0
  513. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_copy_move.cpp +544 -0
  514. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_copy_move.py +140 -0
  515. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_casters.cpp +217 -0
  516. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_casters.py +124 -0
  517. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_setup.cpp +41 -0
  518. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_setup.py +50 -0
  519. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_docstring_options.cpp +129 -0
  520. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_docstring_options.py +66 -0
  521. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_matrix.cpp +443 -0
  522. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_matrix.py +816 -0
  523. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.cpp +18 -0
  524. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.inl +332 -0
  525. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.py +290 -0
  526. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/CMakeLists.txt +54 -0
  527. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/catch.cpp +43 -0
  528. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/external_module.cpp +20 -0
  529. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_interpreter.cpp +488 -0
  530. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_interpreter.py +16 -0
  531. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_trampoline.py +18 -0
  532. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_enum.cpp +133 -0
  533. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_enum.py +270 -0
  534. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval.cpp +118 -0
  535. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval.py +52 -0
  536. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval_call.py +5 -0
  537. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.cpp +388 -0
  538. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.h +13 -0
  539. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.py +434 -0
  540. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_factory_constructors.cpp +430 -0
  541. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_factory_constructors.py +518 -0
  542. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_gil_scoped.cpp +144 -0
  543. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_gil_scoped.py +244 -0
  544. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_iostream.cpp +126 -0
  545. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_iostream.py +293 -0
  546. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_kwargs_and_defaults.cpp +325 -0
  547. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_kwargs_and_defaults.py +428 -0
  548. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_local_bindings.cpp +106 -0
  549. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_local_bindings.py +259 -0
  550. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_methods_and_attributes.cpp +492 -0
  551. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_methods_and_attributes.py +539 -0
  552. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_modules.cpp +125 -0
  553. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_modules.py +118 -0
  554. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_multiple_inheritance.cpp +341 -0
  555. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_multiple_inheritance.py +495 -0
  556. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_array.cpp +547 -0
  557. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_array.py +672 -0
  558. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_dtypes.cpp +639 -0
  559. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_dtypes.py +448 -0
  560. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_vectorize.cpp +107 -0
  561. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_vectorize.py +268 -0
  562. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_opaque_types.cpp +77 -0
  563. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_opaque_types.py +60 -0
  564. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_operator_overloading.cpp +281 -0
  565. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_operator_overloading.py +153 -0
  566. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pickling.cpp +194 -0
  567. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pickling.py +95 -0
  568. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_python_multiple_inheritance.cpp +45 -0
  569. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_python_multiple_inheritance.py +36 -0
  570. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pytypes.cpp +926 -0
  571. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pytypes.py +1050 -0
  572. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_sequences_and_iterators.cpp +600 -0
  573. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_sequences_and_iterators.py +267 -0
  574. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_smart_ptr.cpp +473 -0
  575. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_smart_ptr.py +317 -0
  576. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl.cpp +549 -0
  577. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl.py +383 -0
  578. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl_binders.cpp +275 -0
  579. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl_binders.py +395 -0
  580. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_tagbased_polymorphic.cpp +147 -0
  581. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_tagbased_polymorphic.py +30 -0
  582. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_thread.cpp +66 -0
  583. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_thread.py +44 -0
  584. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_type_caster_pyobject_ptr.cpp +167 -0
  585. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_type_caster_pyobject_ptr.py +122 -0
  586. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_union.cpp +22 -0
  587. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_union.py +10 -0
  588. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_a.cpp +38 -0
  589. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_a.py +36 -0
  590. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_b.cpp +13 -0
  591. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_b.py +7 -0
  592. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_vector_unique_ptr_member.cpp +54 -0
  593. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_vector_unique_ptr_member.py +16 -0
  594. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_virtual_functions.cpp +592 -0
  595. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_virtual_functions.py +460 -0
  596. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/valgrind-numpy-scipy.supp +140 -0
  597. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/valgrind-python.supp +117 -0
  598. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindCatch.cmake +76 -0
  599. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindEigen3.cmake +86 -0
  600. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindPythonLibsNew.cmake +310 -0
  601. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/JoinPaths.cmake +23 -0
  602. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/check-style.sh +44 -0
  603. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/cmake_uninstall.cmake.in +23 -0
  604. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/codespell_ignore_lines_from_errors.py +40 -0
  605. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/libsize.py +38 -0
  606. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/make_changelog.py +92 -0
  607. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11.pc.in +7 -0
  608. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Common.cmake +429 -0
  609. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Config.cmake.in +233 -0
  610. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11GuessPythonExtSuffix.cmake +86 -0
  611. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11NewTools.cmake +341 -0
  612. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Tools.cmake +239 -0
  613. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pyproject.toml +3 -0
  614. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/setup_global.py.in +63 -0
  615. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/setup_main.py.in +44 -0
  616. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/test-pybind11GuessPythonExtSuffix.cmake +161 -0
  617. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/setup.py +76 -0
  618. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/unit_test.py +209 -0
  619. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/README.md +357 -0
  620. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/README_CN.md +301 -0
  621. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/SECURITY.md +15 -0
  622. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Script/dumpJavaSignature.py +144 -0
  623. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Script/formatCode.py +17 -0
  624. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/.clang-format +35 -0
  625. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32.sln +58 -0
  626. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.cpp +548 -0
  627. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.vcxproj +190 -0
  628. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.vcxproj.filters +30 -0
  629. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/pch.cpp +23 -0
  630. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/pch.h +28 -0
  631. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.cpp +88 -0
  632. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.vcxproj +188 -0
  633. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.vcxproj.filters +30 -0
  634. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/pch.cpp +21 -0
  635. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/pch.h +24 -0
  636. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.metadata +10 -0
  637. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.vscode/launch.json +162 -0
  638. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.vscode/settings.json +12 -0
  639. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/CHANGELOG.md +196 -0
  640. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/LICENSE +193 -0
  641. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/README.md +217 -0
  642. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/analysis_options.yaml +49 -0
  643. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/README.md +16 -0
  644. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/build.gradle +79 -0
  645. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/AndroidManifest.xml +41 -0
  646. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/java/com/tencent/mmkv_example/MainActivity.java +25 -0
  647. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/drawable/launch_background.xml +12 -0
  648. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  649. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  650. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  651. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  652. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  653. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/values/styles.xml +18 -0
  654. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/profile/AndroidManifest.xml +7 -0
  655. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/build.gradle +29 -0
  656. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  657. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/gradle.properties +4 -0
  658. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/settings.gradle +25 -0
  659. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/settings_aar.gradle +1 -0
  660. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/AppFrameworkInfo.plist +26 -0
  661. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/Debug.xcconfig +2 -0
  662. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/Release.xcconfig +2 -0
  663. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/ephemeral/flutter_lldb_helper.py +32 -0
  664. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/ephemeral/flutter_lldbinit +5 -0
  665. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Podfile +49 -0
  666. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/AppDelegate.h +26 -0
  667. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/AppDelegate.m +33 -0
  668. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
  669. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
  670. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
  671. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
  672. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
  673. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
  674. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
  675. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
  676. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
  677. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
  678. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
  679. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
  680. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
  681. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
  682. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
  683. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
  684. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
  685. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
  686. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
  687. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
  688. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
  689. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
  690. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Base.lproj/Main.storyboard +29 -0
  691. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Info.plist +49 -0
  692. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Runner.entitlements +10 -0
  693. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/main.m +29 -0
  694. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.pbxproj +612 -0
  695. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  696. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  697. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  698. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +90 -0
  699. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  700. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  701. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  702. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/lib/main.dart +565 -0
  703. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/CMakeLists.txt +128 -0
  704. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/CMakeLists.txt +88 -0
  705. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugin_registrant.cc +15 -0
  706. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugin_registrant.h +15 -0
  707. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugins.cmake +24 -0
  708. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/CMakeLists.txt +26 -0
  709. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/main.cc +6 -0
  710. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/my_application.cc +130 -0
  711. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/my_application.h +18 -0
  712. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/Flutter-Debug.xcconfig +2 -0
  713. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/Flutter-Release.xcconfig +2 -0
  714. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/GeneratedPluginRegistrant.swift +14 -0
  715. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Podfile +47 -0
  716. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/AppDelegate.swift +13 -0
  717. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  718. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
  719. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
  720. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
  721. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
  722. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
  723. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
  724. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
  725. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Base.lproj/MainMenu.xib +343 -0
  726. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/AppInfo.xcconfig +14 -0
  727. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Debug.xcconfig +2 -0
  728. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Release.xcconfig +2 -0
  729. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Warnings.xcconfig +13 -0
  730. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/DebugProfile.entitlements +12 -0
  731. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Info.plist +32 -0
  732. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/MainFlutterWindow.swift +15 -0
  733. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Release.entitlements +8 -0
  734. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/project.pbxproj +800 -0
  735. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  736. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +99 -0
  737. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  738. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  739. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
  740. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/RunnerTests/RunnerTests.swift +12 -0
  741. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/app.json5 +10 -0
  742. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/resources/base/element/string.json +8 -0
  743. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/resources/base/media/app_icon.png +0 -0
  744. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/build-profile.json5 +41 -0
  745. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/build-profile.json5 +34 -0
  746. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/hvigorfile.ts +17 -0
  747. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/oh-package.json5 +13 -0
  748. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/entryability/EntryAbility.ets +36 -0
  749. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/pages/Index.ets +38 -0
  750. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/plugins/GeneratedPluginRegistrant.ets +28 -0
  751. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/module.json5 +53 -0
  752. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/element/color.json +8 -0
  753. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/element/string.json +16 -0
  754. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/media/icon.png +0 -0
  755. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/profile/main_pages.json +5 -0
  756. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/en_US/element/string.json +16 -0
  757. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/zh_CN/element/string.json +16 -0
  758. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/test/Ability.test.ets +50 -0
  759. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/test/List.test.ets +20 -0
  760. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets +63 -0
  761. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets +49 -0
  762. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +64 -0
  763. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/module.json5 +51 -0
  764. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/element/color.json +8 -0
  765. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/element/string.json +16 -0
  766. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/media/icon.png +0 -0
  767. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/profile/test_pages.json +5 -0
  768. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/hvigor/hvigor-config.json5 +20 -0
  769. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/hvigorfile.ts +21 -0
  770. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/oh-package.json5 +21 -0
  771. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/pubspec.yaml +75 -0
  772. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/CMakeLists.txt +108 -0
  773. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/CMakeLists.txt +109 -0
  774. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugin_registrant.cc +14 -0
  775. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugin_registrant.h +15 -0
  776. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugins.cmake +24 -0
  777. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/CMakeLists.txt +40 -0
  778. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/Runner.rc +121 -0
  779. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/flutter_window.cpp +71 -0
  780. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/flutter_window.h +33 -0
  781. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/main.cpp +43 -0
  782. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/resource.h +16 -0
  783. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/resources/app_icon.ico +0 -0
  784. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/runner.exe.manifest +14 -0
  785. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/utils.cpp +65 -0
  786. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/utils.h +19 -0
  787. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/win32_window.cpp +288 -0
  788. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/win32_window.h +102 -0
  789. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/lib/mmkv.dart +1052 -0
  790. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/mmkv.iml +17 -0
  791. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/pubspec.yaml +62 -0
  792. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/test/mmkv_test.dart +48 -0
  793. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/tool/fix_mmkv_plugin_name.rb +4 -0
  794. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/tool/mmkvpodhelper.rb +23 -0
  795. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv.iml +25 -0
  796. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/CHANGELOG.md +48 -0
  797. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/LICENSE +193 -0
  798. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/README.md +17 -0
  799. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/build.gradle +39 -0
  800. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  801. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  802. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle.properties +4 -0
  803. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradlew +160 -0
  804. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradlew.bat +90 -0
  805. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/settings.gradle +1 -0
  806. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/src/main/AndroidManifest.xml +1 -0
  807. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/src/main/java/com/tencent/mmkv/MMKVPlugin.java +82 -0
  808. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/lib/mmkv_android.dart +76 -0
  809. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/pubspec.yaml +40 -0
  810. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/.metadata +33 -0
  811. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/CHANGELOG.md +52 -0
  812. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/LICENSE +193 -0
  813. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/README.md +17 -0
  814. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/MMKVPlugin.h +28 -0
  815. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/MMKVPlugin.mm +39 -0
  816. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/flutter-bridge.h +32 -0
  817. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/flutter-bridge.mm +693 -0
  818. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/mmkv_ios.podspec +35 -0
  819. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/lib/mmkv_ios.dart +78 -0
  820. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/pubspec.yaml +44 -0
  821. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/.metadata +30 -0
  822. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/CHANGELOG.md +9 -0
  823. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/LICENSE +193 -0
  824. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/README.md +17 -0
  825. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/analysis_options.yaml +4 -0
  826. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/lib/mmkv_linux.dart +69 -0
  827. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/CMakeLists.txt +63 -0
  828. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/flutter-bridge.cpp +694 -0
  829. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/include/mmkv_linux/mmkv_linux_plugin.h +46 -0
  830. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/mmkv_linux_plugin.cc +97 -0
  831. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/pubspec.yaml +47 -0
  832. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/.metadata +30 -0
  833. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/CHANGELOG.md +42 -0
  834. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/LICENSE +193 -0
  835. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/README.md +17 -0
  836. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/analysis_options.yaml +4 -0
  837. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/lib/mmkv_ohos.dart +84 -0
  838. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/build-profile.json5 +10 -0
  839. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/hvigorfile.ts +2 -0
  840. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/index.ets +17 -0
  841. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/oh-package.json5 +15 -0
  842. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/src/main/ets/components/plugin/MMKVPlugin.ets +78 -0
  843. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/src/main/module.json5 +10 -0
  844. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/pubspec.yaml +50 -0
  845. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/CHANGELOG.md +38 -0
  846. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/LICENSE +193 -0
  847. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/README.md +30 -0
  848. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/lib/mmkv_platform_ffi.dart +363 -0
  849. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/lib/mmkv_platform_interface.dart +363 -0
  850. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/pubspec.yaml +23 -0
  851. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/.metadata +30 -0
  852. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/CHANGELOG.md +9 -0
  853. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/LICENSE +193 -0
  854. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/README.md +17 -0
  855. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/analysis_options.yaml +4 -0
  856. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/lib/mmkv_win32.dart +69 -0
  857. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/pubspec.yaml +47 -0
  858. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/CMakeLists.txt +71 -0
  859. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/flutter-bridge.cpp +721 -0
  860. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/include/mmkv_win32/mmkv_win32_plugin.h +43 -0
  861. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/mmkv_win32_plugin.cpp +88 -0
  862. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/AutoCleanInfo.hpp +65 -0
  863. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/MMKV.h +552 -0
  864. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/MMKVHandler.h +60 -0
  865. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/Resources/Info.plist +24 -0
  866. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/libMMKV.mm +1361 -0
  867. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.pbxproj +967 -0
  868. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  869. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  870. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV For App Extension.xcscheme +67 -0
  871. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV Static.xcscheme +76 -0
  872. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV.xcscheme +76 -0
  873. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKVWatchExtension.xcscheme +67 -0
  874. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/Config.xcconfig +10 -0
  875. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/AppDelegate.h +15 -0
  876. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/AppDelegate.m +43 -0
  877. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  878. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +13 -0
  879. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/Contents.json +6 -0
  880. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Base.lproj/LaunchScreen.storyboard +25 -0
  881. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Base.lproj/Main.storyboard +42 -0
  882. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Info.plist +25 -0
  883. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/MMKVCatalystDemo.entitlements +12 -0
  884. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/SceneDelegate.h +16 -0
  885. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/SceneDelegate.m +58 -0
  886. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/ViewController.h +15 -0
  887. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/ViewController.mm +85 -0
  888. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/main.m +19 -0
  889. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/AppDelegate.h +27 -0
  890. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/AppDelegate.m +135 -0
  891. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/DemoSwiftUsage.swift +82 -0
  892. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/MMKVDemo-Bridging-Header.h +22 -0
  893. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
  894. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Base.lproj/LaunchScreen.storyboard +25 -0
  895. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Base.lproj/Main.storyboard +48 -0
  896. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Info.plist +49 -0
  897. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/MMKVDemo.entitlements +10 -0
  898. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/testReadOnly +0 -0
  899. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/testReadOnly.crc +0 -0
  900. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/TestMMKVCpp.cpp +204 -0
  901. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/TestMMKVCpp.hpp +18 -0
  902. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController+TestCaseBad.h +39 -0
  903. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController+TestCaseBad.mm +200 -0
  904. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController.h +32 -0
  905. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController.mm +1245 -0
  906. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/main.m +28 -0
  907. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.pbxproj +1944 -0
  908. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  909. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  910. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  911. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVDemo.xcscheme +88 -0
  912. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVMacDemo.xcscheme +78 -0
  913. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVTodayExtensionDemo.xcscheme +116 -0
  914. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme +106 -0
  915. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme +102 -0
  916. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/kvdemo.xcscheme +78 -0
  917. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/Info.plist +22 -0
  918. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/MMKVDemoTests.mm +554 -0
  919. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/MMKVPerformanceTest.mm +118 -0
  920. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/AppDelegate.h +13 -0
  921. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/AppDelegate.m +27 -0
  922. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
  923. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Assets.xcassets/Contents.json +6 -0
  924. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Base.lproj/Main.storyboard +718 -0
  925. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Info.plist +32 -0
  926. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/MMKVMacDemo.entitlements +10 -0
  927. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/ViewController.h +13 -0
  928. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/ViewController.mm +352 -0
  929. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/main.m +15 -0
  930. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/Base.lproj/MainInterface.storyboard +45 -0
  931. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/Info.plist +31 -0
  932. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/MMKVTodayExtensionDemo.entitlements +10 -0
  933. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/TodayViewController.h +25 -0
  934. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/TodayViewController.m +106 -0
  935. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json +12 -0
  936. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json +6 -0
  937. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Contents.json +17 -0
  938. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json +12 -0
  939. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json +6 -0
  940. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json +12 -0
  941. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json +6 -0
  942. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/Contents.json +6 -0
  943. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/ContentView.swift +71 -0
  944. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Info.plist +15 -0
  945. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/MMKVVisionDemoApp.swift +22 -0
  946. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
  947. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json +81 -0
  948. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Assets.xcassets/Contents.json +6 -0
  949. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Base.lproj/Interface.storyboard +47 -0
  950. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Info.plist +33 -0
  951. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json +28 -0
  952. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Contents.json +48 -0
  953. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json +28 -0
  954. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json +28 -0
  955. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json +28 -0
  956. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json +28 -0
  957. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json +28 -0
  958. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json +28 -0
  959. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json +28 -0
  960. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Contents.json +6 -0
  961. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/ExtensionDelegate.h +25 -0
  962. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/ExtensionDelegate.mm +135 -0
  963. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Info.plist +36 -0
  964. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/InterfaceController.h +26 -0
  965. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/InterfaceController.m +50 -0
  966. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/NotificationController.h +26 -0
  967. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/NotificationController.m +60 -0
  968. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/PushNotificationPayload.apns +20 -0
  969. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/AppDelegate.h +15 -0
  970. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/AppDelegate.m +49 -0
  971. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  972. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/AppIcon.appiconset/Contents.json +13 -0
  973. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/Contents.json +6 -0
  974. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Base.lproj/LaunchScreen.storyboard +25 -0
  975. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Base.lproj/Main.storyboard +45 -0
  976. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Info.plist +25 -0
  977. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/SceneDelegate.h +16 -0
  978. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/SceneDelegate.m +58 -0
  979. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/ViewController.h +15 -0
  980. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/ViewController.m +38 -0
  981. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/kvdemo.entitlements +10 -0
  982. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/main.m +19 -0
  983. package/harmony/reactNativeMMKV/src/main/cpp/MMKVManagedBuffer.h +49 -0
  984. package/harmony/reactNativeMMKV/src/main/cpp/MmkvCxx.cpp +152 -0
  985. package/harmony/reactNativeMMKV/src/main/cpp/MmkvCxx.h +36 -0
  986. package/harmony/reactNativeMMKV/src/main/cpp/MmkvHostObject.cpp +357 -0
  987. package/harmony/reactNativeMMKV/src/main/cpp/MmkvHostObject.h +66 -0
  988. package/harmony/reactNativeMMKV/src/main/cpp/MmkvLogger.h +52 -0
  989. package/harmony/reactNativeMMKV/src/main/cpp/MmkvPlatformContext.cpp +37 -0
  990. package/harmony/reactNativeMMKV/src/main/cpp/MmkvPlatformContext.h +36 -0
  991. package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVComponentDescriptor.h +65 -0
  992. package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVJSIBinder.h +55 -0
  993. package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVPackage.h +67 -0
  994. package/harmony/reactNativeMMKV/src/main/cpp/Props.cpp +37 -0
  995. package/harmony/reactNativeMMKV/src/main/cpp/Props.h +42 -0
  996. package/harmony/reactNativeMMKV/src/main/cpp/ShadowNodes.cpp +39 -0
  997. package/harmony/reactNativeMMKV/src/main/cpp/ShadowNodes.h +41 -0
  998. package/harmony/reactNativeMMKV/src/main/cpp/States.cpp +40 -0
  999. package/harmony/reactNativeMMKV/src/main/cpp/States.h +45 -0
  1000. package/harmony/reactNativeMMKV/src/main/ets/Logger.ts +65 -0
  1001. package/harmony/reactNativeMMKV/src/main/ets/MmkvCxxPackage.ts +46 -0
  1002. package/harmony/reactNativeMMKV/src/main/ets/MmkvCxxTurboModule.ts +60 -0
  1003. package/harmony/reactNativeMMKV/src/main/ets/MmkvPlatformContextPackage.ts +46 -0
  1004. package/harmony/reactNativeMMKV/src/main/ets/MmkvPlatformContextTurboModule.ts +48 -0
  1005. package/harmony/reactNativeMMKV/src/main/module.json5 +7 -0
  1006. package/harmony/reactNativeMMKV/src/main/resources/base/element/string.json +8 -0
  1007. package/harmony/reactNativeMMKV/src/main/resources/en_US/element/string.json +8 -0
  1008. package/harmony/reactNativeMMKV/src/main/resources/zh_CN/element/string.json +8 -0
  1009. package/harmony/reactNativeMMKV/ts.ts +27 -0
  1010. package/harmony/reactNativeMMKV.har +0 -0
  1011. package/lib/commonjs/MMKV.js +124 -0
  1012. package/lib/commonjs/MMKV.js.map +1 -0
  1013. package/lib/commonjs/MemoryWarningListener.js +31 -0
  1014. package/lib/commonjs/MemoryWarningListener.js.map +1 -0
  1015. package/lib/commonjs/MemoryWarningListener.web.js +11 -0
  1016. package/lib/commonjs/MemoryWarningListener.web.js.map +1 -0
  1017. package/lib/commonjs/ModuleNotFoundError.js +75 -0
  1018. package/lib/commonjs/ModuleNotFoundError.js.map +1 -0
  1019. package/lib/commonjs/NativeMmkv.js +53 -0
  1020. package/lib/commonjs/NativeMmkv.js.map +1 -0
  1021. package/lib/commonjs/NativeMmkvPlatformContext.js +22 -0
  1022. package/lib/commonjs/NativeMmkvPlatformContext.js.map +1 -0
  1023. package/lib/commonjs/PlatformChecker.js +14 -0
  1024. package/lib/commonjs/PlatformChecker.js.map +1 -0
  1025. package/lib/commonjs/Types.js +32 -0
  1026. package/lib/commonjs/Types.js.map +1 -0
  1027. package/lib/commonjs/createMMKV.js +43 -0
  1028. package/lib/commonjs/createMMKV.js.map +1 -0
  1029. package/lib/commonjs/createMMKV.mock.js +43 -0
  1030. package/lib/commonjs/createMMKV.mock.js.map +1 -0
  1031. package/lib/commonjs/createMMKV.web.js +110 -0
  1032. package/lib/commonjs/createMMKV.web.js.map +1 -0
  1033. package/lib/commonjs/createTextEncoder.js +23 -0
  1034. package/lib/commonjs/createTextEncoder.js.map +1 -0
  1035. package/lib/commonjs/hooks.js +198 -0
  1036. package/lib/commonjs/hooks.js.map +1 -0
  1037. package/lib/commonjs/index.js +40 -0
  1038. package/lib/commonjs/index.js.map +1 -0
  1039. package/lib/commonjs/package.json +1 -0
  1040. package/lib/module/MMKV.js +119 -0
  1041. package/lib/module/MMKV.js.map +1 -0
  1042. package/lib/module/MemoryWarningListener.js +27 -0
  1043. package/lib/module/MemoryWarningListener.js.map +1 -0
  1044. package/lib/module/MemoryWarningListener.web.js +6 -0
  1045. package/lib/module/MemoryWarningListener.web.js.map +1 -0
  1046. package/lib/module/ModuleNotFoundError.js +70 -0
  1047. package/lib/module/ModuleNotFoundError.js.map +1 -0
  1048. package/lib/module/NativeMmkv.js +51 -0
  1049. package/lib/module/NativeMmkv.js.map +1 -0
  1050. package/lib/module/NativeMmkvPlatformContext.js +18 -0
  1051. package/lib/module/NativeMmkvPlatformContext.js.map +1 -0
  1052. package/lib/module/PlatformChecker.js +10 -0
  1053. package/lib/module/PlatformChecker.js.map +1 -0
  1054. package/lib/module/Types.js +31 -0
  1055. package/lib/module/Types.js.map +1 -0
  1056. package/lib/module/createMMKV.js +38 -0
  1057. package/lib/module/createMMKV.js.map +1 -0
  1058. package/lib/module/createMMKV.mock.js +38 -0
  1059. package/lib/module/createMMKV.mock.js.map +1 -0
  1060. package/lib/module/createMMKV.web.js +105 -0
  1061. package/lib/module/createMMKV.web.js.map +1 -0
  1062. package/lib/module/createTextEncoder.js +19 -0
  1063. package/lib/module/createTextEncoder.js.map +1 -0
  1064. package/lib/module/hooks.js +189 -0
  1065. package/lib/module/hooks.js.map +1 -0
  1066. package/lib/module/index.js +6 -0
  1067. package/lib/module/index.js.map +1 -0
  1068. package/lib/typescript/src/MMKV.d.ts +34 -0
  1069. package/lib/typescript/src/MMKV.d.ts.map +1 -0
  1070. package/lib/typescript/src/MemoryWarningListener.d.ts +3 -0
  1071. package/lib/typescript/src/MemoryWarningListener.d.ts.map +1 -0
  1072. package/lib/typescript/src/MemoryWarningListener.web.d.ts +3 -0
  1073. package/lib/typescript/src/MemoryWarningListener.web.d.ts.map +1 -0
  1074. package/lib/typescript/src/ModuleNotFoundError.d.ts +7 -0
  1075. package/lib/typescript/src/ModuleNotFoundError.d.ts.map +1 -0
  1076. package/lib/typescript/src/NativeMmkv.d.ts +91 -0
  1077. package/lib/typescript/src/NativeMmkv.d.ts.map +1 -0
  1078. package/lib/typescript/src/NativeMmkvPlatformContext.d.ts +20 -0
  1079. package/lib/typescript/src/NativeMmkvPlatformContext.d.ts.map +1 -0
  1080. package/lib/typescript/src/PlatformChecker.d.ts +2 -0
  1081. package/lib/typescript/src/PlatformChecker.d.ts.map +1 -0
  1082. package/lib/typescript/src/Types.d.ts +172 -0
  1083. package/lib/typescript/src/Types.d.ts.map +1 -0
  1084. package/lib/typescript/src/__tests__/hooks.test.d.ts +2 -0
  1085. package/lib/typescript/src/__tests__/hooks.test.d.ts.map +1 -0
  1086. package/lib/typescript/src/createMMKV.d.ts +3 -0
  1087. package/lib/typescript/src/createMMKV.d.ts.map +1 -0
  1088. package/lib/typescript/src/createMMKV.mock.d.ts +3 -0
  1089. package/lib/typescript/src/createMMKV.mock.d.ts.map +1 -0
  1090. package/lib/typescript/src/createMMKV.web.d.ts +3 -0
  1091. package/lib/typescript/src/createMMKV.web.d.ts.map +1 -0
  1092. package/lib/typescript/src/createTextEncoder.d.ts +2 -0
  1093. package/lib/typescript/src/createTextEncoder.d.ts.map +1 -0
  1094. package/lib/typescript/src/hooks.d.ts +86 -0
  1095. package/lib/typescript/src/hooks.d.ts.map +1 -0
  1096. package/lib/typescript/src/index.d.ts +4 -0
  1097. package/lib/typescript/src/index.d.ts.map +1 -0
  1098. package/package.json +187 -0
  1099. package/react-native-mmkv.podspec +38 -0
  1100. package/react-native.config.js +20 -0
  1101. package/src/MMKV.ts +142 -0
  1102. package/src/MemoryWarningListener.ts +29 -0
  1103. package/src/MemoryWarningListener.web.ts +5 -0
  1104. package/src/ModuleNotFoundError.ts +95 -0
  1105. package/src/NativeMmkv.ts +118 -0
  1106. package/src/NativeMmkvPlatformContext.ts +38 -0
  1107. package/src/PlatformChecker.ts +9 -0
  1108. package/src/Types.ts +178 -0
  1109. package/src/__tests__/hooks.test.tsx +89 -0
  1110. package/src/createMMKV.mock.ts +38 -0
  1111. package/src/createMMKV.ts +42 -0
  1112. package/src/createMMKV.web.ts +127 -0
  1113. package/src/createTextEncoder.ts +16 -0
  1114. package/src/hooks.ts +247 -0
  1115. package/src/index.ts +4 -0
@@ -0,0 +1,1848 @@
1
+ /*
2
+ pybind11/cast.h: Partial template specializations to cast between
3
+ C++ and Python types
4
+
5
+ Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
6
+
7
+ All rights reserved. Use of this source code is governed by a
8
+ BSD-style license that can be found in the LICENSE file.
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "detail/common.h"
14
+ #include "detail/descr.h"
15
+ #include "detail/type_caster_base.h"
16
+ #include "detail/typeid.h"
17
+ #include "pytypes.h"
18
+
19
+ #include <array>
20
+ #include <cstring>
21
+ #include <functional>
22
+ #include <iosfwd>
23
+ #include <iterator>
24
+ #include <memory>
25
+ #include <string>
26
+ #include <tuple>
27
+ #include <type_traits>
28
+ #include <utility>
29
+ #include <vector>
30
+
31
+ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
32
+
33
+ PYBIND11_WARNING_DISABLE_MSVC(4127)
34
+
35
+ PYBIND11_NAMESPACE_BEGIN(detail)
36
+
37
+ template <typename type, typename SFINAE = void>
38
+ class type_caster : public type_caster_base<type> {};
39
+ template <typename type>
40
+ using make_caster = type_caster<intrinsic_t<type>>;
41
+
42
+ // Shortcut for calling a caster's `cast_op_type` cast operator for casting a type_caster to a T
43
+ template <typename T>
44
+ typename make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster) {
45
+ using result_t = typename make_caster<T>::template cast_op_type<T>; // See PR #4893
46
+ return caster.operator result_t();
47
+ }
48
+ template <typename T>
49
+ typename make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type>
50
+ cast_op(make_caster<T> &&caster) {
51
+ using result_t = typename make_caster<T>::template cast_op_type<
52
+ typename std::add_rvalue_reference<T>::type>; // See PR #4893
53
+ return std::move(caster).operator result_t();
54
+ }
55
+
56
+ template <typename type>
57
+ class type_caster<std::reference_wrapper<type>> {
58
+ private:
59
+ using caster_t = make_caster<type>;
60
+ caster_t subcaster;
61
+ using reference_t = type &;
62
+ using subcaster_cast_op_type = typename caster_t::template cast_op_type<reference_t>;
63
+
64
+ static_assert(
65
+ std::is_same<typename std::remove_const<type>::type &, subcaster_cast_op_type>::value
66
+ || std::is_same<reference_t, subcaster_cast_op_type>::value,
67
+ "std::reference_wrapper<T> caster requires T to have a caster with an "
68
+ "`operator T &()` or `operator const T &()`");
69
+
70
+ public:
71
+ bool load(handle src, bool convert) { return subcaster.load(src, convert); }
72
+ static constexpr auto name = caster_t::name;
73
+ static handle
74
+ cast(const std::reference_wrapper<type> &src, return_value_policy policy, handle parent) {
75
+ // It is definitely wrong to take ownership of this pointer, so mask that rvp
76
+ if (policy == return_value_policy::take_ownership
77
+ || policy == return_value_policy::automatic) {
78
+ policy = return_value_policy::automatic_reference;
79
+ }
80
+ return caster_t::cast(&src.get(), policy, parent);
81
+ }
82
+ template <typename T>
83
+ using cast_op_type = std::reference_wrapper<type>;
84
+ explicit operator std::reference_wrapper<type>() { return cast_op<type &>(subcaster); }
85
+ };
86
+
87
+ #define PYBIND11_TYPE_CASTER(type, py_name) \
88
+ protected: \
89
+ type value; \
90
+ \
91
+ public: \
92
+ static constexpr auto name = py_name; \
93
+ template <typename T_, \
94
+ ::pybind11::detail::enable_if_t< \
95
+ std::is_same<type, ::pybind11::detail::remove_cv_t<T_>>::value, \
96
+ int> \
97
+ = 0> \
98
+ static ::pybind11::handle cast( \
99
+ T_ *src, ::pybind11::return_value_policy policy, ::pybind11::handle parent) { \
100
+ if (!src) \
101
+ return ::pybind11::none().release(); \
102
+ if (policy == ::pybind11::return_value_policy::take_ownership) { \
103
+ auto h = cast(std::move(*src), policy, parent); \
104
+ delete src; \
105
+ return h; \
106
+ } \
107
+ return cast(*src, policy, parent); \
108
+ } \
109
+ operator type *() { return &value; } /* NOLINT(bugprone-macro-parentheses) */ \
110
+ operator type &() { return value; } /* NOLINT(bugprone-macro-parentheses) */ \
111
+ operator type &&() && { return std::move(value); } /* NOLINT(bugprone-macro-parentheses) */ \
112
+ template <typename T_> \
113
+ using cast_op_type = ::pybind11::detail::movable_cast_op_type<T_>
114
+
115
+ template <typename CharT>
116
+ using is_std_char_type = any_of<std::is_same<CharT, char>, /* std::string */
117
+ #if defined(PYBIND11_HAS_U8STRING)
118
+ std::is_same<CharT, char8_t>, /* std::u8string */
119
+ #endif
120
+ std::is_same<CharT, char16_t>, /* std::u16string */
121
+ std::is_same<CharT, char32_t>, /* std::u32string */
122
+ std::is_same<CharT, wchar_t> /* std::wstring */
123
+ >;
124
+
125
+ template <typename T>
126
+ struct type_caster<T, enable_if_t<std::is_arithmetic<T>::value && !is_std_char_type<T>::value>> {
127
+ using _py_type_0 = conditional_t<sizeof(T) <= sizeof(long), long, long long>;
128
+ using _py_type_1 = conditional_t<std::is_signed<T>::value,
129
+ _py_type_0,
130
+ typename std::make_unsigned<_py_type_0>::type>;
131
+ using py_type = conditional_t<std::is_floating_point<T>::value, double, _py_type_1>;
132
+
133
+ public:
134
+ bool load(handle src, bool convert) {
135
+ py_type py_value;
136
+
137
+ if (!src) {
138
+ return false;
139
+ }
140
+
141
+ #if !defined(PYPY_VERSION)
142
+ auto index_check = [](PyObject *o) { return PyIndex_Check(o); };
143
+ #else
144
+ // In PyPy 7.3.3, `PyIndex_Check` is implemented by calling `__index__`,
145
+ // while CPython only considers the existence of `nb_index`/`__index__`.
146
+ auto index_check = [](PyObject *o) { return hasattr(o, "__index__"); };
147
+ #endif
148
+
149
+ if (std::is_floating_point<T>::value) {
150
+ if (convert || PyFloat_Check(src.ptr())) {
151
+ py_value = (py_type) PyFloat_AsDouble(src.ptr());
152
+ } else {
153
+ return false;
154
+ }
155
+ } else if (PyFloat_Check(src.ptr())
156
+ || (!convert && !PYBIND11_LONG_CHECK(src.ptr()) && !index_check(src.ptr()))) {
157
+ return false;
158
+ } else {
159
+ handle src_or_index = src;
160
+ // PyPy: 7.3.7's 3.8 does not implement PyLong_*'s __index__ calls.
161
+ #if PY_VERSION_HEX < 0x03080000 || defined(PYPY_VERSION)
162
+ object index;
163
+ if (!PYBIND11_LONG_CHECK(src.ptr())) { // So: index_check(src.ptr())
164
+ index = reinterpret_steal<object>(PyNumber_Index(src.ptr()));
165
+ if (!index) {
166
+ PyErr_Clear();
167
+ if (!convert)
168
+ return false;
169
+ } else {
170
+ src_or_index = index;
171
+ }
172
+ }
173
+ #endif
174
+ if (std::is_unsigned<py_type>::value) {
175
+ py_value = as_unsigned<py_type>(src_or_index.ptr());
176
+ } else { // signed integer:
177
+ py_value = sizeof(T) <= sizeof(long)
178
+ ? (py_type) PyLong_AsLong(src_or_index.ptr())
179
+ : (py_type) PYBIND11_LONG_AS_LONGLONG(src_or_index.ptr());
180
+ }
181
+ }
182
+
183
+ // Python API reported an error
184
+ bool py_err = py_value == (py_type) -1 && PyErr_Occurred();
185
+
186
+ // Check to see if the conversion is valid (integers should match exactly)
187
+ // Signed/unsigned checks happen elsewhere
188
+ if (py_err
189
+ || (std::is_integral<T>::value && sizeof(py_type) != sizeof(T)
190
+ && py_value != (py_type) (T) py_value)) {
191
+ PyErr_Clear();
192
+ if (py_err && convert && (PyNumber_Check(src.ptr()) != 0)) {
193
+ auto tmp = reinterpret_steal<object>(std::is_floating_point<T>::value
194
+ ? PyNumber_Float(src.ptr())
195
+ : PyNumber_Long(src.ptr()));
196
+ PyErr_Clear();
197
+ return load(tmp, false);
198
+ }
199
+ return false;
200
+ }
201
+
202
+ value = (T) py_value;
203
+ return true;
204
+ }
205
+
206
+ template <typename U = T>
207
+ static typename std::enable_if<std::is_floating_point<U>::value, handle>::type
208
+ cast(U src, return_value_policy /* policy */, handle /* parent */) {
209
+ return PyFloat_FromDouble((double) src);
210
+ }
211
+
212
+ template <typename U = T>
213
+ static typename std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value
214
+ && (sizeof(U) <= sizeof(long)),
215
+ handle>::type
216
+ cast(U src, return_value_policy /* policy */, handle /* parent */) {
217
+ return PYBIND11_LONG_FROM_SIGNED((long) src);
218
+ }
219
+
220
+ template <typename U = T>
221
+ static typename std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value
222
+ && (sizeof(U) <= sizeof(unsigned long)),
223
+ handle>::type
224
+ cast(U src, return_value_policy /* policy */, handle /* parent */) {
225
+ return PYBIND11_LONG_FROM_UNSIGNED((unsigned long) src);
226
+ }
227
+
228
+ template <typename U = T>
229
+ static typename std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value
230
+ && (sizeof(U) > sizeof(long)),
231
+ handle>::type
232
+ cast(U src, return_value_policy /* policy */, handle /* parent */) {
233
+ return PyLong_FromLongLong((long long) src);
234
+ }
235
+
236
+ template <typename U = T>
237
+ static typename std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value
238
+ && (sizeof(U) > sizeof(unsigned long)),
239
+ handle>::type
240
+ cast(U src, return_value_policy /* policy */, handle /* parent */) {
241
+ return PyLong_FromUnsignedLongLong((unsigned long long) src);
242
+ }
243
+
244
+ PYBIND11_TYPE_CASTER(T, const_name<std::is_integral<T>::value>("int", "float"));
245
+ };
246
+
247
+ template <typename T>
248
+ struct void_caster {
249
+ public:
250
+ bool load(handle src, bool) {
251
+ if (src && src.is_none()) {
252
+ return true;
253
+ }
254
+ return false;
255
+ }
256
+ static handle cast(T, return_value_policy /* policy */, handle /* parent */) {
257
+ return none().release();
258
+ }
259
+ PYBIND11_TYPE_CASTER(T, const_name("None"));
260
+ };
261
+
262
+ template <>
263
+ class type_caster<void_type> : public void_caster<void_type> {};
264
+
265
+ template <>
266
+ class type_caster<void> : public type_caster<void_type> {
267
+ public:
268
+ using type_caster<void_type>::cast;
269
+
270
+ bool load(handle h, bool) {
271
+ if (!h) {
272
+ return false;
273
+ }
274
+ if (h.is_none()) {
275
+ value = nullptr;
276
+ return true;
277
+ }
278
+
279
+ /* Check if this is a capsule */
280
+ if (isinstance<capsule>(h)) {
281
+ value = reinterpret_borrow<capsule>(h);
282
+ return true;
283
+ }
284
+
285
+ /* Check if this is a C++ type */
286
+ const auto &bases = all_type_info((PyTypeObject *) type::handle_of(h).ptr());
287
+ if (bases.size() == 1) { // Only allowing loading from a single-value type
288
+ value = values_and_holders(reinterpret_cast<instance *>(h.ptr())).begin()->value_ptr();
289
+ return true;
290
+ }
291
+
292
+ /* Fail */
293
+ return false;
294
+ }
295
+
296
+ static handle cast(const void *ptr, return_value_policy /* policy */, handle /* parent */) {
297
+ if (ptr) {
298
+ return capsule(ptr).release();
299
+ }
300
+ return none().release();
301
+ }
302
+
303
+ template <typename T>
304
+ using cast_op_type = void *&;
305
+ explicit operator void *&() { return value; }
306
+ static constexpr auto name = const_name("capsule");
307
+
308
+ private:
309
+ void *value = nullptr;
310
+ };
311
+
312
+ template <>
313
+ class type_caster<std::nullptr_t> : public void_caster<std::nullptr_t> {};
314
+
315
+ template <>
316
+ class type_caster<bool> {
317
+ public:
318
+ bool load(handle src, bool convert) {
319
+ if (!src) {
320
+ return false;
321
+ }
322
+ if (src.ptr() == Py_True) {
323
+ value = true;
324
+ return true;
325
+ }
326
+ if (src.ptr() == Py_False) {
327
+ value = false;
328
+ return true;
329
+ }
330
+ if (convert || is_numpy_bool(src)) {
331
+ // (allow non-implicit conversion for numpy booleans), use strncmp
332
+ // since NumPy 1.x had an additional trailing underscore.
333
+
334
+ Py_ssize_t res = -1;
335
+ if (src.is_none()) {
336
+ res = 0; // None is implicitly converted to False
337
+ }
338
+ #if defined(PYPY_VERSION)
339
+ // On PyPy, check that "__bool__" attr exists
340
+ else if (hasattr(src, PYBIND11_BOOL_ATTR)) {
341
+ res = PyObject_IsTrue(src.ptr());
342
+ }
343
+ #else
344
+ // Alternate approach for CPython: this does the same as the above, but optimized
345
+ // using the CPython API so as to avoid an unneeded attribute lookup.
346
+ else if (auto *tp_as_number = src.ptr()->ob_type->tp_as_number) {
347
+ if (PYBIND11_NB_BOOL(tp_as_number)) {
348
+ res = (*PYBIND11_NB_BOOL(tp_as_number))(src.ptr());
349
+ }
350
+ }
351
+ #endif
352
+ if (res == 0 || res == 1) {
353
+ value = (res != 0);
354
+ return true;
355
+ }
356
+ PyErr_Clear();
357
+ }
358
+ return false;
359
+ }
360
+ static handle cast(bool src, return_value_policy /* policy */, handle /* parent */) {
361
+ return handle(src ? Py_True : Py_False).inc_ref();
362
+ }
363
+ PYBIND11_TYPE_CASTER(bool, const_name("bool"));
364
+
365
+ private:
366
+ // Test if an object is a NumPy boolean (without fetching the type).
367
+ static inline bool is_numpy_bool(handle object) {
368
+ const char *type_name = Py_TYPE(object.ptr())->tp_name;
369
+ // Name changed to `numpy.bool` in NumPy 2, `numpy.bool_` is needed for 1.x support
370
+ return std::strcmp("numpy.bool", type_name) == 0
371
+ || std::strcmp("numpy.bool_", type_name) == 0;
372
+ }
373
+ };
374
+
375
+ // Helper class for UTF-{8,16,32} C++ stl strings:
376
+ template <typename StringType, bool IsView = false>
377
+ struct string_caster {
378
+ using CharT = typename StringType::value_type;
379
+
380
+ // Simplify life by being able to assume standard char sizes (the standard only guarantees
381
+ // minimums, but Python requires exact sizes)
382
+ static_assert(!std::is_same<CharT, char>::value || sizeof(CharT) == 1,
383
+ "Unsupported char size != 1");
384
+ #if defined(PYBIND11_HAS_U8STRING)
385
+ static_assert(!std::is_same<CharT, char8_t>::value || sizeof(CharT) == 1,
386
+ "Unsupported char8_t size != 1");
387
+ #endif
388
+ static_assert(!std::is_same<CharT, char16_t>::value || sizeof(CharT) == 2,
389
+ "Unsupported char16_t size != 2");
390
+ static_assert(!std::is_same<CharT, char32_t>::value || sizeof(CharT) == 4,
391
+ "Unsupported char32_t size != 4");
392
+ // wchar_t can be either 16 bits (Windows) or 32 (everywhere else)
393
+ static_assert(!std::is_same<CharT, wchar_t>::value || sizeof(CharT) == 2 || sizeof(CharT) == 4,
394
+ "Unsupported wchar_t size != 2/4");
395
+ static constexpr size_t UTF_N = 8 * sizeof(CharT);
396
+
397
+ bool load(handle src, bool) {
398
+ handle load_src = src;
399
+ if (!src) {
400
+ return false;
401
+ }
402
+ if (!PyUnicode_Check(load_src.ptr())) {
403
+ return load_raw(load_src);
404
+ }
405
+
406
+ // For UTF-8 we avoid the need for a temporary `bytes` object by using
407
+ // `PyUnicode_AsUTF8AndSize`.
408
+ if (UTF_N == 8) {
409
+ Py_ssize_t size = -1;
410
+ const auto *buffer
411
+ = reinterpret_cast<const CharT *>(PyUnicode_AsUTF8AndSize(load_src.ptr(), &size));
412
+ if (!buffer) {
413
+ PyErr_Clear();
414
+ return false;
415
+ }
416
+ value = StringType(buffer, static_cast<size_t>(size));
417
+ return true;
418
+ }
419
+
420
+ auto utfNbytes
421
+ = reinterpret_steal<object>(PyUnicode_AsEncodedString(load_src.ptr(),
422
+ UTF_N == 8 ? "utf-8"
423
+ : UTF_N == 16 ? "utf-16"
424
+ : "utf-32",
425
+ nullptr));
426
+ if (!utfNbytes) {
427
+ PyErr_Clear();
428
+ return false;
429
+ }
430
+
431
+ const auto *buffer
432
+ = reinterpret_cast<const CharT *>(PYBIND11_BYTES_AS_STRING(utfNbytes.ptr()));
433
+ size_t length = (size_t) PYBIND11_BYTES_SIZE(utfNbytes.ptr()) / sizeof(CharT);
434
+ // Skip BOM for UTF-16/32
435
+ if (UTF_N > 8) {
436
+ buffer++;
437
+ length--;
438
+ }
439
+ value = StringType(buffer, length);
440
+
441
+ // If we're loading a string_view we need to keep the encoded Python object alive:
442
+ if (IsView) {
443
+ loader_life_support::add_patient(utfNbytes);
444
+ }
445
+
446
+ return true;
447
+ }
448
+
449
+ static handle
450
+ cast(const StringType &src, return_value_policy /* policy */, handle /* parent */) {
451
+ const char *buffer = reinterpret_cast<const char *>(src.data());
452
+ auto nbytes = ssize_t(src.size() * sizeof(CharT));
453
+ handle s = decode_utfN(buffer, nbytes);
454
+ if (!s) {
455
+ throw error_already_set();
456
+ }
457
+ return s;
458
+ }
459
+
460
+ PYBIND11_TYPE_CASTER(StringType, const_name(PYBIND11_STRING_NAME));
461
+
462
+ private:
463
+ static handle decode_utfN(const char *buffer, ssize_t nbytes) {
464
+ #if !defined(PYPY_VERSION)
465
+ return UTF_N == 8 ? PyUnicode_DecodeUTF8(buffer, nbytes, nullptr)
466
+ : UTF_N == 16 ? PyUnicode_DecodeUTF16(buffer, nbytes, nullptr, nullptr)
467
+ : PyUnicode_DecodeUTF32(buffer, nbytes, nullptr, nullptr);
468
+ #else
469
+ // PyPy segfaults when on PyUnicode_DecodeUTF16 (and possibly on PyUnicode_DecodeUTF32 as
470
+ // well), so bypass the whole thing by just passing the encoding as a string value, which
471
+ // works properly:
472
+ return PyUnicode_Decode(buffer,
473
+ nbytes,
474
+ UTF_N == 8 ? "utf-8"
475
+ : UTF_N == 16 ? "utf-16"
476
+ : "utf-32",
477
+ nullptr);
478
+ #endif
479
+ }
480
+
481
+ // When loading into a std::string or char*, accept a bytes/bytearray object as-is (i.e.
482
+ // without any encoding/decoding attempt). For other C++ char sizes this is a no-op.
483
+ // which supports loading a unicode from a str, doesn't take this path.
484
+ template <typename C = CharT>
485
+ bool load_raw(enable_if_t<std::is_same<C, char>::value, handle> src) {
486
+ if (PYBIND11_BYTES_CHECK(src.ptr())) {
487
+ // We were passed raw bytes; accept it into a std::string or char*
488
+ // without any encoding attempt.
489
+ const char *bytes = PYBIND11_BYTES_AS_STRING(src.ptr());
490
+ if (!bytes) {
491
+ pybind11_fail("Unexpected PYBIND11_BYTES_AS_STRING() failure.");
492
+ }
493
+ value = StringType(bytes, (size_t) PYBIND11_BYTES_SIZE(src.ptr()));
494
+ return true;
495
+ }
496
+ if (PyByteArray_Check(src.ptr())) {
497
+ // We were passed a bytearray; accept it into a std::string or char*
498
+ // without any encoding attempt.
499
+ const char *bytearray = PyByteArray_AsString(src.ptr());
500
+ if (!bytearray) {
501
+ pybind11_fail("Unexpected PyByteArray_AsString() failure.");
502
+ }
503
+ value = StringType(bytearray, (size_t) PyByteArray_Size(src.ptr()));
504
+ return true;
505
+ }
506
+
507
+ return false;
508
+ }
509
+
510
+ template <typename C = CharT>
511
+ bool load_raw(enable_if_t<!std::is_same<C, char>::value, handle>) {
512
+ return false;
513
+ }
514
+ };
515
+
516
+ template <typename CharT, class Traits, class Allocator>
517
+ struct type_caster<std::basic_string<CharT, Traits, Allocator>,
518
+ enable_if_t<is_std_char_type<CharT>::value>>
519
+ : string_caster<std::basic_string<CharT, Traits, Allocator>> {};
520
+
521
+ #ifdef PYBIND11_HAS_STRING_VIEW
522
+ template <typename CharT, class Traits>
523
+ struct type_caster<std::basic_string_view<CharT, Traits>,
524
+ enable_if_t<is_std_char_type<CharT>::value>>
525
+ : string_caster<std::basic_string_view<CharT, Traits>, true> {};
526
+ #endif
527
+
528
+ // Type caster for C-style strings. We basically use a std::string type caster, but also add the
529
+ // ability to use None as a nullptr char* (which the string caster doesn't allow).
530
+ template <typename CharT>
531
+ struct type_caster<CharT, enable_if_t<is_std_char_type<CharT>::value>> {
532
+ using StringType = std::basic_string<CharT>;
533
+ using StringCaster = make_caster<StringType>;
534
+ StringCaster str_caster;
535
+ bool none = false;
536
+ CharT one_char = 0;
537
+
538
+ public:
539
+ bool load(handle src, bool convert) {
540
+ if (!src) {
541
+ return false;
542
+ }
543
+ if (src.is_none()) {
544
+ // Defer accepting None to other overloads (if we aren't in convert mode):
545
+ if (!convert) {
546
+ return false;
547
+ }
548
+ none = true;
549
+ return true;
550
+ }
551
+ return str_caster.load(src, convert);
552
+ }
553
+
554
+ static handle cast(const CharT *src, return_value_policy policy, handle parent) {
555
+ if (src == nullptr) {
556
+ return pybind11::none().release();
557
+ }
558
+ return StringCaster::cast(StringType(src), policy, parent);
559
+ }
560
+
561
+ static handle cast(CharT src, return_value_policy policy, handle parent) {
562
+ if (std::is_same<char, CharT>::value) {
563
+ handle s = PyUnicode_DecodeLatin1((const char *) &src, 1, nullptr);
564
+ if (!s) {
565
+ throw error_already_set();
566
+ }
567
+ return s;
568
+ }
569
+ return StringCaster::cast(StringType(1, src), policy, parent);
570
+ }
571
+
572
+ explicit operator CharT *() {
573
+ return none ? nullptr : const_cast<CharT *>(static_cast<StringType &>(str_caster).c_str());
574
+ }
575
+ explicit operator CharT &() {
576
+ if (none) {
577
+ throw value_error("Cannot convert None to a character");
578
+ }
579
+
580
+ auto &value = static_cast<StringType &>(str_caster);
581
+ size_t str_len = value.size();
582
+ if (str_len == 0) {
583
+ throw value_error("Cannot convert empty string to a character");
584
+ }
585
+
586
+ // If we're in UTF-8 mode, we have two possible failures: one for a unicode character that
587
+ // is too high, and one for multiple unicode characters (caught later), so we need to
588
+ // figure out how long the first encoded character is in bytes to distinguish between these
589
+ // two errors. We also allow want to allow unicode characters U+0080 through U+00FF, as
590
+ // those can fit into a single char value.
591
+ if (StringCaster::UTF_N == 8 && str_len > 1 && str_len <= 4) {
592
+ auto v0 = static_cast<unsigned char>(value[0]);
593
+ // low bits only: 0-127
594
+ // 0b110xxxxx - start of 2-byte sequence
595
+ // 0b1110xxxx - start of 3-byte sequence
596
+ // 0b11110xxx - start of 4-byte sequence
597
+ size_t char0_bytes = (v0 & 0x80) == 0 ? 1
598
+ : (v0 & 0xE0) == 0xC0 ? 2
599
+ : (v0 & 0xF0) == 0xE0 ? 3
600
+ : 4;
601
+
602
+ if (char0_bytes == str_len) {
603
+ // If we have a 128-255 value, we can decode it into a single char:
604
+ if (char0_bytes == 2 && (v0 & 0xFC) == 0xC0) { // 0x110000xx 0x10xxxxxx
605
+ one_char = static_cast<CharT>(((v0 & 3) << 6)
606
+ + (static_cast<unsigned char>(value[1]) & 0x3F));
607
+ return one_char;
608
+ }
609
+ // Otherwise we have a single character, but it's > U+00FF
610
+ throw value_error("Character code point not in range(0x100)");
611
+ }
612
+ }
613
+
614
+ // UTF-16 is much easier: we can only have a surrogate pair for values above U+FFFF, thus a
615
+ // surrogate pair with total length 2 instantly indicates a range error (but not a "your
616
+ // string was too long" error).
617
+ else if (StringCaster::UTF_N == 16 && str_len == 2) {
618
+ one_char = static_cast<CharT>(value[0]);
619
+ if (one_char >= 0xD800 && one_char < 0xE000) {
620
+ throw value_error("Character code point not in range(0x10000)");
621
+ }
622
+ }
623
+
624
+ if (str_len != 1) {
625
+ throw value_error("Expected a character, but multi-character string found");
626
+ }
627
+
628
+ one_char = value[0];
629
+ return one_char;
630
+ }
631
+
632
+ static constexpr auto name = const_name(PYBIND11_STRING_NAME);
633
+ template <typename _T>
634
+ using cast_op_type = pybind11::detail::cast_op_type<_T>;
635
+ };
636
+
637
+ // Base implementation for std::tuple and std::pair
638
+ template <template <typename...> class Tuple, typename... Ts>
639
+ class tuple_caster {
640
+ using type = Tuple<Ts...>;
641
+ static constexpr auto size = sizeof...(Ts);
642
+ using indices = make_index_sequence<size>;
643
+
644
+ public:
645
+ bool load(handle src, bool convert) {
646
+ if (!isinstance<sequence>(src)) {
647
+ return false;
648
+ }
649
+ const auto seq = reinterpret_borrow<sequence>(src);
650
+ if (seq.size() != size) {
651
+ return false;
652
+ }
653
+ return load_impl(seq, convert, indices{});
654
+ }
655
+
656
+ template <typename T>
657
+ static handle cast(T &&src, return_value_policy policy, handle parent) {
658
+ return cast_impl(std::forward<T>(src), policy, parent, indices{});
659
+ }
660
+
661
+ // copied from the PYBIND11_TYPE_CASTER macro
662
+ template <typename T>
663
+ static handle cast(T *src, return_value_policy policy, handle parent) {
664
+ if (!src) {
665
+ return none().release();
666
+ }
667
+ if (policy == return_value_policy::take_ownership) {
668
+ auto h = cast(std::move(*src), policy, parent);
669
+ delete src;
670
+ return h;
671
+ }
672
+ return cast(*src, policy, parent);
673
+ }
674
+
675
+ static constexpr auto name = const_name("tuple[")
676
+ + ::pybind11::detail::concat(make_caster<Ts>::name...)
677
+ + const_name("]");
678
+
679
+ template <typename T>
680
+ using cast_op_type = type;
681
+
682
+ explicit operator type() & { return implicit_cast(indices{}); }
683
+ explicit operator type() && { return std::move(*this).implicit_cast(indices{}); }
684
+
685
+ protected:
686
+ template <size_t... Is>
687
+ type implicit_cast(index_sequence<Is...>) & {
688
+ return type(cast_op<Ts>(std::get<Is>(subcasters))...);
689
+ }
690
+ template <size_t... Is>
691
+ type implicit_cast(index_sequence<Is...>) && {
692
+ return type(cast_op<Ts>(std::move(std::get<Is>(subcasters)))...);
693
+ }
694
+
695
+ static constexpr bool load_impl(const sequence &, bool, index_sequence<>) { return true; }
696
+
697
+ template <size_t... Is>
698
+ bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>) {
699
+ #ifdef __cpp_fold_expressions
700
+ if ((... || !std::get<Is>(subcasters).load(seq[Is], convert))) {
701
+ return false;
702
+ }
703
+ #else
704
+ for (bool r : {std::get<Is>(subcasters).load(seq[Is], convert)...}) {
705
+ if (!r) {
706
+ return false;
707
+ }
708
+ }
709
+ #endif
710
+ return true;
711
+ }
712
+
713
+ /* Implementation: Convert a C++ tuple into a Python tuple */
714
+ template <typename T, size_t... Is>
715
+ static handle
716
+ cast_impl(T &&src, return_value_policy policy, handle parent, index_sequence<Is...>) {
717
+ PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(src, policy, parent);
718
+ PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(policy, parent);
719
+ std::array<object, size> entries{{reinterpret_steal<object>(
720
+ make_caster<Ts>::cast(std::get<Is>(std::forward<T>(src)), policy, parent))...}};
721
+ for (const auto &entry : entries) {
722
+ if (!entry) {
723
+ return handle();
724
+ }
725
+ }
726
+ tuple result(size);
727
+ int counter = 0;
728
+ for (auto &entry : entries) {
729
+ PyTuple_SET_ITEM(result.ptr(), counter++, entry.release().ptr());
730
+ }
731
+ return result.release();
732
+ }
733
+
734
+ Tuple<make_caster<Ts>...> subcasters;
735
+ };
736
+
737
+ template <typename T1, typename T2>
738
+ class type_caster<std::pair<T1, T2>> : public tuple_caster<std::pair, T1, T2> {};
739
+
740
+ template <typename... Ts>
741
+ class type_caster<std::tuple<Ts...>> : public tuple_caster<std::tuple, Ts...> {};
742
+
743
+ /// Helper class which abstracts away certain actions. Users can provide specializations for
744
+ /// custom holders, but it's only necessary if the type has a non-standard interface.
745
+ template <typename T>
746
+ struct holder_helper {
747
+ static auto get(const T &p) -> decltype(p.get()) { return p.get(); }
748
+ };
749
+
750
+ /// Type caster for holder types like std::shared_ptr, etc.
751
+ /// The SFINAE hook is provided to help work around the current lack of support
752
+ /// for smart-pointer interoperability. Please consider it an implementation
753
+ /// detail that may change in the future, as formal support for smart-pointer
754
+ /// interoperability is added into pybind11.
755
+ template <typename type, typename holder_type, typename SFINAE = void>
756
+ struct copyable_holder_caster : public type_caster_base<type> {
757
+ public:
758
+ using base = type_caster_base<type>;
759
+ static_assert(std::is_base_of<base, type_caster<type>>::value,
760
+ "Holder classes are only supported for custom types");
761
+ using base::base;
762
+ using base::cast;
763
+ using base::typeinfo;
764
+ using base::value;
765
+
766
+ bool load(handle src, bool convert) {
767
+ return base::template load_impl<copyable_holder_caster<type, holder_type>>(src, convert);
768
+ }
769
+
770
+ explicit operator type *() { return this->value; }
771
+ // static_cast works around compiler error with MSVC 17 and CUDA 10.2
772
+ // see issue #2180
773
+ explicit operator type &() { return *(static_cast<type *>(this->value)); }
774
+ explicit operator holder_type *() { return std::addressof(holder); }
775
+ explicit operator holder_type &() { return holder; }
776
+
777
+ static handle cast(const holder_type &src, return_value_policy, handle) {
778
+ const auto *ptr = holder_helper<holder_type>::get(src);
779
+ return type_caster_base<type>::cast_holder(ptr, &src);
780
+ }
781
+
782
+ protected:
783
+ friend class type_caster_generic;
784
+ void check_holder_compat() {
785
+ if (typeinfo->default_holder) {
786
+ throw cast_error("Unable to load a custom holder type from a default-holder instance");
787
+ }
788
+ }
789
+
790
+ bool load_value(value_and_holder &&v_h) {
791
+ if (v_h.holder_constructed()) {
792
+ value = v_h.value_ptr();
793
+ holder = v_h.template holder<holder_type>();
794
+ return true;
795
+ }
796
+ throw cast_error("Unable to cast from non-held to held instance (T& to Holder<T>) "
797
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
798
+ "(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for "
799
+ "type information)");
800
+ #else
801
+ "of type '"
802
+ + type_id<holder_type>() + "''");
803
+ #endif
804
+ }
805
+
806
+ template <typename T = holder_type,
807
+ detail::enable_if_t<!std::is_constructible<T, const T &, type *>::value, int> = 0>
808
+ bool try_implicit_casts(handle, bool) {
809
+ return false;
810
+ }
811
+
812
+ template <typename T = holder_type,
813
+ detail::enable_if_t<std::is_constructible<T, const T &, type *>::value, int> = 0>
814
+ bool try_implicit_casts(handle src, bool convert) {
815
+ for (auto &cast : typeinfo->implicit_casts) {
816
+ copyable_holder_caster sub_caster(*cast.first);
817
+ if (sub_caster.load(src, convert)) {
818
+ value = cast.second(sub_caster.value);
819
+ holder = holder_type(sub_caster.holder, (type *) value);
820
+ return true;
821
+ }
822
+ }
823
+ return false;
824
+ }
825
+
826
+ static bool try_direct_conversions(handle) { return false; }
827
+
828
+ holder_type holder;
829
+ };
830
+
831
+ /// Specialize for the common std::shared_ptr, so users don't need to
832
+ template <typename T>
833
+ class type_caster<std::shared_ptr<T>> : public copyable_holder_caster<T, std::shared_ptr<T>> {};
834
+
835
+ /// Type caster for holder types like std::unique_ptr.
836
+ /// Please consider the SFINAE hook an implementation detail, as explained
837
+ /// in the comment for the copyable_holder_caster.
838
+ template <typename type, typename holder_type, typename SFINAE = void>
839
+ struct move_only_holder_caster {
840
+ static_assert(std::is_base_of<type_caster_base<type>, type_caster<type>>::value,
841
+ "Holder classes are only supported for custom types");
842
+
843
+ static handle cast(holder_type &&src, return_value_policy, handle) {
844
+ auto *ptr = holder_helper<holder_type>::get(src);
845
+ return type_caster_base<type>::cast_holder(ptr, std::addressof(src));
846
+ }
847
+ static constexpr auto name = type_caster_base<type>::name;
848
+ };
849
+
850
+ template <typename type, typename deleter>
851
+ class type_caster<std::unique_ptr<type, deleter>>
852
+ : public move_only_holder_caster<type, std::unique_ptr<type, deleter>> {};
853
+
854
+ template <typename type, typename holder_type>
855
+ using type_caster_holder = conditional_t<is_copy_constructible<holder_type>::value,
856
+ copyable_holder_caster<type, holder_type>,
857
+ move_only_holder_caster<type, holder_type>>;
858
+
859
+ template <typename T, bool Value = false>
860
+ struct always_construct_holder {
861
+ static constexpr bool value = Value;
862
+ };
863
+
864
+ /// Create a specialization for custom holder types (silently ignores std::shared_ptr)
865
+ #define PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...) \
866
+ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) \
867
+ namespace detail { \
868
+ template <typename type> \
869
+ struct always_construct_holder<holder_type> : always_construct_holder<void, ##__VA_ARGS__> { \
870
+ }; \
871
+ template <typename type> \
872
+ class type_caster<holder_type, enable_if_t<!is_shared_ptr<holder_type>::value>> \
873
+ : public type_caster_holder<type, holder_type> {}; \
874
+ } \
875
+ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
876
+
877
+ // PYBIND11_DECLARE_HOLDER_TYPE holder types:
878
+ template <typename base, typename holder>
879
+ struct is_holder_type
880
+ : std::is_base_of<detail::type_caster_holder<base, holder>, detail::type_caster<holder>> {};
881
+ // Specialization for always-supported unique_ptr holders:
882
+ template <typename base, typename deleter>
883
+ struct is_holder_type<base, std::unique_ptr<base, deleter>> : std::true_type {};
884
+
885
+ #ifdef PYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION // See PR #4888
886
+
887
+ // This leads to compilation errors if a specialization is missing.
888
+ template <typename T>
889
+ struct handle_type_name;
890
+
891
+ #else
892
+
893
+ template <typename T>
894
+ struct handle_type_name {
895
+ static constexpr auto name = const_name<T>();
896
+ };
897
+
898
+ #endif
899
+
900
+ template <>
901
+ struct handle_type_name<object> {
902
+ static constexpr auto name = const_name("object");
903
+ };
904
+ template <>
905
+ struct handle_type_name<list> {
906
+ static constexpr auto name = const_name("list");
907
+ };
908
+ template <>
909
+ struct handle_type_name<dict> {
910
+ static constexpr auto name = const_name("dict");
911
+ };
912
+ template <>
913
+ struct handle_type_name<anyset> {
914
+ static constexpr auto name = const_name("Union[set, frozenset]");
915
+ };
916
+ template <>
917
+ struct handle_type_name<set> {
918
+ static constexpr auto name = const_name("set");
919
+ };
920
+ template <>
921
+ struct handle_type_name<frozenset> {
922
+ static constexpr auto name = const_name("frozenset");
923
+ };
924
+ template <>
925
+ struct handle_type_name<str> {
926
+ static constexpr auto name = const_name("str");
927
+ };
928
+ template <>
929
+ struct handle_type_name<tuple> {
930
+ static constexpr auto name = const_name("tuple");
931
+ };
932
+ template <>
933
+ struct handle_type_name<bool_> {
934
+ static constexpr auto name = const_name("bool");
935
+ };
936
+ template <>
937
+ struct handle_type_name<bytes> {
938
+ static constexpr auto name = const_name(PYBIND11_BYTES_NAME);
939
+ };
940
+ template <>
941
+ struct handle_type_name<buffer> {
942
+ static constexpr auto name = const_name("Buffer");
943
+ };
944
+ template <>
945
+ struct handle_type_name<int_> {
946
+ static constexpr auto name = const_name("int");
947
+ };
948
+ template <>
949
+ struct handle_type_name<iterable> {
950
+ static constexpr auto name = const_name("Iterable");
951
+ };
952
+ template <>
953
+ struct handle_type_name<iterator> {
954
+ static constexpr auto name = const_name("Iterator");
955
+ };
956
+ template <>
957
+ struct handle_type_name<float_> {
958
+ static constexpr auto name = const_name("float");
959
+ };
960
+ template <>
961
+ struct handle_type_name<function> {
962
+ static constexpr auto name = const_name("Callable");
963
+ };
964
+ template <>
965
+ struct handle_type_name<handle> {
966
+ static constexpr auto name = handle_type_name<object>::name;
967
+ };
968
+ template <>
969
+ struct handle_type_name<none> {
970
+ static constexpr auto name = const_name("None");
971
+ };
972
+ template <>
973
+ struct handle_type_name<sequence> {
974
+ static constexpr auto name = const_name("Sequence");
975
+ };
976
+ template <>
977
+ struct handle_type_name<bytearray> {
978
+ static constexpr auto name = const_name("bytearray");
979
+ };
980
+ template <>
981
+ struct handle_type_name<memoryview> {
982
+ static constexpr auto name = const_name("memoryview");
983
+ };
984
+ template <>
985
+ struct handle_type_name<slice> {
986
+ static constexpr auto name = const_name("slice");
987
+ };
988
+ template <>
989
+ struct handle_type_name<type> {
990
+ static constexpr auto name = const_name("type");
991
+ };
992
+ template <>
993
+ struct handle_type_name<capsule> {
994
+ static constexpr auto name = const_name("capsule");
995
+ };
996
+ template <>
997
+ struct handle_type_name<ellipsis> {
998
+ static constexpr auto name = const_name("ellipsis");
999
+ };
1000
+ template <>
1001
+ struct handle_type_name<weakref> {
1002
+ static constexpr auto name = const_name("weakref");
1003
+ };
1004
+ template <>
1005
+ struct handle_type_name<args> {
1006
+ static constexpr auto name = const_name("*args");
1007
+ };
1008
+ template <>
1009
+ struct handle_type_name<kwargs> {
1010
+ static constexpr auto name = const_name("**kwargs");
1011
+ };
1012
+ template <>
1013
+ struct handle_type_name<obj_attr_accessor> {
1014
+ static constexpr auto name = const_name<obj_attr_accessor>();
1015
+ };
1016
+ template <>
1017
+ struct handle_type_name<str_attr_accessor> {
1018
+ static constexpr auto name = const_name<str_attr_accessor>();
1019
+ };
1020
+ template <>
1021
+ struct handle_type_name<item_accessor> {
1022
+ static constexpr auto name = const_name<item_accessor>();
1023
+ };
1024
+ template <>
1025
+ struct handle_type_name<sequence_accessor> {
1026
+ static constexpr auto name = const_name<sequence_accessor>();
1027
+ };
1028
+ template <>
1029
+ struct handle_type_name<list_accessor> {
1030
+ static constexpr auto name = const_name<list_accessor>();
1031
+ };
1032
+ template <>
1033
+ struct handle_type_name<tuple_accessor> {
1034
+ static constexpr auto name = const_name<tuple_accessor>();
1035
+ };
1036
+
1037
+ template <typename type>
1038
+ struct pyobject_caster {
1039
+ template <typename T = type, enable_if_t<std::is_same<T, handle>::value, int> = 0>
1040
+ pyobject_caster() : value() {}
1041
+
1042
+ // `type` may not be default constructible (e.g. frozenset, anyset). Initializing `value`
1043
+ // to a nil handle is safe since it will only be accessed if `load` succeeds.
1044
+ template <typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>
1045
+ pyobject_caster() : value(reinterpret_steal<type>(handle())) {}
1046
+
1047
+ template <typename T = type, enable_if_t<std::is_same<T, handle>::value, int> = 0>
1048
+ bool load(handle src, bool /* convert */) {
1049
+ value = src;
1050
+ return static_cast<bool>(value);
1051
+ }
1052
+
1053
+ template <typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>
1054
+ bool load(handle src, bool /* convert */) {
1055
+ if (!isinstance<type>(src)) {
1056
+ return false;
1057
+ }
1058
+ value = reinterpret_borrow<type>(src);
1059
+ return true;
1060
+ }
1061
+
1062
+ static handle cast(const handle &src, return_value_policy /* policy */, handle /* parent */) {
1063
+ return src.inc_ref();
1064
+ }
1065
+ PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name);
1066
+ };
1067
+
1068
+ template <typename T>
1069
+ class type_caster<T, enable_if_t<is_pyobject<T>::value>> : public pyobject_caster<T> {};
1070
+
1071
+ // Our conditions for enabling moving are quite restrictive:
1072
+ // At compile time:
1073
+ // - T needs to be a non-const, non-pointer, non-reference type
1074
+ // - type_caster<T>::operator T&() must exist
1075
+ // - the type must be move constructible (obviously)
1076
+ // At run-time:
1077
+ // - if the type is non-copy-constructible, the object must be the sole owner of the type (i.e. it
1078
+ // must have ref_count() == 1)h
1079
+ // If any of the above are not satisfied, we fall back to copying.
1080
+ template <typename T>
1081
+ using move_is_plain_type
1082
+ = satisfies_none_of<T, std::is_void, std::is_pointer, std::is_reference, std::is_const>;
1083
+ template <typename T, typename SFINAE = void>
1084
+ struct move_always : std::false_type {};
1085
+ template <typename T>
1086
+ struct move_always<
1087
+ T,
1088
+ enable_if_t<
1089
+ all_of<move_is_plain_type<T>,
1090
+ negation<is_copy_constructible<T>>,
1091
+ is_move_constructible<T>,
1092
+ std::is_same<decltype(std::declval<make_caster<T>>().operator T &()), T &>>::value>>
1093
+ : std::true_type {};
1094
+ template <typename T, typename SFINAE = void>
1095
+ struct move_if_unreferenced : std::false_type {};
1096
+ template <typename T>
1097
+ struct move_if_unreferenced<
1098
+ T,
1099
+ enable_if_t<
1100
+ all_of<move_is_plain_type<T>,
1101
+ negation<move_always<T>>,
1102
+ is_move_constructible<T>,
1103
+ std::is_same<decltype(std::declval<make_caster<T>>().operator T &()), T &>>::value>>
1104
+ : std::true_type {};
1105
+ template <typename T>
1106
+ using move_never = none_of<move_always<T>, move_if_unreferenced<T>>;
1107
+
1108
+ // Detect whether returning a `type` from a cast on type's type_caster is going to result in a
1109
+ // reference or pointer to a local variable of the type_caster. Basically, only
1110
+ // non-reference/pointer `type`s and reference/pointers from a type_caster_generic are safe;
1111
+ // everything else returns a reference/pointer to a local variable.
1112
+ template <typename type>
1113
+ using cast_is_temporary_value_reference
1114
+ = bool_constant<(std::is_reference<type>::value || std::is_pointer<type>::value)
1115
+ && !std::is_base_of<type_caster_generic, make_caster<type>>::value
1116
+ && !std::is_same<intrinsic_t<type>, void>::value>;
1117
+
1118
+ // When a value returned from a C++ function is being cast back to Python, we almost always want to
1119
+ // force `policy = move`, regardless of the return value policy the function/method was declared
1120
+ // with.
1121
+ template <typename Return, typename SFINAE = void>
1122
+ struct return_value_policy_override {
1123
+ static return_value_policy policy(return_value_policy p) { return p; }
1124
+ };
1125
+
1126
+ template <typename Return>
1127
+ struct return_value_policy_override<
1128
+ Return,
1129
+ detail::enable_if_t<std::is_base_of<type_caster_generic, make_caster<Return>>::value, void>> {
1130
+ static return_value_policy policy(return_value_policy p) {
1131
+ return !std::is_lvalue_reference<Return>::value && !std::is_pointer<Return>::value
1132
+ ? return_value_policy::move
1133
+ : p;
1134
+ }
1135
+ };
1136
+
1137
+ // Basic python -> C++ casting; throws if casting fails
1138
+ template <typename T, typename SFINAE>
1139
+ type_caster<T, SFINAE> &load_type(type_caster<T, SFINAE> &conv, const handle &handle) {
1140
+ static_assert(!detail::is_pyobject<T>::value,
1141
+ "Internal error: type_caster should only be used for C++ types");
1142
+ if (!conv.load(handle, true)) {
1143
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1144
+ throw cast_error(
1145
+ "Unable to cast Python instance of type "
1146
+ + str(type::handle_of(handle)).cast<std::string>()
1147
+ + " to C++ type '?' (#define "
1148
+ "PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)");
1149
+ #else
1150
+ throw cast_error("Unable to cast Python instance of type "
1151
+ + str(type::handle_of(handle)).cast<std::string>() + " to C++ type '"
1152
+ + type_id<T>() + "'");
1153
+ #endif
1154
+ }
1155
+ return conv;
1156
+ }
1157
+ // Wrapper around the above that also constructs and returns a type_caster
1158
+ template <typename T>
1159
+ make_caster<T> load_type(const handle &handle) {
1160
+ make_caster<T> conv;
1161
+ load_type(conv, handle);
1162
+ return conv;
1163
+ }
1164
+
1165
+ PYBIND11_NAMESPACE_END(detail)
1166
+
1167
+ // pytype -> C++ type
1168
+ template <typename T,
1169
+ detail::enable_if_t<!detail::is_pyobject<T>::value
1170
+ && !detail::is_same_ignoring_cvref<T, PyObject *>::value,
1171
+ int>
1172
+ = 0>
1173
+ T cast(const handle &handle) {
1174
+ using namespace detail;
1175
+ static_assert(!cast_is_temporary_value_reference<T>::value,
1176
+ "Unable to cast type to reference: value is local to type caster");
1177
+ return cast_op<T>(load_type<T>(handle));
1178
+ }
1179
+
1180
+ // pytype -> pytype (calls converting constructor)
1181
+ template <typename T, detail::enable_if_t<detail::is_pyobject<T>::value, int> = 0>
1182
+ T cast(const handle &handle) {
1183
+ return T(reinterpret_borrow<object>(handle));
1184
+ }
1185
+
1186
+ // Note that `cast<PyObject *>(obj)` increments the reference count of `obj`.
1187
+ // This is necessary for the case that `obj` is a temporary, and could
1188
+ // not possibly be different, given
1189
+ // 1. the established convention that the passed `handle` is borrowed, and
1190
+ // 2. we don't want to force all generic code using `cast<T>()` to special-case
1191
+ // handling of `T` = `PyObject *` (to increment the reference count there).
1192
+ // It is the responsibility of the caller to ensure that the reference count
1193
+ // is decremented.
1194
+ template <typename T,
1195
+ typename Handle,
1196
+ detail::enable_if_t<detail::is_same_ignoring_cvref<T, PyObject *>::value
1197
+ && detail::is_same_ignoring_cvref<Handle, handle>::value,
1198
+ int>
1199
+ = 0>
1200
+ T cast(Handle &&handle) {
1201
+ return handle.inc_ref().ptr();
1202
+ }
1203
+ // To optimize way an inc_ref/dec_ref cycle:
1204
+ template <typename T,
1205
+ typename Object,
1206
+ detail::enable_if_t<detail::is_same_ignoring_cvref<T, PyObject *>::value
1207
+ && detail::is_same_ignoring_cvref<Object, object>::value,
1208
+ int>
1209
+ = 0>
1210
+ T cast(Object &&obj) {
1211
+ return obj.release().ptr();
1212
+ }
1213
+
1214
+ // C++ type -> py::object
1215
+ template <typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>
1216
+ object cast(T &&value,
1217
+ return_value_policy policy = return_value_policy::automatic_reference,
1218
+ handle parent = handle()) {
1219
+ using no_ref_T = typename std::remove_reference<T>::type;
1220
+ if (policy == return_value_policy::automatic) {
1221
+ policy = std::is_pointer<no_ref_T>::value ? return_value_policy::take_ownership
1222
+ : std::is_lvalue_reference<T>::value ? return_value_policy::copy
1223
+ : return_value_policy::move;
1224
+ } else if (policy == return_value_policy::automatic_reference) {
1225
+ policy = std::is_pointer<no_ref_T>::value ? return_value_policy::reference
1226
+ : std::is_lvalue_reference<T>::value ? return_value_policy::copy
1227
+ : return_value_policy::move;
1228
+ }
1229
+ return reinterpret_steal<object>(
1230
+ detail::make_caster<T>::cast(std::forward<T>(value), policy, parent));
1231
+ }
1232
+
1233
+ template <typename T>
1234
+ T handle::cast() const {
1235
+ return pybind11::cast<T>(*this);
1236
+ }
1237
+ template <>
1238
+ inline void handle::cast() const {
1239
+ return;
1240
+ }
1241
+
1242
+ template <typename T>
1243
+ detail::enable_if_t<!detail::move_never<T>::value, T> move(object &&obj) {
1244
+ if (obj.ref_count() > 1) {
1245
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1246
+ throw cast_error(
1247
+ "Unable to cast Python " + str(type::handle_of(obj)).cast<std::string>()
1248
+ + " instance to C++ rvalue: instance has multiple references"
1249
+ " (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)");
1250
+ #else
1251
+ throw cast_error("Unable to move from Python "
1252
+ + str(type::handle_of(obj)).cast<std::string>() + " instance to C++ "
1253
+ + type_id<T>() + " instance: instance has multiple references");
1254
+ #endif
1255
+ }
1256
+
1257
+ // Move into a temporary and return that, because the reference may be a local value of `conv`
1258
+ T ret = std::move(detail::load_type<T>(obj).operator T &());
1259
+ return ret;
1260
+ }
1261
+
1262
+ // Calling cast() on an rvalue calls pybind11::cast with the object rvalue, which does:
1263
+ // - If we have to move (because T has no copy constructor), do it. This will fail if the moved
1264
+ // object has multiple references, but trying to copy will fail to compile.
1265
+ // - If both movable and copyable, check ref count: if 1, move; otherwise copy
1266
+ // - Otherwise (not movable), copy.
1267
+ template <typename T>
1268
+ detail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_always<T>::value, T>
1269
+ cast(object &&object) {
1270
+ return move<T>(std::move(object));
1271
+ }
1272
+ template <typename T>
1273
+ detail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_if_unreferenced<T>::value, T>
1274
+ cast(object &&object) {
1275
+ if (object.ref_count() > 1) {
1276
+ return cast<T>(object);
1277
+ }
1278
+ return move<T>(std::move(object));
1279
+ }
1280
+ template <typename T>
1281
+ detail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_never<T>::value, T>
1282
+ cast(object &&object) {
1283
+ return cast<T>(object);
1284
+ }
1285
+
1286
+ // pytype rvalue -> pytype (calls converting constructor)
1287
+ template <typename T>
1288
+ detail::enable_if_t<detail::is_pyobject<T>::value, T> cast(object &&object) {
1289
+ return T(std::move(object));
1290
+ }
1291
+
1292
+ template <typename T>
1293
+ T object::cast() const & {
1294
+ return pybind11::cast<T>(*this);
1295
+ }
1296
+ template <typename T>
1297
+ T object::cast() && {
1298
+ return pybind11::cast<T>(std::move(*this));
1299
+ }
1300
+ template <>
1301
+ inline void object::cast() const & {
1302
+ return;
1303
+ }
1304
+ template <>
1305
+ inline void object::cast() && {
1306
+ return;
1307
+ }
1308
+
1309
+ PYBIND11_NAMESPACE_BEGIN(detail)
1310
+
1311
+ // Declared in pytypes.h:
1312
+ template <typename T, enable_if_t<!is_pyobject<T>::value, int>>
1313
+ object object_or_cast(T &&o) {
1314
+ return pybind11::cast(std::forward<T>(o));
1315
+ }
1316
+
1317
+ // Placeholder type for the unneeded (and dead code) static variable in the
1318
+ // PYBIND11_OVERRIDE_OVERRIDE macro
1319
+ struct override_unused {};
1320
+ template <typename ret_type>
1321
+ using override_caster_t = conditional_t<cast_is_temporary_value_reference<ret_type>::value,
1322
+ make_caster<ret_type>,
1323
+ override_unused>;
1324
+
1325
+ // Trampoline use: for reference/pointer types to value-converted values, we do a value cast, then
1326
+ // store the result in the given variable. For other types, this is a no-op.
1327
+ template <typename T>
1328
+ enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&o,
1329
+ make_caster<T> &caster) {
1330
+ return cast_op<T>(load_type(caster, o));
1331
+ }
1332
+ template <typename T>
1333
+ enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&,
1334
+ override_unused &) {
1335
+ pybind11_fail("Internal error: cast_ref fallback invoked");
1336
+ }
1337
+
1338
+ // Trampoline use: Having a pybind11::cast with an invalid reference type is going to
1339
+ // static_assert, even though if it's in dead code, so we provide a "trampoline" to pybind11::cast
1340
+ // that only does anything in cases where pybind11::cast is valid.
1341
+ template <typename T>
1342
+ enable_if_t<cast_is_temporary_value_reference<T>::value
1343
+ && !detail::is_same_ignoring_cvref<T, PyObject *>::value,
1344
+ T>
1345
+ cast_safe(object &&) {
1346
+ pybind11_fail("Internal error: cast_safe fallback invoked");
1347
+ }
1348
+ template <typename T>
1349
+ enable_if_t<std::is_void<T>::value, void> cast_safe(object &&) {}
1350
+ template <typename T>
1351
+ enable_if_t<detail::is_same_ignoring_cvref<T, PyObject *>::value, PyObject *>
1352
+ cast_safe(object &&o) {
1353
+ return o.release().ptr();
1354
+ }
1355
+ template <typename T>
1356
+ enable_if_t<detail::none_of<cast_is_temporary_value_reference<T>,
1357
+ detail::is_same_ignoring_cvref<T, PyObject *>,
1358
+ std::is_void<T>>::value,
1359
+ T>
1360
+ cast_safe(object &&o) {
1361
+ return pybind11::cast<T>(std::move(o));
1362
+ }
1363
+
1364
+ PYBIND11_NAMESPACE_END(detail)
1365
+
1366
+ // The overloads could coexist, i.e. the #if is not strictly speaking needed,
1367
+ // but it is an easy minor optimization.
1368
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1369
+ inline cast_error cast_error_unable_to_convert_call_arg(const std::string &name) {
1370
+ return cast_error("Unable to convert call argument '" + name
1371
+ + "' to Python object (#define "
1372
+ "PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)");
1373
+ }
1374
+ #else
1375
+ inline cast_error cast_error_unable_to_convert_call_arg(const std::string &name,
1376
+ const std::string &type) {
1377
+ return cast_error("Unable to convert call argument '" + name + "' of type '" + type
1378
+ + "' to Python object");
1379
+ }
1380
+ #endif
1381
+
1382
+ template <return_value_policy policy = return_value_policy::automatic_reference>
1383
+ tuple make_tuple() {
1384
+ return tuple(0);
1385
+ }
1386
+
1387
+ template <return_value_policy policy = return_value_policy::automatic_reference, typename... Args>
1388
+ tuple make_tuple(Args &&...args_) {
1389
+ constexpr size_t size = sizeof...(Args);
1390
+ std::array<object, size> args{{reinterpret_steal<object>(
1391
+ detail::make_caster<Args>::cast(std::forward<Args>(args_), policy, nullptr))...}};
1392
+ for (size_t i = 0; i < args.size(); i++) {
1393
+ if (!args[i]) {
1394
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1395
+ throw cast_error_unable_to_convert_call_arg(std::to_string(i));
1396
+ #else
1397
+ std::array<std::string, size> argtypes{{type_id<Args>()...}};
1398
+ throw cast_error_unable_to_convert_call_arg(std::to_string(i), argtypes[i]);
1399
+ #endif
1400
+ }
1401
+ }
1402
+ tuple result(size);
1403
+ int counter = 0;
1404
+ for (auto &arg_value : args) {
1405
+ PyTuple_SET_ITEM(result.ptr(), counter++, arg_value.release().ptr());
1406
+ }
1407
+ return result;
1408
+ }
1409
+
1410
+ /// \ingroup annotations
1411
+ /// Annotation for arguments
1412
+ struct arg {
1413
+ /// Constructs an argument with the name of the argument; if null or omitted, this is a
1414
+ /// positional argument.
1415
+ constexpr explicit arg(const char *name = nullptr)
1416
+ : name(name), flag_noconvert(false), flag_none(true) {}
1417
+ /// Assign a value to this argument
1418
+ template <typename T>
1419
+ arg_v operator=(T &&value) const;
1420
+ /// Indicate that the type should not be converted in the type caster
1421
+ arg &noconvert(bool flag = true) {
1422
+ flag_noconvert = flag;
1423
+ return *this;
1424
+ }
1425
+ /// Indicates that the argument should/shouldn't allow None (e.g. for nullable pointer args)
1426
+ arg &none(bool flag = true) {
1427
+ flag_none = flag;
1428
+ return *this;
1429
+ }
1430
+
1431
+ const char *name; ///< If non-null, this is a named kwargs argument
1432
+ bool flag_noconvert : 1; ///< If set, do not allow conversion (requires a supporting type
1433
+ ///< caster!)
1434
+ bool flag_none : 1; ///< If set (the default), allow None to be passed to this argument
1435
+ };
1436
+
1437
+ /// \ingroup annotations
1438
+ /// Annotation for arguments with values
1439
+ struct arg_v : arg {
1440
+ private:
1441
+ template <typename T>
1442
+ arg_v(arg &&base, T &&x, const char *descr = nullptr)
1443
+ : arg(base), value(reinterpret_steal<object>(detail::make_caster<T>::cast(
1444
+ std::forward<T>(x), return_value_policy::automatic, {}))),
1445
+ descr(descr)
1446
+ #if defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1447
+ ,
1448
+ type(type_id<T>())
1449
+ #endif
1450
+ {
1451
+ // Workaround! See:
1452
+ // https://github.com/pybind/pybind11/issues/2336
1453
+ // https://github.com/pybind/pybind11/pull/2685#issuecomment-731286700
1454
+ if (PyErr_Occurred()) {
1455
+ PyErr_Clear();
1456
+ }
1457
+ }
1458
+
1459
+ public:
1460
+ /// Direct construction with name, default, and description
1461
+ template <typename T>
1462
+ arg_v(const char *name, T &&x, const char *descr = nullptr)
1463
+ : arg_v(arg(name), std::forward<T>(x), descr) {}
1464
+
1465
+ /// Called internally when invoking `py::arg("a") = value`
1466
+ template <typename T>
1467
+ arg_v(const arg &base, T &&x, const char *descr = nullptr)
1468
+ : arg_v(arg(base), std::forward<T>(x), descr) {}
1469
+
1470
+ /// Same as `arg::noconvert()`, but returns *this as arg_v&, not arg&
1471
+ arg_v &noconvert(bool flag = true) {
1472
+ arg::noconvert(flag);
1473
+ return *this;
1474
+ }
1475
+
1476
+ /// Same as `arg::nonone()`, but returns *this as arg_v&, not arg&
1477
+ arg_v &none(bool flag = true) {
1478
+ arg::none(flag);
1479
+ return *this;
1480
+ }
1481
+
1482
+ /// The default value
1483
+ object value;
1484
+ /// The (optional) description of the default value
1485
+ const char *descr;
1486
+ #if defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1487
+ /// The C++ type name of the default value (only available when compiled in debug mode)
1488
+ std::string type;
1489
+ #endif
1490
+ };
1491
+
1492
+ /// \ingroup annotations
1493
+ /// Annotation indicating that all following arguments are keyword-only; the is the equivalent of
1494
+ /// an unnamed '*' argument
1495
+ struct kw_only {};
1496
+
1497
+ /// \ingroup annotations
1498
+ /// Annotation indicating that all previous arguments are positional-only; the is the equivalent of
1499
+ /// an unnamed '/' argument (in Python 3.8)
1500
+ struct pos_only {};
1501
+
1502
+ template <typename T>
1503
+ arg_v arg::operator=(T &&value) const {
1504
+ return {*this, std::forward<T>(value)};
1505
+ }
1506
+
1507
+ /// Alias for backward compatibility -- to be removed in version 2.0
1508
+ template <typename /*unused*/>
1509
+ using arg_t = arg_v;
1510
+
1511
+ inline namespace literals {
1512
+ /** \rst
1513
+ String literal version of `arg`
1514
+ \endrst */
1515
+ constexpr arg
1516
+ #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 5
1517
+ operator"" _a // gcc 4.8.5 insists on having a space (hard error).
1518
+ #else
1519
+ operator""_a // clang 17 generates a deprecation warning if there is a space.
1520
+ #endif
1521
+ (const char *name, size_t) {
1522
+ return arg(name);
1523
+ }
1524
+ } // namespace literals
1525
+
1526
+ PYBIND11_NAMESPACE_BEGIN(detail)
1527
+
1528
+ template <typename T>
1529
+ using is_kw_only = std::is_same<intrinsic_t<T>, kw_only>;
1530
+ template <typename T>
1531
+ using is_pos_only = std::is_same<intrinsic_t<T>, pos_only>;
1532
+
1533
+ // forward declaration (definition in attr.h)
1534
+ struct function_record;
1535
+
1536
+ /// Internal data associated with a single function call
1537
+ struct function_call {
1538
+ function_call(const function_record &f, handle p); // Implementation in attr.h
1539
+
1540
+ /// The function data:
1541
+ const function_record &func;
1542
+
1543
+ /// Arguments passed to the function:
1544
+ std::vector<handle> args;
1545
+
1546
+ /// The `convert` value the arguments should be loaded with
1547
+ std::vector<bool> args_convert;
1548
+
1549
+ /// Extra references for the optional `py::args` and/or `py::kwargs` arguments (which, if
1550
+ /// present, are also in `args` but without a reference).
1551
+ object args_ref, kwargs_ref;
1552
+
1553
+ /// The parent, if any
1554
+ handle parent;
1555
+
1556
+ /// If this is a call to an initializer, this argument contains `self`
1557
+ handle init_self;
1558
+ };
1559
+
1560
+ /// Helper class which loads arguments for C++ functions called from Python
1561
+ template <typename... Args>
1562
+ class argument_loader {
1563
+ using indices = make_index_sequence<sizeof...(Args)>;
1564
+
1565
+ template <typename Arg>
1566
+ using argument_is_args = std::is_same<intrinsic_t<Arg>, args>;
1567
+ template <typename Arg>
1568
+ using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>;
1569
+ // Get kwargs argument position, or -1 if not present:
1570
+ static constexpr auto kwargs_pos = constexpr_last<argument_is_kwargs, Args...>();
1571
+
1572
+ static_assert(kwargs_pos == -1 || kwargs_pos == (int) sizeof...(Args) - 1,
1573
+ "py::kwargs is only permitted as the last argument of a function");
1574
+
1575
+ public:
1576
+ static constexpr bool has_kwargs = kwargs_pos != -1;
1577
+
1578
+ // py::args argument position; -1 if not present.
1579
+ static constexpr int args_pos = constexpr_last<argument_is_args, Args...>();
1580
+
1581
+ static_assert(args_pos == -1 || args_pos == constexpr_first<argument_is_args, Args...>(),
1582
+ "py::args cannot be specified more than once");
1583
+
1584
+ static constexpr auto arg_names
1585
+ = ::pybind11::detail::concat(type_descr(make_caster<Args>::name)...);
1586
+
1587
+ bool load_args(function_call &call) { return load_impl_sequence(call, indices{}); }
1588
+
1589
+ template <typename Return, typename Guard, typename Func>
1590
+ // NOLINTNEXTLINE(readability-const-return-type)
1591
+ enable_if_t<!std::is_void<Return>::value, Return> call(Func &&f) && {
1592
+ return std::move(*this).template call_impl<remove_cv_t<Return>>(
1593
+ std::forward<Func>(f), indices{}, Guard{});
1594
+ }
1595
+
1596
+ template <typename Return, typename Guard, typename Func>
1597
+ enable_if_t<std::is_void<Return>::value, void_type> call(Func &&f) && {
1598
+ std::move(*this).template call_impl<remove_cv_t<Return>>(
1599
+ std::forward<Func>(f), indices{}, Guard{});
1600
+ return void_type();
1601
+ }
1602
+
1603
+ private:
1604
+ static bool load_impl_sequence(function_call &, index_sequence<>) { return true; }
1605
+
1606
+ template <size_t... Is>
1607
+ bool load_impl_sequence(function_call &call, index_sequence<Is...>) {
1608
+ #ifdef __cpp_fold_expressions
1609
+ if ((... || !std::get<Is>(argcasters).load(call.args[Is], call.args_convert[Is]))) {
1610
+ return false;
1611
+ }
1612
+ #else
1613
+ for (bool r : {std::get<Is>(argcasters).load(call.args[Is], call.args_convert[Is])...}) {
1614
+ if (!r) {
1615
+ return false;
1616
+ }
1617
+ }
1618
+ #endif
1619
+ return true;
1620
+ }
1621
+
1622
+ template <typename Return, typename Func, size_t... Is, typename Guard>
1623
+ Return call_impl(Func &&f, index_sequence<Is...>, Guard &&) && {
1624
+ return std::forward<Func>(f)(cast_op<Args>(std::move(std::get<Is>(argcasters)))...);
1625
+ }
1626
+
1627
+ std::tuple<make_caster<Args>...> argcasters;
1628
+ };
1629
+
1630
+ /// Helper class which collects only positional arguments for a Python function call.
1631
+ /// A fancier version below can collect any argument, but this one is optimal for simple calls.
1632
+ template <return_value_policy policy>
1633
+ class simple_collector {
1634
+ public:
1635
+ template <typename... Ts>
1636
+ explicit simple_collector(Ts &&...values)
1637
+ : m_args(pybind11::make_tuple<policy>(std::forward<Ts>(values)...)) {}
1638
+
1639
+ const tuple &args() const & { return m_args; }
1640
+ dict kwargs() const { return {}; }
1641
+
1642
+ tuple args() && { return std::move(m_args); }
1643
+
1644
+ /// Call a Python function and pass the collected arguments
1645
+ object call(PyObject *ptr) const {
1646
+ PyObject *result = PyObject_CallObject(ptr, m_args.ptr());
1647
+ if (!result) {
1648
+ throw error_already_set();
1649
+ }
1650
+ return reinterpret_steal<object>(result);
1651
+ }
1652
+
1653
+ private:
1654
+ tuple m_args;
1655
+ };
1656
+
1657
+ /// Helper class which collects positional, keyword, * and ** arguments for a Python function call
1658
+ template <return_value_policy policy>
1659
+ class unpacking_collector {
1660
+ public:
1661
+ template <typename... Ts>
1662
+ explicit unpacking_collector(Ts &&...values) {
1663
+ // Tuples aren't (easily) resizable so a list is needed for collection,
1664
+ // but the actual function call strictly requires a tuple.
1665
+ auto args_list = list();
1666
+ using expander = int[];
1667
+ (void) expander{0, (process(args_list, std::forward<Ts>(values)), 0)...};
1668
+
1669
+ m_args = std::move(args_list);
1670
+ }
1671
+
1672
+ const tuple &args() const & { return m_args; }
1673
+ const dict &kwargs() const & { return m_kwargs; }
1674
+
1675
+ tuple args() && { return std::move(m_args); }
1676
+ dict kwargs() && { return std::move(m_kwargs); }
1677
+
1678
+ /// Call a Python function and pass the collected arguments
1679
+ object call(PyObject *ptr) const {
1680
+ PyObject *result = PyObject_Call(ptr, m_args.ptr(), m_kwargs.ptr());
1681
+ if (!result) {
1682
+ throw error_already_set();
1683
+ }
1684
+ return reinterpret_steal<object>(result);
1685
+ }
1686
+
1687
+ private:
1688
+ template <typename T>
1689
+ void process(list &args_list, T &&x) {
1690
+ auto o = reinterpret_steal<object>(
1691
+ detail::make_caster<T>::cast(std::forward<T>(x), policy, {}));
1692
+ if (!o) {
1693
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1694
+ throw cast_error_unable_to_convert_call_arg(std::to_string(args_list.size()));
1695
+ #else
1696
+ throw cast_error_unable_to_convert_call_arg(std::to_string(args_list.size()),
1697
+ type_id<T>());
1698
+ #endif
1699
+ }
1700
+ args_list.append(std::move(o));
1701
+ }
1702
+
1703
+ void process(list &args_list, detail::args_proxy ap) {
1704
+ for (auto a : ap) {
1705
+ args_list.append(a);
1706
+ }
1707
+ }
1708
+
1709
+ void process(list & /*args_list*/, arg_v a) {
1710
+ if (!a.name) {
1711
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1712
+ nameless_argument_error();
1713
+ #else
1714
+ nameless_argument_error(a.type);
1715
+ #endif
1716
+ }
1717
+ if (m_kwargs.contains(a.name)) {
1718
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1719
+ multiple_values_error();
1720
+ #else
1721
+ multiple_values_error(a.name);
1722
+ #endif
1723
+ }
1724
+ if (!a.value) {
1725
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1726
+ throw cast_error_unable_to_convert_call_arg(a.name);
1727
+ #else
1728
+ throw cast_error_unable_to_convert_call_arg(a.name, a.type);
1729
+ #endif
1730
+ }
1731
+ m_kwargs[a.name] = std::move(a.value);
1732
+ }
1733
+
1734
+ void process(list & /*args_list*/, detail::kwargs_proxy kp) {
1735
+ if (!kp) {
1736
+ return;
1737
+ }
1738
+ for (auto k : reinterpret_borrow<dict>(kp)) {
1739
+ if (m_kwargs.contains(k.first)) {
1740
+ #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)
1741
+ multiple_values_error();
1742
+ #else
1743
+ multiple_values_error(str(k.first));
1744
+ #endif
1745
+ }
1746
+ m_kwargs[k.first] = k.second;
1747
+ }
1748
+ }
1749
+
1750
+ [[noreturn]] static void nameless_argument_error() {
1751
+ throw type_error(
1752
+ "Got kwargs without a name; only named arguments "
1753
+ "may be passed via py::arg() to a python function call. "
1754
+ "(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)");
1755
+ }
1756
+ [[noreturn]] static void nameless_argument_error(const std::string &type) {
1757
+ throw type_error("Got kwargs without a name of type '" + type
1758
+ + "'; only named "
1759
+ "arguments may be passed via py::arg() to a python function call. ");
1760
+ }
1761
+ [[noreturn]] static void multiple_values_error() {
1762
+ throw type_error(
1763
+ "Got multiple values for keyword argument "
1764
+ "(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)");
1765
+ }
1766
+
1767
+ [[noreturn]] static void multiple_values_error(const std::string &name) {
1768
+ throw type_error("Got multiple values for keyword argument '" + name + "'");
1769
+ }
1770
+
1771
+ private:
1772
+ tuple m_args;
1773
+ dict m_kwargs;
1774
+ };
1775
+
1776
+ // [workaround(intel)] Separate function required here
1777
+ // We need to put this into a separate function because the Intel compiler
1778
+ // fails to compile enable_if_t<!all_of<is_positional<Args>...>::value>
1779
+ // (tested with ICC 2021.1 Beta 20200827).
1780
+ template <typename... Args>
1781
+ constexpr bool args_are_all_positional() {
1782
+ return all_of<is_positional<Args>...>::value;
1783
+ }
1784
+
1785
+ /// Collect only positional arguments for a Python function call
1786
+ template <return_value_policy policy,
1787
+ typename... Args,
1788
+ typename = enable_if_t<args_are_all_positional<Args...>()>>
1789
+ simple_collector<policy> collect_arguments(Args &&...args) {
1790
+ return simple_collector<policy>(std::forward<Args>(args)...);
1791
+ }
1792
+
1793
+ /// Collect all arguments, including keywords and unpacking (only instantiated when needed)
1794
+ template <return_value_policy policy,
1795
+ typename... Args,
1796
+ typename = enable_if_t<!args_are_all_positional<Args...>()>>
1797
+ unpacking_collector<policy> collect_arguments(Args &&...args) {
1798
+ // Following argument order rules for generalized unpacking according to PEP 448
1799
+ static_assert(constexpr_last<is_positional, Args...>()
1800
+ < constexpr_first<is_keyword_or_ds, Args...>()
1801
+ && constexpr_last<is_s_unpacking, Args...>()
1802
+ < constexpr_first<is_ds_unpacking, Args...>(),
1803
+ "Invalid function call: positional args must precede keywords and ** unpacking; "
1804
+ "* unpacking must precede ** unpacking");
1805
+ return unpacking_collector<policy>(std::forward<Args>(args)...);
1806
+ }
1807
+
1808
+ template <typename Derived>
1809
+ template <return_value_policy policy, typename... Args>
1810
+ object object_api<Derived>::operator()(Args &&...args) const {
1811
+ #ifndef NDEBUG
1812
+ if (!PyGILState_Check()) {
1813
+ pybind11_fail("pybind11::object_api<>::operator() PyGILState_Check() failure.");
1814
+ }
1815
+ #endif
1816
+ return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
1817
+ }
1818
+
1819
+ template <typename Derived>
1820
+ template <return_value_policy policy, typename... Args>
1821
+ object object_api<Derived>::call(Args &&...args) const {
1822
+ return operator()<policy>(std::forward<Args>(args)...);
1823
+ }
1824
+
1825
+ PYBIND11_NAMESPACE_END(detail)
1826
+
1827
+ template <typename T>
1828
+ handle type::handle_of() {
1829
+ static_assert(std::is_base_of<detail::type_caster_generic, detail::make_caster<T>>::value,
1830
+ "py::type::of<T> only supports the case where T is a registered C++ types.");
1831
+
1832
+ return detail::get_type_handle(typeid(T), true);
1833
+ }
1834
+
1835
+ #define PYBIND11_MAKE_OPAQUE(...) \
1836
+ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) \
1837
+ namespace detail { \
1838
+ template <> \
1839
+ class type_caster<__VA_ARGS__> : public type_caster_base<__VA_ARGS__> {}; \
1840
+ } \
1841
+ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
1842
+
1843
+ /// Lets you pass a type containing a `,` through a macro parameter without needing a separate
1844
+ /// typedef, e.g.:
1845
+ /// `PYBIND11_OVERRIDE(PYBIND11_TYPE(ReturnType<A, B>), PYBIND11_TYPE(Parent<C, D>), f, arg)`
1846
+ #define PYBIND11_TYPE(...) __VA_ARGS__
1847
+
1848
+ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)