@react-native-ohos/react-native-mmkv 3.3.1-rc.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 (1114) 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/README.md +354 -0
  76. package/README.md +5 -0
  77. package/cpp/MMKVManagedBuffer.h +32 -0
  78. package/cpp/MmkvHostObject.cpp +355 -0
  79. package/cpp/MmkvHostObject.h +32 -0
  80. package/cpp/MmkvLogger.h +35 -0
  81. package/cpp/NativeMmkvModule.cpp +43 -0
  82. package/cpp/NativeMmkvModule.h +38 -0
  83. package/harmony/reactNativeMMKV/BuildProfile.ets +17 -0
  84. package/harmony/reactNativeMMKV/LICENSE +20 -0
  85. package/harmony/reactNativeMMKV/NOTICE +34 -0
  86. package/harmony/reactNativeMMKV/README.OpenSource +11 -0
  87. package/harmony/reactNativeMMKV/build-profile.json5 +9 -0
  88. package/harmony/reactNativeMMKV/hvigorfile.ts +6 -0
  89. package/harmony/reactNativeMMKV/index.ets +24 -0
  90. package/harmony/reactNativeMMKV/oh-package.json5 +15 -0
  91. package/harmony/reactNativeMMKV/src/main/cpp/CMakeLists.txt +15 -0
  92. package/harmony/reactNativeMMKV/src/main/cpp/ComponentDescriptors.h +39 -0
  93. package/harmony/reactNativeMMKV/src/main/cpp/EventEmitters.cpp +41 -0
  94. package/harmony/reactNativeMMKV/src/main/cpp/EventEmitters.h +182 -0
  95. package/harmony/reactNativeMMKV/src/main/cpp/HarmonyLogger.cpp +32 -0
  96. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.clang-format +36 -0
  97. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.dockerignore +2 -0
  98. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.github/FUNDING.yml +14 -0
  99. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.github/ISSUE_TEMPLATE/bug_report.md +45 -0
  100. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/.gitmodules +3 -0
  101. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/build.gradle +54 -0
  102. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/checkstyle.xml +156 -0
  103. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/debug.keystore +0 -0
  104. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/android-publish-private.gradle +207 -0
  105. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/android-publish.gradle +276 -0
  106. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/build_library.gradle +62 -0
  107. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/check.gradle +76 -0
  108. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/wrapper/gradle-wrapper.jar +0 -0
  109. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle/wrapper/gradle-wrapper.properties +6 -0
  110. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradle.properties +25 -0
  111. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradlew +172 -0
  112. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/gradlew.bat +84 -0
  113. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/CMakeLists.txt +56 -0
  114. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/build.gradle +238 -0
  115. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/gradle.properties +2 -0
  116. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/proguard-rules.pro +9 -0
  117. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/AndroidManifest.xml +11 -0
  118. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/java/com/tencent/mmkv/MMKVTest.java +270 -0
  119. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/androidTest/java/com/tencent/mmkv/MMKVTestService.java +79 -0
  120. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/AndroidManifest.xml +3 -0
  121. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/aidl/com/tencent/mmkv/ParcelableMMKV.aidl +4 -0
  122. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/cpp/flutter-bridge.cpp +706 -0
  123. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/cpp/native-bridge.cpp +1244 -0
  124. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKV.java +2024 -0
  125. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVContentChangeNotification.java +34 -0
  126. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVContentProvider.java +174 -0
  127. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVHandler.java +63 -0
  128. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVLogLevel.java +52 -0
  129. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVProcessUtil.java +100 -0
  130. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKVRecoverStrategic.java +36 -0
  131. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/NameSpace.java +214 -0
  132. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/NativeBuffer.java +36 -0
  133. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/ParcelableMMKV.java +108 -0
  134. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/UnsupportedArchitectureException.java +27 -0
  135. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/build.gradle +34 -0
  136. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/src/main/AndroidManifest.xml +3 -0
  137. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvannotation/src/main/java/dalvik/annotation/optimization/FastNative.java +104 -0
  138. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/build.gradle +116 -0
  139. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/proguard-rules.pro +24 -0
  140. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/AndroidManifest.xml +54 -0
  141. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/aidl/com/tencent/mmkvdemo/IAshmemMMKV.aidl +8 -0
  142. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/cpp/CMakeLists.txt +50 -0
  143. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/cpp/mmkvdemo.cpp +245 -0
  144. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/Baseline.java +297 -0
  145. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/BenchMarkBaseService.java +363 -0
  146. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/FakeInfo.java +67 -0
  147. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/Info.java +69 -0
  148. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MainActivity.java +1029 -0
  149. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MultiProcessSharedPreferences.java +710 -0
  150. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyApplication.java +130 -0
  151. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyService.java +105 -0
  152. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/MyService_1.java +92 -0
  153. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/SQLiteKV.java +143 -0
  154. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/java/com/tencent/mmkvdemo/TestParcelable.java +70 -0
  155. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/kotlin/KotlinUsecase.kt +67 -0
  156. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/drawable/ic_launcher_background.xml +170 -0
  157. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
  158. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/layout/activity_main.xml +76 -0
  159. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  160. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  161. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  162. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  163. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  164. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  165. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  166. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  167. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  168. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  169. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  170. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  171. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/colors.xml +6 -0
  172. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/strings.xml +3 -0
  173. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/mmkvdemo/src/main/res/values/styles.xml +11 -0
  174. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/pmd-ruleset.xml +44 -0
  175. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/proguard-rules/proguard-rules-android-lib.pro +54 -0
  176. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/proguard-rules/proguard-rules-test.pro +6 -0
  177. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Android/MMKV/settings.gradle +3 -0
  178. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CHANGELOG.md +979 -0
  179. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CODE_OF_CONDUCT.md +76 -0
  180. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/CONTRIBUTING.md +61 -0
  181. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CMakeLists.txt +207 -0
  182. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData.cpp +248 -0
  183. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData.h +86 -0
  184. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt.cpp +276 -0
  185. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt.h +86 -0
  186. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputDataCrypt_OSX.cpp +62 -0
  187. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedInputData_OSX.cpp +92 -0
  188. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedOutputData.cpp +182 -0
  189. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/CodedOutputData.h +86 -0
  190. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.pbxproj +703 -0
  191. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  192. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  193. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +67 -0
  194. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/Core.xcodeproj/xcshareddata/xcschemes/MMKVWatchCore.xcscheme +67 -0
  195. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock.cpp +211 -0
  196. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock.h +124 -0
  197. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock_Android.cpp +104 -0
  198. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/InterProcessLock_Win32.cpp +108 -0
  199. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/KeyValueHolder.cpp +237 -0
  200. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/KeyValueHolder.h +122 -0
  201. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMBuffer.cpp +207 -0
  202. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMBuffer.h +119 -0
  203. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV.cpp +1791 -0
  204. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV.h +781 -0
  205. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog.cpp +127 -0
  206. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog.h +86 -0
  207. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVLog_Android.cpp +134 -0
  208. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVMetaInfo.hpp +99 -0
  209. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKVPredef.h +310 -0
  210. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_Android.cpp +365 -0
  211. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_IO.cpp +2049 -0
  212. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_IO.h +85 -0
  213. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_OSX.cpp +589 -0
  214. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MMKV_OSX.h +30 -0
  215. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile.cpp +716 -0
  216. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile.h +212 -0
  217. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Android.cpp +247 -0
  218. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Linux.cpp +126 -0
  219. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_OSX.cpp +173 -0
  220. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MemoryFile_Win32.cpp +655 -0
  221. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder.cpp +668 -0
  222. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder.h +150 -0
  223. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/MiniPBCoder_OSX.cpp +237 -0
  224. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBEncodeItem.hpp +102 -0
  225. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBUtility.cpp +61 -0
  226. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/PBUtility.h +148 -0
  227. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ScopedLock.hpp +69 -0
  228. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock.cpp +75 -0
  229. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock.h +81 -0
  230. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/ThreadLock_Win32.cpp +89 -0
  231. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/AESCrypt.cpp +293 -0
  232. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/AESCrypt.h +117 -0
  233. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes.h +98 -0
  234. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes_core.cpp +1044 -0
  235. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aes_locl.h +38 -0
  236. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_aesv8-armx.S +308 -0
  237. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_arm_arch.h +84 -0
  238. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_cfb128.cpp +97 -0
  239. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md32_common.h +254 -0
  240. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5.h +49 -0
  241. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_dgst.cpp +166 -0
  242. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_locl.h +75 -0
  243. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_md5_one.cpp +30 -0
  244. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/aes/openssl/openssl_opensslconf.h +271 -0
  245. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/core.vcxproj +288 -0
  246. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/core.vcxproj.filters +150 -0
  247. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/CMakeLists.txt +60 -0
  248. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/Checksum.h +76 -0
  249. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/crc32_armv8.cpp +134 -0
  250. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/crc32.cpp +55 -0
  251. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/crc32.h +48 -0
  252. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/zconf.h +380 -0
  253. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Core/crc32/zlib/zutil.h +25 -0
  254. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Dockerfile +25 -0
  255. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/LICENSE.TXT +193 -0
  256. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.podspec +40 -0
  257. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.xcworkspace/contents.xcworkspacedata +10 -0
  258. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKV.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  259. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVAppExtension.podspec +37 -0
  260. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVCore.podspec +47 -0
  261. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/MMKVWatchExtension.podspec +38 -0
  262. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Makefile +10 -0
  263. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/app.json5 +10 -0
  264. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/resources/base/element/string.json +8 -0
  265. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/AppScope/resources/base/media/app_icon.png +0 -0
  266. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/BuildProfile.ets +17 -0
  267. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/CHANGELOG.md +75 -0
  268. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/Index.ets +4 -0
  269. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/LICENSE +193 -0
  270. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/README.md +208 -0
  271. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/build-profile.json5 +40 -0
  272. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/consumer-rules.txt +61 -0
  273. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/example/Index.ets +686 -0
  274. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/example/Util.ets +31 -0
  275. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/hvigorfile.ts +6 -0
  276. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/obfuscation-rules.txt +18 -0
  277. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/oh-package.json5 +22 -0
  278. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/CMakeLists.txt +43 -0
  279. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/flutter-bridge.cpp +703 -0
  280. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/native_bridge.cpp +1840 -0
  281. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/types/libmmkv/index.d.ts +80 -0
  282. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/cpp/types/libmmkv/oh-package.json5 +6 -0
  283. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKV.ets +1073 -0
  284. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKVHandler.ets +111 -0
  285. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/MMKVLogLevel.ets +50 -0
  286. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/NativeBuffer.ets +34 -0
  287. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/ets/utils/Util.ts +24 -0
  288. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/MMKV/src/main/module.json5 +12 -0
  289. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/build-profile.json5 +62 -0
  290. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/dependencies/hvigor-4.3.0.tgz +0 -0
  291. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/dependencies/hvigor-ohos-plugin-4.3.0.tgz +0 -0
  292. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/build-profile.json5 +39 -0
  293. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/hvigorfile.ts +6 -0
  294. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/obfuscation-rules.txt +25 -0
  295. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/oh-package.json5 +13 -0
  296. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/CMakeLists.txt +54 -0
  297. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/napi_init.cpp +233 -0
  298. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/types/libentry/index.d.ts +1 -0
  299. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/cpp/types/libentry/oh-package.json5 +6 -0
  300. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/Baseline.ets +188 -0
  301. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/MyMMKVHandler.ets +76 -0
  302. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/Util/Util.ets +220 -0
  303. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/entryability/EntryAbility.ets +107 -0
  304. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/pages/Index.ets +766 -0
  305. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/ets/process/DemoProcess.ets +31 -0
  306. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/module.json5 +38 -0
  307. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/element/color.json +8 -0
  308. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/element/string.json +16 -0
  309. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/background.png +0 -0
  310. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/foreground.png +0 -0
  311. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/layered_image.json +7 -0
  312. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/media/startIcon.png +0 -0
  313. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
  314. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/en_US/element/string.json +16 -0
  315. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/main/resources/zh_CN/element/string.json +16 -0
  316. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/mock/mock-config.json5 +2 -0
  317. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/test/Ability.test.ets +55 -0
  318. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/test/List.test.ets +25 -0
  319. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testability/TestAbility.ets +67 -0
  320. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testability/pages/Index.ets +37 -0
  321. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +110 -0
  322. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/module.json5 +38 -0
  323. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/element/color.json +8 -0
  324. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/element/string.json +16 -0
  325. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/media/icon.png +0 -0
  326. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/ohosTest/resources/base/profile/test_pages.json +5 -0
  327. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/test/List.test.ets +25 -0
  328. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/entry/src/test/LocalUnit.test.ets +53 -0
  329. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/hvigor/hvigor-config.json5 +21 -0
  330. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/hvigorfile.ts +6 -0
  331. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/OpenHarmony/oh-package.json5 +15 -0
  332. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/CMakeLists.txt +27 -0
  333. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/CMakeLists.txt +65 -0
  334. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/TestInterProcessLock.cpp +130 -0
  335. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/UnitTest.cpp +272 -0
  336. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/demo.cpp +1431 -0
  337. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/demo/process.cpp +78 -0
  338. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/CMakeLists.txt +87 -0
  339. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/callback.go +121 -0
  340. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/go.mod +3 -0
  341. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/golang-bridge.cpp +731 -0
  342. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/golang-bridge.h +131 -0
  343. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/mmkv.go +817 -0
  344. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/mmkv_test.go +33 -0
  345. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/test/go.mod +7 -0
  346. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/golang/test/main.go +455 -0
  347. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/src/CMakeLists.txt +83 -0
  348. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/POSIX/src/libmmkv.cpp +21 -0
  349. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/CMakeLists.txt +62 -0
  350. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/README.md +6 -0
  351. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/demo.py +368 -0
  352. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/libmmkv_python.cpp +454 -0
  353. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.appveyor.yml +35 -0
  354. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.clang-format +38 -0
  355. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.clang-tidy +77 -0
  356. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.cmake-format.yaml +73 -0
  357. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.codespell-ignore-lines +24 -0
  358. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.gitattributes +1 -0
  359. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/CODEOWNERS +9 -0
  360. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/CONTRIBUTING.md +388 -0
  361. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +61 -0
  362. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/ISSUE_TEMPLATE/config.yml +8 -0
  363. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/dependabot.yml +15 -0
  364. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/labeler.yml +13 -0
  365. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/labeler_merged.yml +8 -0
  366. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/matchers/pylint.json +32 -0
  367. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/pull_request_template.md +19 -0
  368. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/ci.yml +1233 -0
  369. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/configure.yml +92 -0
  370. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/format.yml +60 -0
  371. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/labeler.yml +25 -0
  372. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/pip.yml +117 -0
  373. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.github/workflows/upstream.yml +116 -0
  374. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.pre-commit-config.yaml +156 -0
  375. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/.readthedocs.yml +20 -0
  376. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/CMakeLists.txt +375 -0
  377. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/LICENSE +29 -0
  378. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/MANIFEST.in +6 -0
  379. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/README.rst +181 -0
  380. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/SECURITY.md +13 -0
  381. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/Doxyfile +21 -0
  382. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/_static/css/custom.css +3 -0
  383. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/chrono.rst +81 -0
  384. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/custom.rst +93 -0
  385. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/eigen.rst +310 -0
  386. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/functional.rst +109 -0
  387. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/index.rst +43 -0
  388. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/overview.rst +170 -0
  389. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/stl.rst +249 -0
  390. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/cast/strings.rst +296 -0
  391. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/classes.rst +1335 -0
  392. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/embedding.rst +262 -0
  393. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/exceptions.rst +401 -0
  394. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/functions.rst +614 -0
  395. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/misc.rst +429 -0
  396. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/index.rst +13 -0
  397. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/numpy.rst +453 -0
  398. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/object.rst +286 -0
  399. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/pycpp/utilities.rst +155 -0
  400. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/advanced/smart_ptrs.rst +174 -0
  401. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/basics.rst +307 -0
  402. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/benchmark.py +89 -0
  403. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/benchmark.rst +95 -0
  404. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/changelog.rst +3121 -0
  405. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/classes.rst +555 -0
  406. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/cmake/index.rst +8 -0
  407. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/compiling.rst +726 -0
  408. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/conf.py +369 -0
  409. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/faq.rst +308 -0
  410. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/index.rst +48 -0
  411. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/installing.rst +105 -0
  412. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/limitations.rst +72 -0
  413. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11-logo.png +0 -0
  414. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  415. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python1.svg +427 -0
  416. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  417. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/pybind11_vs_boost_python2.svg +427 -0
  418. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/reference.rst +130 -0
  419. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/release.rst +143 -0
  420. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/requirements.in +6 -0
  421. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/requirements.txt +275 -0
  422. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/docs/upgrade.rst +594 -0
  423. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/attr.h +690 -0
  424. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/buffer_info.h +208 -0
  425. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/cast.h +1848 -0
  426. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/chrono.h +225 -0
  427. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/common.h +2 -0
  428. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/complex.h +74 -0
  429. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/class.h +754 -0
  430. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/common.h +1268 -0
  431. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/descr.h +172 -0
  432. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/init.h +434 -0
  433. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/internals.h +749 -0
  434. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/type_caster_base.h +1214 -0
  435. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/detail/typeid.h +65 -0
  436. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/common.h +9 -0
  437. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/matrix.h +714 -0
  438. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen/tensor.h +517 -0
  439. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eigen.h +12 -0
  440. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/embed.h +313 -0
  441. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/eval.h +156 -0
  442. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/functional.h +138 -0
  443. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/gil.h +219 -0
  444. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/gil_safe_call_once.h +91 -0
  445. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/iostream.h +265 -0
  446. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/numpy.h +2135 -0
  447. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/operators.h +202 -0
  448. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/options.h +92 -0
  449. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/pybind11.h +3026 -0
  450. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/pytypes.h +2604 -0
  451. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl/filesystem.h +115 -0
  452. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl.h +448 -0
  453. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/stl_bind.h +822 -0
  454. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/type_caster_pyobject_ptr.h +61 -0
  455. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/include/pybind11/typing.h +239 -0
  456. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/noxfile.py +107 -0
  457. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/__init__.py +19 -0
  458. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/__main__.py +63 -0
  459. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/_version.py +12 -0
  460. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/commands.py +39 -0
  461. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/py.typed +0 -0
  462. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pybind11/setup_helpers.py +500 -0
  463. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/pyproject.toml +87 -0
  464. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/setup.cfg +43 -0
  465. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/setup.py +149 -0
  466. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/CMakeLists.txt +589 -0
  467. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/conftest.py +224 -0
  468. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/constructor_stats.h +322 -0
  469. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/cross_module_gil_utils.cpp +111 -0
  470. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/cross_module_interleaved_error_already_set.cpp +54 -0
  471. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/eigen_tensor_avoid_stl_array.cpp +16 -0
  472. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/env.py +31 -0
  473. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_python_package/pytest.ini +0 -0
  474. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_python_package/test_files.py +296 -0
  475. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  476. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/extra_setuptools/test_setuphelper.py +153 -0
  477. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/local_bindings.h +92 -0
  478. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/object.h +205 -0
  479. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_cross_module_tests.cpp +149 -0
  480. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_tests.cpp +131 -0
  481. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pybind11_tests.h +98 -0
  482. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/pytest.ini +23 -0
  483. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/requirements.txt +13 -0
  484. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_async.cpp +25 -0
  485. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_async.py +26 -0
  486. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_buffers.cpp +259 -0
  487. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_buffers.py +230 -0
  488. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_builtin_casters.cpp +387 -0
  489. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_builtin_casters.py +530 -0
  490. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_call_policies.cpp +113 -0
  491. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_call_policies.py +249 -0
  492. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_callbacks.cpp +280 -0
  493. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_callbacks.py +227 -0
  494. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_chrono.cpp +81 -0
  495. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_chrono.py +207 -0
  496. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_class.cpp +656 -0
  497. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_class.py +503 -0
  498. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/CMakeLists.txt +80 -0
  499. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/embed.cpp +23 -0
  500. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +28 -0
  501. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +39 -0
  502. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +46 -0
  503. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/main.cpp +6 -0
  504. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +47 -0
  505. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +41 -0
  506. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +47 -0
  507. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_cmake_build/test.py +10 -0
  508. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_const_name.cpp +55 -0
  509. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_const_name.py +31 -0
  510. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_constants_and_functions.cpp +158 -0
  511. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_constants_and_functions.py +58 -0
  512. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_copy_move.cpp +544 -0
  513. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_copy_move.py +140 -0
  514. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_casters.cpp +217 -0
  515. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_casters.py +124 -0
  516. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_setup.cpp +41 -0
  517. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_custom_type_setup.py +50 -0
  518. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_docstring_options.cpp +129 -0
  519. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_docstring_options.py +66 -0
  520. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_matrix.cpp +443 -0
  521. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_matrix.py +816 -0
  522. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.cpp +18 -0
  523. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.inl +332 -0
  524. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eigen_tensor.py +290 -0
  525. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/CMakeLists.txt +54 -0
  526. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/catch.cpp +43 -0
  527. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/external_module.cpp +20 -0
  528. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_interpreter.cpp +488 -0
  529. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_interpreter.py +16 -0
  530. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_embed/test_trampoline.py +18 -0
  531. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_enum.cpp +133 -0
  532. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_enum.py +270 -0
  533. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval.cpp +118 -0
  534. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval.py +52 -0
  535. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_eval_call.py +5 -0
  536. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.cpp +388 -0
  537. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.h +13 -0
  538. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_exceptions.py +434 -0
  539. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_factory_constructors.cpp +430 -0
  540. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_factory_constructors.py +518 -0
  541. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_gil_scoped.cpp +144 -0
  542. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_gil_scoped.py +244 -0
  543. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_iostream.cpp +126 -0
  544. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_iostream.py +293 -0
  545. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_kwargs_and_defaults.cpp +325 -0
  546. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_kwargs_and_defaults.py +428 -0
  547. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_local_bindings.cpp +106 -0
  548. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_local_bindings.py +259 -0
  549. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_methods_and_attributes.cpp +492 -0
  550. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_methods_and_attributes.py +539 -0
  551. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_modules.cpp +125 -0
  552. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_modules.py +118 -0
  553. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_multiple_inheritance.cpp +341 -0
  554. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_multiple_inheritance.py +495 -0
  555. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_array.cpp +547 -0
  556. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_array.py +672 -0
  557. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_dtypes.cpp +639 -0
  558. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_dtypes.py +448 -0
  559. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_vectorize.cpp +107 -0
  560. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_numpy_vectorize.py +268 -0
  561. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_opaque_types.cpp +77 -0
  562. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_opaque_types.py +60 -0
  563. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_operator_overloading.cpp +281 -0
  564. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_operator_overloading.py +153 -0
  565. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pickling.cpp +194 -0
  566. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pickling.py +95 -0
  567. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_python_multiple_inheritance.cpp +45 -0
  568. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_python_multiple_inheritance.py +36 -0
  569. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pytypes.cpp +926 -0
  570. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_pytypes.py +1050 -0
  571. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_sequences_and_iterators.cpp +600 -0
  572. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_sequences_and_iterators.py +267 -0
  573. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_smart_ptr.cpp +473 -0
  574. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_smart_ptr.py +317 -0
  575. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl.cpp +549 -0
  576. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl.py +383 -0
  577. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl_binders.cpp +275 -0
  578. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_stl_binders.py +395 -0
  579. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_tagbased_polymorphic.cpp +147 -0
  580. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_tagbased_polymorphic.py +30 -0
  581. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_thread.cpp +66 -0
  582. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_thread.py +44 -0
  583. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_type_caster_pyobject_ptr.cpp +167 -0
  584. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_type_caster_pyobject_ptr.py +122 -0
  585. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_union.cpp +22 -0
  586. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_union.py +10 -0
  587. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_a.cpp +38 -0
  588. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_a.py +36 -0
  589. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_b.cpp +13 -0
  590. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_unnamed_namespace_b.py +7 -0
  591. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_vector_unique_ptr_member.cpp +54 -0
  592. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_vector_unique_ptr_member.py +16 -0
  593. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_virtual_functions.cpp +592 -0
  594. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/test_virtual_functions.py +460 -0
  595. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/valgrind-numpy-scipy.supp +140 -0
  596. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tests/valgrind-python.supp +117 -0
  597. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindCatch.cmake +76 -0
  598. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindEigen3.cmake +86 -0
  599. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/FindPythonLibsNew.cmake +310 -0
  600. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/JoinPaths.cmake +23 -0
  601. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/check-style.sh +44 -0
  602. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/cmake_uninstall.cmake.in +23 -0
  603. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/codespell_ignore_lines_from_errors.py +40 -0
  604. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/libsize.py +38 -0
  605. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/make_changelog.py +92 -0
  606. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11.pc.in +7 -0
  607. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Common.cmake +429 -0
  608. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Config.cmake.in +233 -0
  609. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11GuessPythonExtSuffix.cmake +86 -0
  610. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11NewTools.cmake +341 -0
  611. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pybind11Tools.cmake +239 -0
  612. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/pyproject.toml +3 -0
  613. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/setup_global.py.in +63 -0
  614. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/setup_main.py.in +44 -0
  615. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/pybind11/tools/test-pybind11GuessPythonExtSuffix.cmake +161 -0
  616. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/setup.py +76 -0
  617. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Python/unit_test.py +209 -0
  618. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/README.md +357 -0
  619. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/README_CN.md +301 -0
  620. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/SECURITY.md +15 -0
  621. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Script/dumpJavaSignature.py +144 -0
  622. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Script/formatCode.py +17 -0
  623. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/.clang-format +35 -0
  624. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32.sln +58 -0
  625. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.cpp +548 -0
  626. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.vcxproj +190 -0
  627. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/Win32Demo.vcxproj.filters +30 -0
  628. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/pch.cpp +23 -0
  629. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32Demo/pch.h +28 -0
  630. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.cpp +88 -0
  631. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.vcxproj +188 -0
  632. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/Win32DemoProcess.vcxproj.filters +30 -0
  633. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/pch.cpp +21 -0
  634. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/Win32/Win32DemoProcess/pch.h +24 -0
  635. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.metadata +10 -0
  636. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.vscode/launch.json +162 -0
  637. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/.vscode/settings.json +12 -0
  638. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/CHANGELOG.md +196 -0
  639. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/LICENSE +193 -0
  640. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/README.md +217 -0
  641. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/analysis_options.yaml +49 -0
  642. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/README.md +16 -0
  643. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/build.gradle +79 -0
  644. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/AndroidManifest.xml +41 -0
  645. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/java/com/tencent/mmkv_example/MainActivity.java +25 -0
  646. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/drawable/launch_background.xml +12 -0
  647. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  648. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  649. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  650. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  651. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  652. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/main/res/values/styles.xml +18 -0
  653. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/app/src/profile/AndroidManifest.xml +7 -0
  654. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/build.gradle +29 -0
  655. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  656. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/gradle.properties +4 -0
  657. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/settings.gradle +25 -0
  658. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/android/settings_aar.gradle +1 -0
  659. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/AppFrameworkInfo.plist +26 -0
  660. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/Debug.xcconfig +2 -0
  661. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/Release.xcconfig +2 -0
  662. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/ephemeral/flutter_lldb_helper.py +32 -0
  663. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Flutter/ephemeral/flutter_lldbinit +5 -0
  664. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Podfile +49 -0
  665. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/AppDelegate.h +26 -0
  666. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/AppDelegate.m +33 -0
  667. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
  668. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
  669. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
  670. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
  671. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
  672. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
  673. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
  674. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
  675. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
  676. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
  677. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
  678. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
  679. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
  680. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
  681. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
  682. 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
  683. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
  684. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
  685. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
  686. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
  687. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
  688. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
  689. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Base.lproj/Main.storyboard +29 -0
  690. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Info.plist +49 -0
  691. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/Runner.entitlements +10 -0
  692. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner/main.m +29 -0
  693. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.pbxproj +612 -0
  694. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  695. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  696. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  697. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +90 -0
  698. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  699. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  700. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  701. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/lib/main.dart +565 -0
  702. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/CMakeLists.txt +128 -0
  703. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/CMakeLists.txt +88 -0
  704. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugin_registrant.cc +15 -0
  705. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugin_registrant.h +15 -0
  706. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/flutter/generated_plugins.cmake +24 -0
  707. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/CMakeLists.txt +26 -0
  708. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/main.cc +6 -0
  709. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/my_application.cc +130 -0
  710. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/linux/runner/my_application.h +18 -0
  711. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/Flutter-Debug.xcconfig +2 -0
  712. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/Flutter-Release.xcconfig +2 -0
  713. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Flutter/GeneratedPluginRegistrant.swift +14 -0
  714. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Podfile +47 -0
  715. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/AppDelegate.swift +13 -0
  716. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  717. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
  718. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
  719. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
  720. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
  721. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
  722. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
  723. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
  724. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Base.lproj/MainMenu.xib +343 -0
  725. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/AppInfo.xcconfig +14 -0
  726. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Debug.xcconfig +2 -0
  727. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Release.xcconfig +2 -0
  728. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Configs/Warnings.xcconfig +13 -0
  729. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/DebugProfile.entitlements +12 -0
  730. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Info.plist +32 -0
  731. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/MainFlutterWindow.swift +15 -0
  732. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner/Release.entitlements +8 -0
  733. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/project.pbxproj +800 -0
  734. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  735. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +99 -0
  736. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  737. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  738. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
  739. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/macos/RunnerTests/RunnerTests.swift +12 -0
  740. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/app.json5 +10 -0
  741. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/resources/base/element/string.json +8 -0
  742. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/AppScope/resources/base/media/app_icon.png +0 -0
  743. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/build-profile.json5 +41 -0
  744. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/build-profile.json5 +34 -0
  745. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/hvigorfile.ts +17 -0
  746. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/oh-package.json5 +13 -0
  747. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/entryability/EntryAbility.ets +36 -0
  748. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/pages/Index.ets +38 -0
  749. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/ets/plugins/GeneratedPluginRegistrant.ets +28 -0
  750. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/module.json5 +53 -0
  751. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/element/color.json +8 -0
  752. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/element/string.json +16 -0
  753. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/media/icon.png +0 -0
  754. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/base/profile/main_pages.json +5 -0
  755. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/en_US/element/string.json +16 -0
  756. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/main/resources/zh_CN/element/string.json +16 -0
  757. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/test/Ability.test.ets +50 -0
  758. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/test/List.test.ets +20 -0
  759. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets +63 -0
  760. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets +49 -0
  761. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +64 -0
  762. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/module.json5 +51 -0
  763. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/element/color.json +8 -0
  764. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/element/string.json +16 -0
  765. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/media/icon.png +0 -0
  766. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/entry/src/ohosTest/resources/base/profile/test_pages.json +5 -0
  767. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/hvigor/hvigor-config.json5 +20 -0
  768. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/hvigorfile.ts +21 -0
  769. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/ohos/oh-package.json5 +21 -0
  770. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/pubspec.yaml +75 -0
  771. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/CMakeLists.txt +108 -0
  772. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/CMakeLists.txt +109 -0
  773. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugin_registrant.cc +14 -0
  774. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugin_registrant.h +15 -0
  775. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/flutter/generated_plugins.cmake +24 -0
  776. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/CMakeLists.txt +40 -0
  777. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/Runner.rc +121 -0
  778. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/flutter_window.cpp +71 -0
  779. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/flutter_window.h +33 -0
  780. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/main.cpp +43 -0
  781. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/resource.h +16 -0
  782. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/resources/app_icon.ico +0 -0
  783. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/runner.exe.manifest +14 -0
  784. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/utils.cpp +65 -0
  785. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/utils.h +19 -0
  786. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/win32_window.cpp +288 -0
  787. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/example/windows/runner/win32_window.h +102 -0
  788. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/lib/mmkv.dart +1052 -0
  789. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/mmkv.iml +17 -0
  790. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/pubspec.yaml +62 -0
  791. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/test/mmkv_test.dart +48 -0
  792. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/tool/fix_mmkv_plugin_name.rb +4 -0
  793. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv/tool/mmkvpodhelper.rb +23 -0
  794. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv.iml +25 -0
  795. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/CHANGELOG.md +48 -0
  796. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/LICENSE +193 -0
  797. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/README.md +17 -0
  798. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/build.gradle +39 -0
  799. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  800. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  801. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradle.properties +4 -0
  802. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradlew +160 -0
  803. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/gradlew.bat +90 -0
  804. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/settings.gradle +1 -0
  805. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/src/main/AndroidManifest.xml +1 -0
  806. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/android/src/main/java/com/tencent/mmkv/MMKVPlugin.java +82 -0
  807. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/lib/mmkv_android.dart +76 -0
  808. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_android/pubspec.yaml +40 -0
  809. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/.metadata +33 -0
  810. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/CHANGELOG.md +52 -0
  811. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/LICENSE +193 -0
  812. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/README.md +17 -0
  813. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/MMKVPlugin.h +28 -0
  814. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/MMKVPlugin.mm +39 -0
  815. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/flutter-bridge.h +32 -0
  816. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/Classes/flutter-bridge.mm +693 -0
  817. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/darwin/mmkv_ios.podspec +35 -0
  818. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/lib/mmkv_ios.dart +78 -0
  819. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ios/pubspec.yaml +44 -0
  820. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/.metadata +30 -0
  821. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/CHANGELOG.md +9 -0
  822. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/LICENSE +193 -0
  823. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/README.md +17 -0
  824. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/analysis_options.yaml +4 -0
  825. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/lib/mmkv_linux.dart +69 -0
  826. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/CMakeLists.txt +63 -0
  827. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/flutter-bridge.cpp +694 -0
  828. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/include/mmkv_linux/mmkv_linux_plugin.h +46 -0
  829. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/linux/mmkv_linux_plugin.cc +97 -0
  830. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_linux/pubspec.yaml +47 -0
  831. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/.metadata +30 -0
  832. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/CHANGELOG.md +42 -0
  833. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/LICENSE +193 -0
  834. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/README.md +17 -0
  835. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/analysis_options.yaml +4 -0
  836. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/lib/mmkv_ohos.dart +84 -0
  837. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/build-profile.json5 +10 -0
  838. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/hvigorfile.ts +2 -0
  839. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/index.ets +17 -0
  840. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/oh-package.json5 +15 -0
  841. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/src/main/ets/components/plugin/MMKVPlugin.ets +78 -0
  842. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/ohos/src/main/module.json5 +10 -0
  843. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_ohos/pubspec.yaml +50 -0
  844. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/CHANGELOG.md +38 -0
  845. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/LICENSE +193 -0
  846. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/README.md +30 -0
  847. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/lib/mmkv_platform_ffi.dart +363 -0
  848. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/lib/mmkv_platform_interface.dart +363 -0
  849. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_platform_interface/pubspec.yaml +23 -0
  850. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/.metadata +30 -0
  851. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/CHANGELOG.md +9 -0
  852. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/LICENSE +193 -0
  853. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/README.md +17 -0
  854. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/analysis_options.yaml +4 -0
  855. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/lib/mmkv_win32.dart +69 -0
  856. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/pubspec.yaml +47 -0
  857. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/CMakeLists.txt +71 -0
  858. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/flutter-bridge.cpp +721 -0
  859. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/include/mmkv_win32/mmkv_win32_plugin.h +43 -0
  860. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/flutter/mmkv_win32/windows/mmkv_win32_plugin.cpp +88 -0
  861. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/AutoCleanInfo.hpp +65 -0
  862. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/MMKV.h +552 -0
  863. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/MMKVHandler.h +60 -0
  864. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/Resources/Info.plist +24 -0
  865. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV/libMMKV.mm +1361 -0
  866. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.pbxproj +967 -0
  867. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  868. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  869. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV For App Extension.xcscheme +67 -0
  870. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV Static.xcscheme +76 -0
  871. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKV.xcscheme +76 -0
  872. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKV/MMKV.xcodeproj/xcshareddata/xcschemes/MMKVWatchExtension.xcscheme +67 -0
  873. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/Config.xcconfig +10 -0
  874. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/AppDelegate.h +15 -0
  875. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/AppDelegate.m +43 -0
  876. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  877. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +13 -0
  878. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Assets.xcassets/Contents.json +6 -0
  879. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Base.lproj/LaunchScreen.storyboard +25 -0
  880. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Base.lproj/Main.storyboard +42 -0
  881. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/Info.plist +25 -0
  882. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/MMKVCatalystDemo.entitlements +12 -0
  883. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/SceneDelegate.h +16 -0
  884. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/SceneDelegate.m +58 -0
  885. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/ViewController.h +15 -0
  886. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/ViewController.mm +85 -0
  887. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVCatalystDemo/main.m +19 -0
  888. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/AppDelegate.h +27 -0
  889. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/AppDelegate.m +135 -0
  890. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/DemoSwiftUsage.swift +82 -0
  891. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/MMKVDemo-Bridging-Header.h +22 -0
  892. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
  893. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Base.lproj/LaunchScreen.storyboard +25 -0
  894. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Base.lproj/Main.storyboard +48 -0
  895. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/Info.plist +49 -0
  896. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/MMKVDemo.entitlements +10 -0
  897. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/testReadOnly +0 -0
  898. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/Resources/testReadOnly.crc +0 -0
  899. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/TestMMKVCpp.cpp +204 -0
  900. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/TestMMKVCpp.hpp +18 -0
  901. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController+TestCaseBad.h +39 -0
  902. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController+TestCaseBad.mm +200 -0
  903. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController.h +32 -0
  904. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/ViewController.mm +1245 -0
  905. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo/main.m +28 -0
  906. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.pbxproj +1944 -0
  907. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  908. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  909. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  910. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVDemo.xcscheme +88 -0
  911. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVMacDemo.xcscheme +78 -0
  912. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/MMKVTodayExtensionDemo.xcscheme +116 -0
  913. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme +106 -0
  914. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme +102 -0
  915. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemo.xcodeproj/xcshareddata/xcschemes/kvdemo.xcscheme +78 -0
  916. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/Info.plist +22 -0
  917. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/MMKVDemoTests.mm +554 -0
  918. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVDemoTests/MMKVPerformanceTest.mm +118 -0
  919. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/AppDelegate.h +13 -0
  920. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/AppDelegate.m +27 -0
  921. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
  922. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Assets.xcassets/Contents.json +6 -0
  923. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Base.lproj/Main.storyboard +718 -0
  924. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/Info.plist +32 -0
  925. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/MMKVMacDemo.entitlements +10 -0
  926. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/ViewController.h +13 -0
  927. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/ViewController.mm +352 -0
  928. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVMacDemo/main.m +15 -0
  929. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/Base.lproj/MainInterface.storyboard +45 -0
  930. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/Info.plist +31 -0
  931. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/MMKVTodayExtensionDemo.entitlements +10 -0
  932. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/TodayViewController.h +25 -0
  933. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVTodayExtensionDemo/TodayViewController.m +106 -0
  934. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json +12 -0
  935. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json +6 -0
  936. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Contents.json +17 -0
  937. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json +12 -0
  938. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json +6 -0
  939. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json +12 -0
  940. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json +6 -0
  941. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Assets.xcassets/Contents.json +6 -0
  942. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/ContentView.swift +71 -0
  943. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Info.plist +15 -0
  944. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/MMKVVisionDemoApp.swift +22 -0
  945. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/MMKVVisionDemo/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
  946. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json +81 -0
  947. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Assets.xcassets/Contents.json +6 -0
  948. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Base.lproj/Interface.storyboard +47 -0
  949. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp/Info.plist +33 -0
  950. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json +28 -0
  951. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Contents.json +48 -0
  952. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json +28 -0
  953. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json +28 -0
  954. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json +28 -0
  955. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json +28 -0
  956. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json +28 -0
  957. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json +28 -0
  958. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json +28 -0
  959. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Assets.xcassets/Contents.json +6 -0
  960. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/ExtensionDelegate.h +25 -0
  961. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/ExtensionDelegate.mm +135 -0
  962. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/Info.plist +36 -0
  963. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/InterfaceController.h +26 -0
  964. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/InterfaceController.m +50 -0
  965. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/NotificationController.h +26 -0
  966. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/NotificationController.m +60 -0
  967. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/WatchApp Extension/PushNotificationPayload.apns +20 -0
  968. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/AppDelegate.h +15 -0
  969. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/AppDelegate.m +49 -0
  970. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  971. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/AppIcon.appiconset/Contents.json +13 -0
  972. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Assets.xcassets/Contents.json +6 -0
  973. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Base.lproj/LaunchScreen.storyboard +25 -0
  974. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Base.lproj/Main.storyboard +45 -0
  975. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/Info.plist +25 -0
  976. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/SceneDelegate.h +16 -0
  977. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/SceneDelegate.m +58 -0
  978. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/ViewController.h +15 -0
  979. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/ViewController.m +38 -0
  980. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/kvdemo.entitlements +10 -0
  981. package/harmony/reactNativeMMKV/src/main/cpp/MMKV/iOS/MMKVDemo/kvdemo/main.m +19 -0
  982. package/harmony/reactNativeMMKV/src/main/cpp/MMKVManagedBuffer.h +49 -0
  983. package/harmony/reactNativeMMKV/src/main/cpp/MmkvCxx.cpp +152 -0
  984. package/harmony/reactNativeMMKV/src/main/cpp/MmkvCxx.h +36 -0
  985. package/harmony/reactNativeMMKV/src/main/cpp/MmkvHostObject.cpp +357 -0
  986. package/harmony/reactNativeMMKV/src/main/cpp/MmkvHostObject.h +66 -0
  987. package/harmony/reactNativeMMKV/src/main/cpp/MmkvLogger.h +52 -0
  988. package/harmony/reactNativeMMKV/src/main/cpp/MmkvPlatformContext.cpp +37 -0
  989. package/harmony/reactNativeMMKV/src/main/cpp/MmkvPlatformContext.h +36 -0
  990. package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVComponentDescriptor.h +65 -0
  991. package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVJSIBinder.h +55 -0
  992. package/harmony/reactNativeMMKV/src/main/cpp/NativeMMKVPackage.h +67 -0
  993. package/harmony/reactNativeMMKV/src/main/cpp/Props.cpp +37 -0
  994. package/harmony/reactNativeMMKV/src/main/cpp/Props.h +42 -0
  995. package/harmony/reactNativeMMKV/src/main/cpp/ShadowNodes.cpp +39 -0
  996. package/harmony/reactNativeMMKV/src/main/cpp/ShadowNodes.h +41 -0
  997. package/harmony/reactNativeMMKV/src/main/cpp/States.cpp +40 -0
  998. package/harmony/reactNativeMMKV/src/main/cpp/States.h +45 -0
  999. package/harmony/reactNativeMMKV/src/main/ets/Logger.ts +65 -0
  1000. package/harmony/reactNativeMMKV/src/main/ets/MmkvCxxPackage.ts +46 -0
  1001. package/harmony/reactNativeMMKV/src/main/ets/MmkvCxxTurboModule.ts +60 -0
  1002. package/harmony/reactNativeMMKV/src/main/ets/MmkvPlatformContextPackage.ts +46 -0
  1003. package/harmony/reactNativeMMKV/src/main/ets/MmkvPlatformContextTurboModule.ts +48 -0
  1004. package/harmony/reactNativeMMKV/src/main/module.json5 +7 -0
  1005. package/harmony/reactNativeMMKV/src/main/resources/base/element/string.json +8 -0
  1006. package/harmony/reactNativeMMKV/src/main/resources/en_US/element/string.json +8 -0
  1007. package/harmony/reactNativeMMKV/src/main/resources/zh_CN/element/string.json +8 -0
  1008. package/harmony/reactNativeMMKV/ts.ts +27 -0
  1009. package/harmony/reactNativeMMKV.har +0 -0
  1010. package/lib/commonjs/MMKV.js +124 -0
  1011. package/lib/commonjs/MMKV.js.map +1 -0
  1012. package/lib/commonjs/MemoryWarningListener.js +31 -0
  1013. package/lib/commonjs/MemoryWarningListener.js.map +1 -0
  1014. package/lib/commonjs/MemoryWarningListener.web.js +11 -0
  1015. package/lib/commonjs/MemoryWarningListener.web.js.map +1 -0
  1016. package/lib/commonjs/ModuleNotFoundError.js +75 -0
  1017. package/lib/commonjs/ModuleNotFoundError.js.map +1 -0
  1018. package/lib/commonjs/NativeMmkv.js +53 -0
  1019. package/lib/commonjs/NativeMmkv.js.map +1 -0
  1020. package/lib/commonjs/NativeMmkvPlatformContext.js +22 -0
  1021. package/lib/commonjs/NativeMmkvPlatformContext.js.map +1 -0
  1022. package/lib/commonjs/PlatformChecker.js +14 -0
  1023. package/lib/commonjs/PlatformChecker.js.map +1 -0
  1024. package/lib/commonjs/Types.js +32 -0
  1025. package/lib/commonjs/Types.js.map +1 -0
  1026. package/lib/commonjs/createMMKV.js +43 -0
  1027. package/lib/commonjs/createMMKV.js.map +1 -0
  1028. package/lib/commonjs/createMMKV.mock.js +43 -0
  1029. package/lib/commonjs/createMMKV.mock.js.map +1 -0
  1030. package/lib/commonjs/createMMKV.web.js +110 -0
  1031. package/lib/commonjs/createMMKV.web.js.map +1 -0
  1032. package/lib/commonjs/createTextEncoder.js +23 -0
  1033. package/lib/commonjs/createTextEncoder.js.map +1 -0
  1034. package/lib/commonjs/hooks.js +198 -0
  1035. package/lib/commonjs/hooks.js.map +1 -0
  1036. package/lib/commonjs/index.js +40 -0
  1037. package/lib/commonjs/index.js.map +1 -0
  1038. package/lib/commonjs/package.json +1 -0
  1039. package/lib/module/MMKV.js +119 -0
  1040. package/lib/module/MMKV.js.map +1 -0
  1041. package/lib/module/MemoryWarningListener.js +27 -0
  1042. package/lib/module/MemoryWarningListener.js.map +1 -0
  1043. package/lib/module/MemoryWarningListener.web.js +6 -0
  1044. package/lib/module/MemoryWarningListener.web.js.map +1 -0
  1045. package/lib/module/ModuleNotFoundError.js +70 -0
  1046. package/lib/module/ModuleNotFoundError.js.map +1 -0
  1047. package/lib/module/NativeMmkv.js +51 -0
  1048. package/lib/module/NativeMmkv.js.map +1 -0
  1049. package/lib/module/NativeMmkvPlatformContext.js +18 -0
  1050. package/lib/module/NativeMmkvPlatformContext.js.map +1 -0
  1051. package/lib/module/PlatformChecker.js +10 -0
  1052. package/lib/module/PlatformChecker.js.map +1 -0
  1053. package/lib/module/Types.js +31 -0
  1054. package/lib/module/Types.js.map +1 -0
  1055. package/lib/module/createMMKV.js +38 -0
  1056. package/lib/module/createMMKV.js.map +1 -0
  1057. package/lib/module/createMMKV.mock.js +38 -0
  1058. package/lib/module/createMMKV.mock.js.map +1 -0
  1059. package/lib/module/createMMKV.web.js +105 -0
  1060. package/lib/module/createMMKV.web.js.map +1 -0
  1061. package/lib/module/createTextEncoder.js +19 -0
  1062. package/lib/module/createTextEncoder.js.map +1 -0
  1063. package/lib/module/hooks.js +189 -0
  1064. package/lib/module/hooks.js.map +1 -0
  1065. package/lib/module/index.js +6 -0
  1066. package/lib/module/index.js.map +1 -0
  1067. package/lib/typescript/src/MMKV.d.ts +34 -0
  1068. package/lib/typescript/src/MMKV.d.ts.map +1 -0
  1069. package/lib/typescript/src/MemoryWarningListener.d.ts +3 -0
  1070. package/lib/typescript/src/MemoryWarningListener.d.ts.map +1 -0
  1071. package/lib/typescript/src/MemoryWarningListener.web.d.ts +3 -0
  1072. package/lib/typescript/src/MemoryWarningListener.web.d.ts.map +1 -0
  1073. package/lib/typescript/src/ModuleNotFoundError.d.ts +7 -0
  1074. package/lib/typescript/src/ModuleNotFoundError.d.ts.map +1 -0
  1075. package/lib/typescript/src/NativeMmkv.d.ts +91 -0
  1076. package/lib/typescript/src/NativeMmkv.d.ts.map +1 -0
  1077. package/lib/typescript/src/NativeMmkvPlatformContext.d.ts +20 -0
  1078. package/lib/typescript/src/NativeMmkvPlatformContext.d.ts.map +1 -0
  1079. package/lib/typescript/src/PlatformChecker.d.ts +2 -0
  1080. package/lib/typescript/src/PlatformChecker.d.ts.map +1 -0
  1081. package/lib/typescript/src/Types.d.ts +172 -0
  1082. package/lib/typescript/src/Types.d.ts.map +1 -0
  1083. package/lib/typescript/src/__tests__/hooks.test.d.ts +2 -0
  1084. package/lib/typescript/src/__tests__/hooks.test.d.ts.map +1 -0
  1085. package/lib/typescript/src/createMMKV.d.ts +3 -0
  1086. package/lib/typescript/src/createMMKV.d.ts.map +1 -0
  1087. package/lib/typescript/src/createMMKV.mock.d.ts +3 -0
  1088. package/lib/typescript/src/createMMKV.mock.d.ts.map +1 -0
  1089. package/lib/typescript/src/createMMKV.web.d.ts +3 -0
  1090. package/lib/typescript/src/createMMKV.web.d.ts.map +1 -0
  1091. package/lib/typescript/src/createTextEncoder.d.ts +2 -0
  1092. package/lib/typescript/src/createTextEncoder.d.ts.map +1 -0
  1093. package/lib/typescript/src/hooks.d.ts +86 -0
  1094. package/lib/typescript/src/hooks.d.ts.map +1 -0
  1095. package/lib/typescript/src/index.d.ts +4 -0
  1096. package/lib/typescript/src/index.d.ts.map +1 -0
  1097. package/package.json +187 -0
  1098. package/react-native-mmkv.podspec +38 -0
  1099. package/react-native.config.js +20 -0
  1100. package/src/MMKV.ts +142 -0
  1101. package/src/MemoryWarningListener.ts +29 -0
  1102. package/src/MemoryWarningListener.web.ts +5 -0
  1103. package/src/ModuleNotFoundError.ts +95 -0
  1104. package/src/NativeMmkv.ts +118 -0
  1105. package/src/NativeMmkvPlatformContext.ts +38 -0
  1106. package/src/PlatformChecker.ts +9 -0
  1107. package/src/Types.ts +178 -0
  1108. package/src/__tests__/hooks.test.tsx +89 -0
  1109. package/src/createMMKV.mock.ts +38 -0
  1110. package/src/createMMKV.ts +42 -0
  1111. package/src/createMMKV.web.ts +127 -0
  1112. package/src/createTextEncoder.ts +16 -0
  1113. package/src/hooks.ts +247 -0
  1114. package/src/index.ts +4 -0
@@ -0,0 +1,1791 @@
1
+ /*
2
+ * Tencent is pleased to support the open source community by making
3
+ * MMKV available.
4
+ *
5
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company.
6
+ * All rights reserved.
7
+ *
8
+ * Licensed under the BSD 3-Clause License (the "License"); you may not use
9
+ * this file except in compliance with the License. You may obtain a copy of
10
+ * the License at
11
+ *
12
+ * https://opensource.org/licenses/BSD-3-Clause
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+
21
+ #include "CodedInputData.h"
22
+ #include "CodedOutputData.h"
23
+ #include "InterProcessLock.h"
24
+ #include "KeyValueHolder.h"
25
+ #include "MMBuffer.h"
26
+ #include "MMKVLog.h"
27
+ #include "MMKVMetaInfo.hpp"
28
+ #include "MMKV_IO.h"
29
+ #include "MMKV_OSX.h"
30
+ #include "MemoryFile.h"
31
+ #include "MiniPBCoder.h"
32
+ #include "PBUtility.h"
33
+ #include "ScopedLock.hpp"
34
+ #include "ThreadLock.h"
35
+ #include "aes/AESCrypt.h"
36
+ #include "aes/openssl/openssl_aes.h"
37
+ #include "aes/openssl/openssl_md5.h"
38
+ #include "crc32/Checksum.h"
39
+ #include <algorithm>
40
+ #include <cstdio>
41
+ #include <cstring>
42
+ #include <unordered_set>
43
+ #include <cassert>
44
+
45
+ #if defined(__aarch64__) && defined(__linux__) && !defined (MMKV_OHOS)
46
+ # include <asm/hwcap.h>
47
+ # include <sys/auxv.h>
48
+ #endif
49
+
50
+ #ifdef MMKV_APPLE
51
+ # if __has_feature(objc_arc)
52
+ # error This file must be compiled with MRC. Use -fno-objc-arc flag.
53
+ # endif
54
+ # include "MMKV_OSX.h"
55
+ #endif // MMKV_APPLE
56
+
57
+ using namespace std;
58
+ using namespace mmkv;
59
+
60
+ unordered_map<string, MMKV *> *g_instanceDic;
61
+ ThreadLock *g_instanceLock;
62
+ MMKVPath_t g_rootDir;
63
+ MMKVPath_t g_realRootDir;
64
+ static ThreadLock *g_namespaceLock;
65
+ static unordered_map<MMKVPath_t, MMKVPath_t> g_realRootMap;
66
+ static mmkv::ErrorHandler g_errorHandler;
67
+ size_t mmkv::DEFAULT_MMAP_SIZE;
68
+
69
+ MMKV_NAMESPACE_BEGIN
70
+
71
+ static MMKVPath_t encodeFilePath(const string &mmapID, const MMKVPath_t &rootDir);
72
+ bool endsWith(const MMKVPath_t &str, const MMKVPath_t &suffix);
73
+ MMKVPath_t filename(const MMKVPath_t &path);
74
+
75
+ #ifndef MMKV_ANDROID
76
+ MMKV::MMKV(const string &mmapID, MMKVMode mode, const string *cryptKey, const MMKVPath_t *rootPath, size_t expectedCapacity, bool aes256)
77
+ : m_mmapID(mmapID)
78
+ , m_mode(mode)
79
+ , m_path(mappedKVPathWithID(m_mmapID, rootPath))
80
+ , m_crcPath(crcPathWithPath(m_path))
81
+ , m_dic(nullptr)
82
+ , m_dicCrypt(nullptr)
83
+ , m_expectedCapacity(std::max<size_t>(DEFAULT_MMAP_SIZE, roundUp<size_t>(expectedCapacity, DEFAULT_MMAP_SIZE)))
84
+ , m_file(new MemoryFile(m_path, m_expectedCapacity, isReadOnly(), true))
85
+ , m_metaFile(new MemoryFile(m_crcPath, 0, isReadOnly(), !isMultiProcess()))
86
+ , m_metaInfo(new MMKVMetaInfo())
87
+ , m_crypter(nullptr)
88
+ , m_lock(new ThreadLock())
89
+ , m_fileLock(new FileLock(isMultiProcess() ? m_metaFile->getFd() : MMKVFileHandleInvalidValue))
90
+ , m_sharedProcessLock(new InterProcessLock(m_fileLock, SharedLockType))
91
+ , m_exclusiveProcessLock(new InterProcessLock(m_fileLock, ExclusiveLockType))
92
+ {
93
+ m_actualSize = 0;
94
+ m_output = nullptr;
95
+
96
+ # ifndef MMKV_DISABLE_CRYPT
97
+ if (cryptKey && !cryptKey->empty()) {
98
+ m_dicCrypt = new MMKVMapCrypt();
99
+ m_crypter = new AESCrypt(cryptKey->data(), cryptKey->length(), nullptr, 0, aes256);
100
+ } else {
101
+ m_dic = new MMKVMap();
102
+ }
103
+ # else
104
+ m_dic = new MMKVMap();
105
+ # endif
106
+
107
+ m_needLoadFromFile = true;
108
+ m_hasFullWriteback = false;
109
+
110
+ m_crcDigest = 0;
111
+
112
+ m_lock->initialize();
113
+ m_sharedProcessLock->m_enable = isMultiProcess();
114
+ m_exclusiveProcessLock->m_enable = isMultiProcess();
115
+
116
+ // sensitive zone
117
+ /*{
118
+ SCOPED_LOCK(m_sharedProcessLock);
119
+ loadFromFile();
120
+ }*/
121
+ }
122
+ #endif
123
+
124
+ MMKV::~MMKV() {
125
+ clearMemoryCache();
126
+
127
+ delete m_dic;
128
+ #ifndef MMKV_DISABLE_CRYPT
129
+ delete m_dicCrypt;
130
+ delete m_crypter;
131
+ #endif
132
+ delete m_metaInfo;
133
+ delete m_lock;
134
+ delete m_fileLock;
135
+ delete m_sharedProcessLock;
136
+ delete m_exclusiveProcessLock;
137
+ #ifdef MMKV_ANDROID
138
+ #ifndef MMKV_OHOS
139
+ delete m_sharedProcessModeLock;
140
+ delete m_exclusiveProcessModeLock;
141
+ delete m_fileModeLock;
142
+ #endif // !MMKV_OHOS
143
+ delete m_sharedMigrationLock;
144
+ delete m_fileMigrationLock;
145
+ #endif // MMKV_ANDROID
146
+ delete m_metaFile;
147
+ delete m_file;
148
+
149
+ MMKVInfo("destruct [%s]", m_mmapID.c_str());
150
+ }
151
+
152
+ MMKV *MMKV::defaultMMKV(MMKVMode mode, const string *cryptKey, bool aes256) {
153
+ #ifndef MMKV_ANDROID
154
+ return mmkvWithID(DEFAULT_MMAP_ID, mode, cryptKey, nullptr, 0, aes256);
155
+ #else
156
+ return mmkvWithID(DEFAULT_MMAP_ID, DEFAULT_MMAP_SIZE, mode, cryptKey, nullptr, 0, aes256);
157
+ #endif
158
+ }
159
+
160
+ static void initialize() {
161
+ g_instanceDic = new unordered_map<string, MMKV *>;
162
+ g_instanceLock = new ThreadLock();
163
+ g_instanceLock->initialize();
164
+
165
+ mmkv::DEFAULT_MMAP_SIZE = mmkv::getPageSize();
166
+ MMKVInfo("version %s, page size %d, arch %s", MMKV_VERSION, DEFAULT_MMAP_SIZE, MMKV_ABI);
167
+
168
+ // get CPU status of ARMv8 extensions (CRC32, AES)
169
+ #if defined(__aarch64__) && defined(__linux__) && !defined (MMKV_OHOS)
170
+ auto hwcaps = getauxval(AT_HWCAP);
171
+ # ifndef MMKV_DISABLE_CRYPT
172
+ if (hwcaps & HWCAP_AES) {
173
+ openssl::AES_set_encrypt_key = openssl_aes_arm_set_encrypt_key;
174
+ openssl::AES_set_decrypt_key = openssl_aes_arm_set_decrypt_key;
175
+ openssl::AES_encrypt = openssl_aes_arm_encrypt;
176
+ openssl::AES_decrypt = openssl_aes_arm_decrypt;
177
+ MMKVInfo("armv8 AES instructions is supported");
178
+ } else {
179
+ MMKVInfo("armv8 AES instructions is not supported");
180
+ }
181
+ # endif // MMKV_DISABLE_CRYPT
182
+ # ifdef MMKV_USE_ARMV8_CRC32
183
+ if (hwcaps & HWCAP_CRC32) {
184
+ CRC32 = mmkv::armv8_crc32;
185
+ MMKVInfo("armv8 CRC32 instructions is supported");
186
+ } else {
187
+ MMKVInfo("armv8 CRC32 instructions is not supported");
188
+ }
189
+ # endif // MMKV_USE_ARMV8_CRC32
190
+ #endif // __aarch64__ && defined(__linux__) && !defined (MMKV_OHOS)
191
+
192
+ #if defined(MMKV_DEBUG) && !defined(MMKV_DISABLE_CRYPT)
193
+ // AESCrypt::testAESCrypt();
194
+ // KeyValueHolderCrypt::testAESToMMBuffer();
195
+ #endif
196
+ }
197
+
198
+ static void ensureMinimalInitialize() {
199
+ static ThreadOnceToken_t once_control = ThreadOnceUninitialized;
200
+ ThreadLock::ThreadOnce(&once_control, initialize);
201
+ }
202
+
203
+ void MMKV::initializeMMKV(const MMKVPath_t &rootDir, MMKVLogLevel logLevel, mmkv::LogHandler handler) {
204
+ g_currentLogLevel = logLevel;
205
+ g_logHandler = handler;
206
+
207
+ ensureMinimalInitialize();
208
+
209
+ #ifdef MMKV_APPLE
210
+ // crc32 instruction requires A10 chip, aka iPhone 7 or iPad 6th generation
211
+ int device = 0, version = 0;
212
+ GetAppleMachineInfo(device, version);
213
+ MMKVInfo("Apple Device: %d, version: %d", device, version);
214
+ #endif
215
+
216
+ if (g_rootDir.empty()) {
217
+ g_rootDir = rootDir;
218
+ // avoid operating g_realRootMap directly
219
+ g_realRootDir = nameSpace(rootDir).getRootDir();
220
+ mkPath(g_realRootDir);
221
+ }
222
+
223
+ MMKVInfo("root dir: " MMKV_PATH_FORMAT, g_realRootDir.c_str());
224
+ }
225
+
226
+ const MMKVPath_t &MMKV::getRootDir() {
227
+ // for backword consistency we can't return g_realRootDir
228
+ return g_rootDir;
229
+ }
230
+
231
+ #ifndef MMKV_ANDROID
232
+ MMKV *MMKV::mmkvWithID(const string &mmapID, MMKVMode mode, const string *cryptKey, const MMKVPath_t *rootPath, size_t expectedCapacity, bool aes256) {
233
+
234
+ if (mmapID.empty() || !g_instanceLock) {
235
+ return nullptr;
236
+ }
237
+ SCOPED_LOCK(g_instanceLock);
238
+
239
+ auto mmapKey = mmapedKVKey(mmapID, rootPath);
240
+ auto itr = g_instanceDic->find(mmapKey);
241
+ if (itr != g_instanceDic->end()) {
242
+ MMKV *kv = itr->second;
243
+ return kv;
244
+ }
245
+
246
+ if (rootPath && !(mode & MMKV_READ_ONLY)) {
247
+ MMKVPath_t specialPath = (*rootPath) + MMKV_PATH_SLASH + SPECIAL_CHARACTER_DIRECTORY_NAME;
248
+ if (!isFileExist(specialPath)) {
249
+ mkPath(specialPath);
250
+ }
251
+ }
252
+ auto theRootDir = rootPath ? rootPath : &g_realRootDir;
253
+ #ifdef MMKV_WIN32
254
+ MMKVInfo("prepare to load %s (id %s) from rootPath %ls", mmapID.c_str(), mmapKey.c_str(), theRootDir->c_str());
255
+ #else
256
+ MMKVInfo("prepare to load %s (id %s) from rootPath %s", mmapID.c_str(), mmapKey.c_str(), theRootDir->c_str());
257
+ #endif
258
+
259
+ auto kv = new MMKV(mmapID, mode, cryptKey, rootPath, expectedCapacity, aes256);
260
+ kv->m_mmapKey = mmapKey;
261
+ (*g_instanceDic)[mmapKey] = kv;
262
+ return kv;
263
+ }
264
+ #endif
265
+
266
+ void MMKV::onExit() {
267
+ if (!g_instanceLock) {
268
+ return;
269
+ }
270
+ SCOPED_LOCK(g_instanceLock);
271
+
272
+ for (auto &pair : *g_instanceDic) {
273
+ MMKV *kv = pair.second;
274
+ kv->sync();
275
+ kv->clearMemoryCache();
276
+ delete kv;
277
+ pair.second = nullptr;
278
+ }
279
+
280
+ delete g_instanceDic;
281
+ g_instanceDic = nullptr;
282
+ }
283
+
284
+ const string &MMKV::mmapID() const {
285
+ return m_mmapID;
286
+ }
287
+
288
+ mmkv::ContentChangeHandler g_contentChangeHandler = nullptr;
289
+
290
+ void MMKV::notifyContentChanged() {
291
+ if (g_contentChangeHandler) {
292
+ g_contentChangeHandler(m_mmapID);
293
+ }
294
+ }
295
+
296
+ void MMKV::checkContentChanged() {
297
+ SCOPED_LOCK(m_lock);
298
+ checkLoadData();
299
+ }
300
+
301
+ void MMKV::registerContentChangeHandler(mmkv::ContentChangeHandler handler) {
302
+ g_contentChangeHandler = handler;
303
+ }
304
+
305
+ void MMKV::unRegisterContentChangeHandler() {
306
+ g_contentChangeHandler = nullptr;
307
+ }
308
+
309
+ void MMKV::clearMemoryCache(bool keepSpace) {
310
+ SCOPED_LOCK(m_lock);
311
+ if (m_needLoadFromFile) {
312
+ return;
313
+ }
314
+ MMKVInfo("clearMemoryCache [%s]", m_mmapID.c_str());
315
+ m_needLoadFromFile = true;
316
+ m_hasFullWriteback = false;
317
+
318
+ clearDictionary(m_dic);
319
+ #ifndef MMKV_DISABLE_CRYPT
320
+ clearDictionary(m_dicCrypt);
321
+ if (m_crypter) {
322
+ if (m_metaInfo->m_version >= MMKVVersionRandomIV) {
323
+ m_crypter->resetIV(m_metaInfo->m_vector, sizeof(m_metaInfo->m_vector));
324
+ } else {
325
+ m_crypter->resetIV();
326
+ }
327
+ }
328
+ #endif
329
+
330
+ delete m_output;
331
+ m_output = nullptr;
332
+
333
+ if (!keepSpace) {
334
+ m_file->clearMemoryCache();
335
+ }
336
+ // inter-process lock rely on MetaFile's fd, never close it
337
+ // m_metaFile->clearMemoryCache();
338
+ m_actualSize = 0;
339
+ m_metaInfo->m_crcDigest = 0;
340
+ }
341
+
342
+ void MMKV::close() {
343
+ MMKVInfo("close [%s]", m_mmapID.c_str());
344
+ SCOPED_LOCK(g_instanceLock);
345
+ m_lock->lock();
346
+
347
+ auto itr = g_instanceDic->find(m_mmapKey);
348
+ if (itr != g_instanceDic->end()) {
349
+ g_instanceDic->erase(itr);
350
+ }
351
+ delete this;
352
+ }
353
+
354
+ #ifndef MMKV_DISABLE_CRYPT
355
+
356
+ string MMKV::cryptKey() const {
357
+ SCOPED_LOCK(m_lock);
358
+
359
+ if (m_crypter) {
360
+ char key[AES256_KEY_LEN];
361
+ m_crypter->getKey(key);
362
+ return {key, strnlen(key, AES256_KEY_LEN)};
363
+ }
364
+ return "";
365
+ }
366
+
367
+ void MMKV::checkReSetCryptKey(const string *cryptKey, bool aes256) {
368
+ SCOPED_LOCK(m_lock);
369
+
370
+ if (m_crypter) {
371
+ if (cryptKey && !cryptKey->empty()) {
372
+ string oldKey = this->cryptKey();
373
+ if (oldKey != *cryptKey) {
374
+ MMKVInfo("setting new aes key");
375
+ delete m_crypter;
376
+ auto ptr = cryptKey->data();
377
+ m_crypter = new AESCrypt(ptr, cryptKey->length(), nullptr, 0, aes256);
378
+
379
+ checkLoadData();
380
+ } else {
381
+ // nothing to do
382
+ }
383
+ } else {
384
+ MMKVInfo("reset aes key");
385
+ delete m_crypter;
386
+ m_crypter = nullptr;
387
+
388
+ checkLoadData();
389
+ }
390
+ } else {
391
+ if (cryptKey && !cryptKey->empty()) {
392
+ MMKVInfo("setting new aes key");
393
+ auto ptr = cryptKey->data();
394
+ m_crypter = new AESCrypt(ptr, cryptKey->length(), nullptr, 0, aes256);
395
+
396
+ checkLoadData();
397
+ } else {
398
+ // nothing to do
399
+ }
400
+ }
401
+ }
402
+
403
+ #endif // MMKV_DISABLE_CRYPT
404
+
405
+ bool MMKV::isFileValid() {
406
+ return m_file->isFileValid();
407
+ }
408
+
409
+ // crc
410
+
411
+ // assuming m_file is valid
412
+ bool MMKV::checkFileCRCValid(size_t actualSize, uint32_t crcDigest) {
413
+ auto ptr = (uint8_t *) m_file->getMemory();
414
+ if (ptr) {
415
+ m_crcDigest = (uint32_t) CRC32(0, (const uint8_t *) ptr + Fixed32Size, (uint32_t) actualSize);
416
+
417
+ if (m_crcDigest == crcDigest) {
418
+ return true;
419
+ }
420
+ MMKVError("check crc [%s] fail, crc32:%u, m_crcDigest:%u", m_mmapID.c_str(), crcDigest, m_crcDigest);
421
+ }
422
+ return false;
423
+ }
424
+
425
+ void MMKV::recalculateCRCDigestWithIV(const void *iv) {
426
+ auto ptr = (const uint8_t *) m_file->getMemory();
427
+ if (ptr) {
428
+ m_crcDigest = 0;
429
+ m_crcDigest = (uint32_t) CRC32(0, ptr + Fixed32Size, (uint32_t) m_actualSize);
430
+ writeActualSize(m_actualSize, m_crcDigest, iv, IncreaseSequence);
431
+ }
432
+ }
433
+
434
+ void MMKV::recalculateCRCDigestOnly() {
435
+ auto ptr = (const uint8_t *) m_file->getMemory();
436
+ if (ptr) {
437
+ m_crcDigest = 0;
438
+ m_crcDigest = (uint32_t) CRC32(0, ptr + Fixed32Size, (uint32_t) m_actualSize);
439
+ writeActualSize(m_actualSize, m_crcDigest, nullptr, KeepSequence);
440
+ }
441
+ }
442
+
443
+ void MMKV::updateCRCDigest(const uint8_t *ptr, size_t length) {
444
+ if (ptr == nullptr) {
445
+ return;
446
+ }
447
+ m_crcDigest = (uint32_t) CRC32(m_crcDigest, ptr, (uint32_t) length);
448
+
449
+ writeActualSize(m_actualSize, m_crcDigest, nullptr, KeepSequence);
450
+ }
451
+
452
+ // set & get
453
+
454
+ bool MMKV::set(bool value, MMKVKey_t key) {
455
+ return set(value, key, m_expiredInSeconds);
456
+ }
457
+
458
+ bool MMKV::set(bool value, MMKVKey_t key, uint32_t expireDuration) {
459
+ if (isKeyEmpty(key)) {
460
+ return false;
461
+ }
462
+ size_t size = mmkv_unlikely(m_enableKeyExpire) ? Fixed32Size + pbBoolSize() : pbBoolSize();
463
+ MMBuffer data(size);
464
+ CodedOutputData output(data.getPtr(), size);
465
+ output.writeBool(value);
466
+ if (mmkv_unlikely(m_enableKeyExpire)) {
467
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
468
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
469
+ } else {
470
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
471
+ }
472
+
473
+ return setDataForKey(std::move(data), key);
474
+ }
475
+
476
+ bool MMKV::set(int32_t value, MMKVKey_t key) {
477
+ return set(value, key, m_expiredInSeconds);
478
+ }
479
+
480
+ bool MMKV::set(int32_t value, MMKVKey_t key, uint32_t expireDuration) {
481
+ if (isKeyEmpty(key)) {
482
+ return false;
483
+ }
484
+ size_t size = mmkv_unlikely(m_enableKeyExpire) ? Fixed32Size + pbInt32Size(value) : pbInt32Size(value);
485
+ MMBuffer data(size);
486
+ CodedOutputData output(data.getPtr(), size);
487
+ output.writeInt32(value);
488
+ if (mmkv_unlikely(m_enableKeyExpire)) {
489
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
490
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
491
+ } else {
492
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
493
+ }
494
+
495
+ return setDataForKey(std::move(data), key);
496
+ }
497
+
498
+ bool MMKV::set(uint32_t value, MMKVKey_t key) {
499
+ return set(value, key, m_expiredInSeconds);
500
+ }
501
+
502
+ bool MMKV::set(uint32_t value, MMKVKey_t key, uint32_t expireDuration) {
503
+ if (isKeyEmpty(key)) {
504
+ return false;
505
+ }
506
+ size_t size = mmkv_unlikely(m_enableKeyExpire) ? Fixed32Size + pbUInt32Size(value) : pbUInt32Size(value);
507
+ MMBuffer data(size);
508
+ CodedOutputData output(data.getPtr(), size);
509
+ output.writeUInt32(value);
510
+ if (mmkv_unlikely(m_enableKeyExpire)) {
511
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
512
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
513
+ } else {
514
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
515
+ }
516
+
517
+ return setDataForKey(std::move(data), key);
518
+ }
519
+
520
+ bool MMKV::set(int64_t value, MMKVKey_t key) {
521
+ return set(value, key, m_expiredInSeconds);
522
+ }
523
+
524
+ bool MMKV::set(int64_t value, MMKVKey_t key, uint32_t expireDuration) {
525
+ if (isKeyEmpty(key)) {
526
+ return false;
527
+ }
528
+ size_t size = mmkv_unlikely(m_enableKeyExpire) ? Fixed32Size + pbInt64Size(value) : pbInt64Size(value);
529
+ MMBuffer data(size);
530
+ CodedOutputData output(data.getPtr(), size);
531
+ output.writeInt64(value);
532
+ if (mmkv_unlikely(m_enableKeyExpire)) {
533
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
534
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
535
+ } else {
536
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
537
+ }
538
+
539
+ return setDataForKey(std::move(data), key);
540
+ }
541
+
542
+ bool MMKV::set(uint64_t value, MMKVKey_t key) {
543
+ return set(value, key, m_expiredInSeconds);
544
+ }
545
+
546
+ bool MMKV::set(uint64_t value, MMKVKey_t key, uint32_t expireDuration) {
547
+ if (isKeyEmpty(key)) {
548
+ return false;
549
+ }
550
+ size_t size = mmkv_unlikely(m_enableKeyExpire) ? Fixed32Size + pbUInt64Size(value) : pbUInt64Size(value);
551
+ MMBuffer data(size);
552
+ CodedOutputData output(data.getPtr(), size);
553
+ output.writeUInt64(value);
554
+ if (mmkv_unlikely(m_enableKeyExpire)) {
555
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
556
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
557
+ } else {
558
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
559
+ }
560
+
561
+ return setDataForKey(std::move(data), key);
562
+ }
563
+
564
+ bool MMKV::set(float value, MMKVKey_t key) {
565
+ return set(value, key, m_expiredInSeconds);
566
+ }
567
+
568
+ bool MMKV::set(float value, MMKVKey_t key, uint32_t expireDuration) {
569
+ if (isKeyEmpty(key)) {
570
+ return false;
571
+ }
572
+ size_t size = mmkv_unlikely(m_enableKeyExpire) ? Fixed32Size + pbFloatSize() : pbFloatSize();
573
+ MMBuffer data(size);
574
+ CodedOutputData output(data.getPtr(), size);
575
+ output.writeFloat(value);
576
+ if (mmkv_unlikely(m_enableKeyExpire)) {
577
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
578
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
579
+ } else {
580
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
581
+ }
582
+
583
+ return setDataForKey(std::move(data), key);
584
+ }
585
+
586
+ bool MMKV::set(double value, MMKVKey_t key) {
587
+ return set(value, key, m_expiredInSeconds);
588
+ }
589
+
590
+ bool MMKV::set(double value, MMKVKey_t key, uint32_t expireDuration) {
591
+ if (isKeyEmpty(key)) {
592
+ return false;
593
+ }
594
+ size_t size = mmkv_unlikely(m_enableKeyExpire) ? Fixed32Size + pbDoubleSize() : pbDoubleSize();
595
+ MMBuffer data(size);
596
+ CodedOutputData output(data.getPtr(), size);
597
+ output.writeDouble(value);
598
+ if (mmkv_unlikely(m_enableKeyExpire)) {
599
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
600
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
601
+ } else {
602
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
603
+ }
604
+
605
+ return setDataForKey(std::move(data), key);
606
+ }
607
+
608
+ bool MMKV::setDataForKey(mmkv::MMBuffer &&data, MMKV::MMKVKey_t key, uint32_t expireDuration) {
609
+ if (mmkv_likely(!m_enableKeyExpire)) {
610
+ assert(expireDuration == ExpireNever && "setting expire duration without calling enableAutoKeyExpire() first");
611
+ return setDataForKey(std::move(data), key, true);
612
+ } else {
613
+ auto tmp = MMBuffer(pbMMBufferSize(data) + Fixed32Size);
614
+ CodedOutputData output(tmp.getPtr(), tmp.length());
615
+ output.writeData(data);
616
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
617
+ output.writeRawLittleEndian32(UInt32ToInt32(time));
618
+ return setDataForKey(std::move(tmp), key);
619
+ }
620
+ }
621
+
622
+ bool MMKV::set(const char *value, MMKVKey_t key) {
623
+ return set(value, key, m_expiredInSeconds);
624
+ }
625
+
626
+ bool MMKV::set(const char *value, MMKVKey_t key, uint32_t expireDuration) {
627
+ if (!value) {
628
+ removeValueForKey(key);
629
+ return true;
630
+ }
631
+ return setDataForKey(MMBuffer((void *) value, strlen(value), MMBufferNoCopy), key, expireDuration);
632
+ }
633
+
634
+ bool MMKV::set(const string &value, MMKVKey_t key) {
635
+ return set(value, key, m_expiredInSeconds);
636
+ }
637
+
638
+ bool MMKV::set(const string &value, MMKVKey_t key, uint32_t expireDuration) {
639
+ if (isKeyEmpty(key)) {
640
+ return false;
641
+ }
642
+ return setDataForKey(MMBuffer((void *) value.data(), value.length(), MMBufferNoCopy), key, expireDuration);
643
+ }
644
+
645
+ bool MMKV::set(string_view value, MMKVKey_t key) {
646
+ return set(value, key, m_expiredInSeconds);
647
+ }
648
+
649
+ bool MMKV::set(string_view value, MMKVKey_t key, uint32_t expireDuration) {
650
+ if (isKeyEmpty(key)) {
651
+ return false;
652
+ }
653
+ return setDataForKey(MMBuffer((void *) value.data(), value.length(), MMBufferNoCopy), key, expireDuration);
654
+ }
655
+
656
+ bool MMKV::set(const MMBuffer &value, MMKVKey_t key) {
657
+ return set(value, key, m_expiredInSeconds);
658
+ }
659
+
660
+ bool MMKV::set(const MMBuffer &value, MMKVKey_t key, uint32_t expireDuration) {
661
+ if (isKeyEmpty(key)) {
662
+ return false;
663
+ }
664
+ return setDataForKey(MMBuffer(value.getPtr(), value.length(), MMBufferNoCopy), key, expireDuration);
665
+ }
666
+
667
+ bool MMKV::set(const vector<string> &value, MMKVKey_t key) {
668
+ return set(value, key, m_expiredInSeconds);
669
+ }
670
+
671
+ bool MMKV::set(const vector<string> &v, MMKVKey_t key, uint32_t expireDuration) {
672
+ if (isKeyEmpty(key)) {
673
+ return false;
674
+ }
675
+ #ifdef MMKV_HAS_CPP20
676
+ auto data = MiniPBCoder::encodeDataWithObject(std::span(v));
677
+ #else
678
+ auto data = MiniPBCoder::encodeDataWithObject(v);
679
+ #endif
680
+ if (mmkv_unlikely(m_enableKeyExpire) && data.length() > 0) {
681
+ auto tmp = MMBuffer(data.length() + Fixed32Size);
682
+ auto ptr = (uint8_t *) tmp.getPtr();
683
+ memcpy(ptr, data.getPtr(), data.length());
684
+ auto time = (expireDuration != ExpireNever) ? getCurrentTimeInSecond() + expireDuration : ExpireNever;
685
+ memcpy(ptr + data.length(), &time, Fixed32Size);
686
+ data = std::move(tmp);
687
+ }
688
+ return setDataForKey(std::move(data), key);
689
+ }
690
+
691
+ bool MMKV::getString(MMKVKey_t key, string &result, bool inplaceModification) {
692
+ if (isKeyEmpty(key)) {
693
+ return false;
694
+ }
695
+ SCOPED_LOCK(m_lock);
696
+ SCOPED_LOCK(m_sharedProcessLock);
697
+ auto data = getDataForKey(key);
698
+ if (data.length() > 0) {
699
+ try {
700
+ CodedInputData input(data.getPtr(), data.length());
701
+ if (inplaceModification) {
702
+ input.readString(result);
703
+ } else {
704
+ result = input.readString();
705
+ }
706
+ return true;
707
+ } catch (std::exception &exception) {
708
+ MMKVError("%s", exception.what());
709
+ } catch (...) {
710
+ MMKVError("decode fail");
711
+ }
712
+ }
713
+ return false;
714
+ }
715
+
716
+ bool MMKV::getBytes(MMKVKey_t key, mmkv::MMBuffer &result) {
717
+ if (isKeyEmpty(key)) {
718
+ return false;
719
+ }
720
+ SCOPED_LOCK(m_lock);
721
+ SCOPED_LOCK(m_sharedProcessLock);
722
+ auto data = getDataForKey(key);
723
+ if (data.length() > 0) {
724
+ try {
725
+ CodedInputData input(data.getPtr(), data.length());
726
+ result = input.readData();
727
+ return true;
728
+ } catch (std::exception &exception) {
729
+ MMKVError("%s", exception.what());
730
+ } catch (...) {
731
+ MMKVError("decode fail");
732
+ }
733
+ }
734
+ return false;
735
+ }
736
+
737
+ MMBuffer MMKV::getBytes(MMKVKey_t key) {
738
+ if (isKeyEmpty(key)) {
739
+ return MMBuffer();
740
+ }
741
+ SCOPED_LOCK(m_lock);
742
+ SCOPED_LOCK(m_sharedProcessLock);
743
+ auto data = getDataForKey(key);
744
+ if (data.length() > 0) {
745
+ try {
746
+ CodedInputData input(data.getPtr(), data.length());
747
+ return input.readData();
748
+ } catch (std::exception &exception) {
749
+ MMKVError("%s", exception.what());
750
+ } catch (...) {
751
+ MMKVError("decode fail");
752
+ }
753
+ }
754
+ return MMBuffer();
755
+ }
756
+
757
+ bool MMKV::getVector(MMKVKey_t key, vector<string> &result) {
758
+ if (isKeyEmpty(key)) {
759
+ return false;
760
+ }
761
+ SCOPED_LOCK(m_lock);
762
+ SCOPED_LOCK(m_sharedProcessLock);
763
+ auto data = getDataForKey(key);
764
+ if (data.length() > 0) {
765
+ try {
766
+ result = MiniPBCoder::decodeVector(data);
767
+ return true;
768
+ } catch (std::exception &exception) {
769
+ MMKVError("%s", exception.what());
770
+ } catch (...) {
771
+ MMKVError("decode fail");
772
+ }
773
+ }
774
+ return false;
775
+ }
776
+
777
+ void MMKV::shared_lock() {
778
+ m_lock->lock();
779
+ m_sharedProcessLock->lock();
780
+ }
781
+
782
+ void MMKV::shared_unlock() {
783
+ m_sharedProcessLock->unlock();
784
+ m_lock->unlock();
785
+ }
786
+
787
+ bool MMKV::getBool(MMKVKey_t key, bool defaultValue, bool *hasValue) {
788
+ if (isKeyEmpty(key)) {
789
+ if (hasValue != nullptr) {
790
+ *hasValue = false;
791
+ }
792
+ return defaultValue;
793
+ }
794
+ SCOPED_LOCK(m_lock);
795
+ SCOPED_LOCK(m_sharedProcessLock);
796
+ auto data = getDataForKey(key);
797
+ if (data.length() > 0) {
798
+ try {
799
+ CodedInputData input(data.getPtr(), data.length());
800
+ if (hasValue != nullptr) {
801
+ *hasValue = true;
802
+ }
803
+ return input.readBool();
804
+ } catch (std::exception &exception) {
805
+ MMKVError("%s", exception.what());
806
+ } catch (...) {
807
+ MMKVError("decode fail");
808
+ }
809
+ }
810
+ if (hasValue != nullptr) {
811
+ *hasValue = false;
812
+ }
813
+ return defaultValue;
814
+ }
815
+
816
+ int32_t MMKV::getInt32(MMKVKey_t key, int32_t defaultValue, bool *hasValue) {
817
+ if (isKeyEmpty(key)) {
818
+ if (hasValue != nullptr) {
819
+ *hasValue = false;
820
+ }
821
+ return defaultValue;
822
+ }
823
+ SCOPED_LOCK(m_lock);
824
+ SCOPED_LOCK(m_sharedProcessLock);
825
+ auto data = getDataForKey(key);
826
+ if (data.length() > 0) {
827
+ try {
828
+ CodedInputData input(data.getPtr(), data.length());
829
+ if (hasValue != nullptr) {
830
+ *hasValue = true;
831
+ }
832
+ return input.readInt32();
833
+ } catch (std::exception &exception) {
834
+ MMKVError("%s", exception.what());
835
+ } catch (...) {
836
+ MMKVError("decode fail");
837
+ }
838
+ }
839
+ if (hasValue != nullptr) {
840
+ *hasValue = false;
841
+ }
842
+ return defaultValue;
843
+ }
844
+
845
+ uint32_t MMKV::getUInt32(MMKVKey_t key, uint32_t defaultValue, bool *hasValue) {
846
+ if (isKeyEmpty(key)) {
847
+ if (hasValue != nullptr) {
848
+ *hasValue = false;
849
+ }
850
+ return defaultValue;
851
+ }
852
+ SCOPED_LOCK(m_lock);
853
+ SCOPED_LOCK(m_sharedProcessLock);
854
+ auto data = getDataForKey(key);
855
+ if (data.length() > 0) {
856
+ try {
857
+ CodedInputData input(data.getPtr(), data.length());
858
+ if (hasValue != nullptr) {
859
+ *hasValue = true;
860
+ }
861
+ return input.readUInt32();
862
+ } catch (std::exception &exception) {
863
+ MMKVError("%s", exception.what());
864
+ } catch (...) {
865
+ MMKVError("decode fail");
866
+ }
867
+ }
868
+ if (hasValue != nullptr) {
869
+ *hasValue = false;
870
+ }
871
+ return defaultValue;
872
+ }
873
+
874
+ int64_t MMKV::getInt64(MMKVKey_t key, int64_t defaultValue, bool *hasValue) {
875
+ if (isKeyEmpty(key)) {
876
+ if (hasValue != nullptr) {
877
+ *hasValue = false;
878
+ }
879
+ return defaultValue;
880
+ }
881
+ SCOPED_LOCK(m_lock);
882
+ SCOPED_LOCK(m_sharedProcessLock);
883
+ auto data = getDataForKey(key);
884
+ if (data.length() > 0) {
885
+ try {
886
+ CodedInputData input(data.getPtr(), data.length());
887
+ if (hasValue != nullptr) {
888
+ *hasValue = true;
889
+ }
890
+ return input.readInt64();
891
+ } catch (std::exception &exception) {
892
+ MMKVError("%s", exception.what());
893
+ } catch (...) {
894
+ MMKVError("decode fail");
895
+ }
896
+ }
897
+ if (hasValue != nullptr) {
898
+ *hasValue = false;
899
+ }
900
+ return defaultValue;
901
+ }
902
+
903
+ uint64_t MMKV::getUInt64(MMKVKey_t key, uint64_t defaultValue, bool *hasValue) {
904
+ if (isKeyEmpty(key)) {
905
+ if (hasValue != nullptr) {
906
+ *hasValue = false;
907
+ }
908
+ return defaultValue;
909
+ }
910
+ SCOPED_LOCK(m_lock);
911
+ SCOPED_LOCK(m_sharedProcessLock);
912
+ auto data = getDataForKey(key);
913
+ if (data.length() > 0) {
914
+ try {
915
+ CodedInputData input(data.getPtr(), data.length());
916
+ if (hasValue != nullptr) {
917
+ *hasValue = true;
918
+ }
919
+ return input.readUInt64();
920
+ } catch (std::exception &exception) {
921
+ MMKVError("%s", exception.what());
922
+ } catch (...) {
923
+ MMKVError("decode fail");
924
+ }
925
+ }
926
+ if (hasValue != nullptr) {
927
+ *hasValue = false;
928
+ }
929
+ return defaultValue;
930
+ }
931
+
932
+ float MMKV::getFloat(MMKVKey_t key, float defaultValue, bool *hasValue) {
933
+ if (isKeyEmpty(key)) {
934
+ if (hasValue != nullptr) {
935
+ *hasValue = false;
936
+ }
937
+ return defaultValue;
938
+ }
939
+ SCOPED_LOCK(m_lock);
940
+ SCOPED_LOCK(m_sharedProcessLock);
941
+ auto data = getDataForKey(key);
942
+ if (data.length() > 0) {
943
+ try {
944
+ CodedInputData input(data.getPtr(), data.length());
945
+ if (hasValue != nullptr) {
946
+ *hasValue = true;
947
+ }
948
+ return input.readFloat();
949
+ } catch (std::exception &exception) {
950
+ MMKVError("%s", exception.what());
951
+ } catch (...) {
952
+ MMKVError("decode fail");
953
+ }
954
+ }
955
+ if (hasValue != nullptr) {
956
+ *hasValue = false;
957
+ }
958
+ return defaultValue;
959
+ }
960
+
961
+ double MMKV::getDouble(MMKVKey_t key, double defaultValue, bool *hasValue) {
962
+ if (isKeyEmpty(key)) {
963
+ if (hasValue != nullptr) {
964
+ *hasValue = false;
965
+ }
966
+ return defaultValue;
967
+ }
968
+ SCOPED_LOCK(m_lock);
969
+ SCOPED_LOCK(m_sharedProcessLock);
970
+ auto data = getDataForKey(key);
971
+ if (data.length() > 0) {
972
+ try {
973
+ CodedInputData input(data.getPtr(), data.length());
974
+ if (hasValue != nullptr) {
975
+ *hasValue = true;
976
+ }
977
+ return input.readDouble();
978
+ } catch (std::exception &exception) {
979
+ MMKVError("%s", exception.what());
980
+ } catch (...) {
981
+ MMKVError("decode fail");
982
+ }
983
+ }
984
+ if (hasValue != nullptr) {
985
+ *hasValue = false;
986
+ }
987
+ return defaultValue;
988
+ }
989
+
990
+ size_t MMKV::getValueSize(MMKVKey_t key, bool actualSize) {
991
+ if (isKeyEmpty(key)) {
992
+ return 0;
993
+ }
994
+ SCOPED_LOCK(m_lock);
995
+ SCOPED_LOCK(m_sharedProcessLock);
996
+ auto data = getDataForKey(key);
997
+ if (actualSize) {
998
+ try {
999
+ CodedInputData input(data.getPtr(), data.length());
1000
+ auto length = input.readInt32();
1001
+ if (length >= 0) {
1002
+ auto s_length = static_cast<size_t>(length);
1003
+ if (pbRawVarint32Size(length) + s_length == data.length()) {
1004
+ return s_length;
1005
+ }
1006
+ }
1007
+ } catch (std::exception &exception) {
1008
+ MMKVError("%s", exception.what());
1009
+ } catch (...) {
1010
+ MMKVError("decode fail");
1011
+ }
1012
+ }
1013
+ return data.length();
1014
+ }
1015
+
1016
+ int32_t MMKV::writeValueToBuffer(MMKVKey_t key, void *ptr, int32_t size) {
1017
+ if (isKeyEmpty(key) || size < 0) {
1018
+ return -1;
1019
+ }
1020
+ auto s_size = static_cast<size_t>(size);
1021
+
1022
+ SCOPED_LOCK(m_lock);
1023
+ SCOPED_LOCK(m_sharedProcessLock);
1024
+ auto data = getDataForKey(key);
1025
+ try {
1026
+ CodedInputData input(data.getPtr(), data.length());
1027
+ auto length = input.readInt32();
1028
+ auto offset = pbRawVarint32Size(length);
1029
+ if (length >= 0) {
1030
+ auto s_length = static_cast<size_t>(length);
1031
+ if (offset + s_length == data.length()) {
1032
+ if (s_length <= s_size) {
1033
+ memcpy(ptr, (uint8_t *) data.getPtr() + offset, s_length);
1034
+ return length;
1035
+ }
1036
+ } else {
1037
+ if (data.length() <= s_size) {
1038
+ memcpy(ptr, data.getPtr(), data.length());
1039
+ return static_cast<int32_t>(data.length());
1040
+ }
1041
+ }
1042
+ }
1043
+ } catch (std::exception &exception) {
1044
+ MMKVError("%s", exception.what());
1045
+ } catch (...) {
1046
+ MMKVError("encode fail");
1047
+ }
1048
+ return -1;
1049
+ }
1050
+
1051
+ // enumerate
1052
+
1053
+ bool MMKV::containsKey(MMKVKey_t key) {
1054
+ SCOPED_LOCK(m_lock);
1055
+ checkLoadData();
1056
+
1057
+ if (mmkv_likely(!m_enableKeyExpire)) {
1058
+ if (m_crypter) {
1059
+ return m_dicCrypt->find(key) != m_dicCrypt->end();
1060
+ } else {
1061
+ return m_dic->find(key) != m_dic->end();
1062
+ }
1063
+ }
1064
+ auto raw = getDataWithoutMTimeForKey(key);
1065
+ return raw.length() != 0;
1066
+ }
1067
+
1068
+ size_t MMKV::count(bool filterExpire) {
1069
+ SCOPED_LOCK(m_lock);
1070
+ checkLoadData();
1071
+
1072
+ if (mmkv_unlikely(filterExpire && m_enableKeyExpire)) {
1073
+ SCOPED_LOCK(m_exclusiveProcessLock);
1074
+ fullWriteback(nullptr, true);
1075
+ }
1076
+
1077
+ if (m_crypter) {
1078
+ return m_dicCrypt->size();
1079
+ } else {
1080
+ return m_dic->size();
1081
+ }
1082
+ }
1083
+
1084
+ size_t MMKV::totalSize() {
1085
+ SCOPED_LOCK(m_lock);
1086
+ checkLoadData();
1087
+ return m_file->getFileSize();
1088
+ }
1089
+
1090
+ size_t MMKV::actualSize() {
1091
+ SCOPED_LOCK(m_lock);
1092
+ checkLoadData();
1093
+ return m_actualSize;
1094
+ }
1095
+
1096
+ bool MMKV::removeValueForKey(MMKVKey_t key) {
1097
+ if (isKeyEmpty(key)) {
1098
+ return false;
1099
+ }
1100
+ if (isReadOnly()) {
1101
+ MMKVWarning("[%s] file readonly", m_mmapID.c_str());
1102
+ return false;
1103
+ }
1104
+ SCOPED_LOCK(m_lock);
1105
+ SCOPED_LOCK(m_exclusiveProcessLock);
1106
+ checkLoadData();
1107
+
1108
+ return removeDataForKey(key);
1109
+ }
1110
+
1111
+ #ifndef MMKV_APPLE
1112
+
1113
+ vector<string> MMKV::allKeys(bool filterExpire) {
1114
+ SCOPED_LOCK(m_lock);
1115
+ checkLoadData();
1116
+
1117
+ if (mmkv_unlikely(filterExpire && m_enableKeyExpire)) {
1118
+ SCOPED_LOCK(m_exclusiveProcessLock);
1119
+ fullWriteback(nullptr, true);
1120
+ }
1121
+
1122
+ vector<string> keys;
1123
+ if (m_crypter) {
1124
+ for (const auto &itr : *m_dicCrypt) {
1125
+ keys.push_back(itr.first);
1126
+ }
1127
+ } else {
1128
+ for (const auto &itr : *m_dic) {
1129
+ keys.push_back(itr.first);
1130
+ }
1131
+ }
1132
+ return keys;
1133
+ }
1134
+
1135
+ bool MMKV::removeValuesForKeys(const vector<string> &arrKeys) {
1136
+ if (isReadOnly()) {
1137
+ MMKVWarning("[%s] file readonly", m_mmapID.c_str());
1138
+ return false;
1139
+ }
1140
+ if (arrKeys.empty()) {
1141
+ return true;
1142
+ }
1143
+ if (arrKeys.size() == 1) {
1144
+ return removeValueForKey(arrKeys[0]);
1145
+ }
1146
+
1147
+ SCOPED_LOCK(m_lock);
1148
+ SCOPED_LOCK(m_exclusiveProcessLock);
1149
+ checkLoadData();
1150
+
1151
+ size_t deleteCount = 0;
1152
+ if (m_crypter) {
1153
+ for (const auto &key : arrKeys) {
1154
+ auto itr = m_dicCrypt->find(key);
1155
+ if (itr != m_dicCrypt->end()) {
1156
+ m_dicCrypt->erase(itr);
1157
+ deleteCount++;
1158
+ }
1159
+ }
1160
+ } else {
1161
+ for (const auto &key : arrKeys) {
1162
+ auto itr = m_dic->find(key);
1163
+ if (itr != m_dic->end()) {
1164
+ m_dic->erase(itr);
1165
+ deleteCount++;
1166
+ }
1167
+ }
1168
+ }
1169
+ if (deleteCount > 0) {
1170
+ m_hasFullWriteback = false;
1171
+
1172
+ return fullWriteback();
1173
+ }
1174
+ return true;
1175
+ }
1176
+
1177
+ #endif // MMKV_APPLE
1178
+
1179
+ // file
1180
+
1181
+ void MMKV::sync(SyncFlag flag) {
1182
+ MMKVInfo("MMKV::sync, SyncFlag = %d", flag);
1183
+ SCOPED_LOCK(m_lock);
1184
+ if (m_needLoadFromFile || !isFileValid()) {
1185
+ return;
1186
+ }
1187
+ SCOPED_LOCK(m_exclusiveProcessLock);
1188
+
1189
+ m_file->msync(flag);
1190
+ m_metaFile->msync(flag);
1191
+ }
1192
+
1193
+ void MMKV::lock() {
1194
+ SCOPED_LOCK(m_lock);
1195
+ m_exclusiveProcessLock->lock();
1196
+ }
1197
+ void MMKV::unlock() {
1198
+ SCOPED_LOCK(m_lock);
1199
+ m_exclusiveProcessLock->unlock();
1200
+ }
1201
+ bool MMKV::try_lock() {
1202
+ SCOPED_LOCK(m_lock);
1203
+ return m_exclusiveProcessLock->try_lock();
1204
+ }
1205
+
1206
+ #ifndef MMKV_WIN32
1207
+ void MMKV::lock_thread() {
1208
+ m_lock->lock();
1209
+ }
1210
+ void MMKV::unlock_thread() {
1211
+ m_lock->unlock();
1212
+ }
1213
+ bool MMKV::try_lock_thread() {
1214
+ return m_lock->try_lock();
1215
+ }
1216
+ #endif
1217
+
1218
+ // backup
1219
+
1220
+ static bool backupOneToDirectoryByFilePath(const string &mmapKey, const MMKVPath_t &srcPath, const MMKVPath_t &dstPath) {
1221
+ File crcFile(srcPath, OpenFlag::ReadOnly);
1222
+ if (!crcFile.isFileValid()) {
1223
+ return false;
1224
+ }
1225
+
1226
+ bool ret;
1227
+ {
1228
+ #ifdef MMKV_WIN32
1229
+ MMKVInfo("backup one mmkv[%s] from [%ls] to [%ls]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1230
+ #else
1231
+ MMKVInfo("backup one mmkv[%s] from [%s] to [%s]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1232
+ #endif
1233
+ FileLock fileLock(crcFile.getFd());
1234
+ InterProcessLock lock(&fileLock, SharedLockType);
1235
+ SCOPED_LOCK(&lock);
1236
+
1237
+ ret = copyFile(srcPath, dstPath);
1238
+ if (ret) {
1239
+ auto srcCRCPath = srcPath + CRC_SUFFIX;
1240
+ auto dstCRCPath = dstPath + CRC_SUFFIX;
1241
+ ret = copyFile(srcCRCPath, dstCRCPath);
1242
+ }
1243
+ MMKVInfo("finish backup one mmkv[%s]", mmapKey.c_str());
1244
+ }
1245
+ return ret;
1246
+ }
1247
+
1248
+ bool MMKV::backupOneToDirectory(const string &mmapKey, const MMKVPath_t &dstPath, const MMKVPath_t &srcPath, bool compareFullPath) {
1249
+ if (!g_instanceLock) {
1250
+ return false;
1251
+ }
1252
+ // we have to lock the creation of MMKV instance, regardless of in cache or not
1253
+ SCOPED_LOCK(g_instanceLock);
1254
+ MMKV *kv = nullptr;
1255
+ if (!compareFullPath) {
1256
+ auto itr = g_instanceDic->find(mmapKey);
1257
+ if (itr != g_instanceDic->end()) {
1258
+ kv = itr->second;
1259
+ }
1260
+ } else {
1261
+ // mmapKey is actually filename, we can't simply call find()
1262
+ for (auto &pair : *g_instanceDic) {
1263
+ if (pair.second->m_path == srcPath) {
1264
+ kv = pair.second;
1265
+ break;
1266
+ }
1267
+ }
1268
+ }
1269
+ // get one in cache, do it the easy way
1270
+ if (kv) {
1271
+ #ifdef MMKV_WIN32
1272
+ MMKVInfo("backup one cached mmkv[%s] from [%ls] to [%ls]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1273
+ #else
1274
+ MMKVInfo("backup one cached mmkv[%s] from [%s] to [%s]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1275
+ #endif
1276
+ SCOPED_LOCK(kv->m_lock);
1277
+ SCOPED_LOCK(kv->m_sharedProcessLock);
1278
+
1279
+ kv->sync();
1280
+ auto ret = copyFile(kv->m_path, dstPath);
1281
+ if (ret) {
1282
+ auto dstCRCPath = dstPath + CRC_SUFFIX;
1283
+ ret = copyFile(kv->m_crcPath, dstCRCPath);
1284
+ }
1285
+ MMKVInfo("finish backup one mmkv[%s], ret: %d", mmapKey.c_str(), ret);
1286
+ return ret;
1287
+ }
1288
+
1289
+ // no luck with cache, do it the hard way
1290
+ bool ret = backupOneToDirectoryByFilePath(mmapKey, srcPath, dstPath);
1291
+ return ret;
1292
+ }
1293
+
1294
+ bool MMKV::backupOneToDirectory(const string &mmapID, const MMKVPath_t &dstDir, const MMKVPath_t *srcDir) {
1295
+ auto rootPath = srcDir ? srcDir : &g_realRootDir;
1296
+ if (*rootPath == dstDir) {
1297
+ return true;
1298
+ }
1299
+ mkPath(dstDir);
1300
+ auto dstPath = mappedKVPathWithID(mmapID, &dstDir);
1301
+ string mmapKey = mmapedKVKey(mmapID, rootPath);
1302
+ #ifdef MMKV_ANDROID
1303
+ string srcPath;
1304
+ switch (tryMigrateLegacyMMKVFile(mmapID, rootPath)) {
1305
+ case MigrateStatus::OldToNewMigrateFail: {
1306
+ auto legacyID = legacyMmapedKVKey(mmapID, rootPath);
1307
+ srcPath = mappedKVPathWithID(legacyID, rootPath);
1308
+ break;
1309
+ }
1310
+ case MigrateStatus::NoneExist:
1311
+ MMKVWarning("file with ID [%s] not exist in path [%s]", mmapID.c_str(), rootPath->c_str());
1312
+ return false;
1313
+ default:
1314
+ srcPath = mappedKVPathWithID(mmapID, rootPath);
1315
+ break;
1316
+ }
1317
+ #else
1318
+ auto srcPath = mappedKVPathWithID(mmapID, rootPath);
1319
+ #endif
1320
+ return backupOneToDirectory(mmapKey, dstPath, srcPath, false);
1321
+ }
1322
+
1323
+ bool endsWith(const MMKVPath_t &str, const MMKVPath_t &suffix) {
1324
+ if (str.length() >= suffix.length()) {
1325
+ return str.compare(str.length() - suffix.length(), suffix.length(), suffix) == 0;
1326
+ } else {
1327
+ return false;
1328
+ }
1329
+ }
1330
+
1331
+ MMKVPath_t filename(const MMKVPath_t &path) {
1332
+ auto startPos = path.rfind(MMKV_PATH_SLASH);
1333
+ startPos++; // don't need to check for npos, because npos+1 == 0
1334
+ auto filename = path.substr(startPos);
1335
+ return filename;
1336
+ }
1337
+
1338
+ size_t MMKV::backupAllToDirectory(const MMKVPath_t &dstDir, const MMKVPath_t &srcDir, bool isInSpecialDir) {
1339
+ unordered_set<MMKVPath_t> mmapIDSet;
1340
+ unordered_set<MMKVPath_t> mmapIDCRCSet;
1341
+ walkInDir(srcDir, WalkFile, [&](const MMKVPath_t &filePath, WalkType) {
1342
+ if (endsWith(filePath, CRC_SUFFIX)) {
1343
+ mmapIDCRCSet.insert(filePath);
1344
+ } else {
1345
+ mmapIDSet.insert(filePath);
1346
+ }
1347
+ });
1348
+
1349
+ size_t count = 0;
1350
+ if (!mmapIDSet.empty()) {
1351
+ mkPath(dstDir);
1352
+ auto compareFullPath = isInSpecialDir;
1353
+ for (auto &srcPath : mmapIDSet) {
1354
+ auto srcCRCPath = srcPath + CRC_SUFFIX;
1355
+ if (mmapIDCRCSet.find(srcCRCPath) == mmapIDCRCSet.end()) {
1356
+ #ifdef MMKV_WIN32
1357
+ MMKVWarning("crc not exist [%ls]", srcCRCPath.c_str());
1358
+ #else
1359
+ MMKVWarning("crc not exist [%s]", srcCRCPath.c_str());
1360
+ #endif
1361
+ continue;
1362
+ }
1363
+ auto basename = filename(srcPath);
1364
+ const auto &strBasename = MMKVPath_t2String(basename);
1365
+ auto mmapKey = isInSpecialDir ? strBasename : mmapedKVKey(strBasename, &srcDir);
1366
+ auto dstPath = dstDir + MMKV_PATH_SLASH;
1367
+ dstPath += basename;
1368
+ if (backupOneToDirectory(mmapKey, dstPath, srcPath, compareFullPath)) {
1369
+ count++;
1370
+ }
1371
+ }
1372
+ }
1373
+ return count;
1374
+ }
1375
+
1376
+ size_t MMKV::backupAllToDirectory(const MMKVPath_t &dstDir, const MMKVPath_t *srcDir) {
1377
+ auto rootPath = srcDir ? srcDir : &g_realRootDir;
1378
+ if (*rootPath == dstDir) {
1379
+ return true;
1380
+ }
1381
+ auto count = backupAllToDirectory(dstDir, *rootPath, false);
1382
+
1383
+ auto specialSrcDir = *rootPath + MMKV_PATH_SLASH + SPECIAL_CHARACTER_DIRECTORY_NAME;
1384
+ if (isFileExist(specialSrcDir)) {
1385
+ auto specialDstDir = dstDir + MMKV_PATH_SLASH + SPECIAL_CHARACTER_DIRECTORY_NAME;
1386
+ count += backupAllToDirectory(specialDstDir, specialSrcDir, true);
1387
+ }
1388
+ return count;
1389
+ }
1390
+
1391
+ // restore
1392
+
1393
+ static bool restoreOneFromDirectoryByFilePath(const string &mmapKey, const MMKVPath_t &srcPath, const MMKVPath_t &dstPath) {
1394
+ auto dstCRCPath = dstPath + CRC_SUFFIX;
1395
+ File dstCRCFile(std::move(dstCRCPath), OpenFlag::ReadWrite | OpenFlag::Create);
1396
+ if (!dstCRCFile.isFileValid()) {
1397
+ return false;
1398
+ }
1399
+
1400
+ bool ret;
1401
+ {
1402
+ #ifdef MMKV_WIN32
1403
+ MMKVInfo("restore one mmkv[%s] from [%ls] to [%ls]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1404
+ #else
1405
+ MMKVInfo("restore one mmkv[%s] from [%s] to [%s]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1406
+ #endif
1407
+ FileLock fileLock(dstCRCFile.getFd());
1408
+ InterProcessLock lock(&fileLock, ExclusiveLockType);
1409
+ SCOPED_LOCK(&lock);
1410
+
1411
+ ret = copyFileContent(srcPath, dstPath);
1412
+ if (ret) {
1413
+ auto srcCRCPath = srcPath + CRC_SUFFIX;
1414
+ ret = copyFileContent(srcCRCPath, dstCRCFile.getFd());
1415
+ }
1416
+ MMKVInfo("finish restore one mmkv[%s]", mmapKey.c_str());
1417
+ }
1418
+ return ret;
1419
+ }
1420
+
1421
+ // We can't simply replace the existing file, because other processes might have already open it.
1422
+ // They won't know a difference when the file has been replaced.
1423
+ // We have to let them know by overriding the existing file with new content.
1424
+ bool MMKV::restoreOneFromDirectory(const string &mmapKey, const MMKVPath_t &srcPath, const MMKVPath_t &dstPath, bool compareFullPath) {
1425
+ if (!g_instanceLock) {
1426
+ return false;
1427
+ }
1428
+ // we have to lock the creation of MMKV instance, regardless of in cache or not
1429
+ SCOPED_LOCK(g_instanceLock);
1430
+ MMKV *kv = nullptr;
1431
+ if (!compareFullPath) {
1432
+ auto itr = g_instanceDic->find(mmapKey);
1433
+ if (itr != g_instanceDic->end()) {
1434
+ kv = itr->second;
1435
+ }
1436
+ } else {
1437
+ // mmapKey is actually filename, we can't simply call find()
1438
+ for (auto &pair : *g_instanceDic) {
1439
+ if (pair.second->m_path == dstPath) {
1440
+ kv = pair.second;
1441
+ break;
1442
+ }
1443
+ }
1444
+ }
1445
+ // get one in cache, do it the easy way
1446
+ if (kv) {
1447
+ #ifdef MMKV_WIN32
1448
+ MMKVInfo("restore one cached mmkv[%s] from [%ls] to [%ls]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1449
+ #else
1450
+ MMKVInfo("restore one cached mmkv[%s] from [%s] to [%s]", mmapKey.c_str(), srcPath.c_str(), dstPath.c_str());
1451
+ #endif
1452
+ SCOPED_LOCK(kv->m_lock);
1453
+ SCOPED_LOCK(kv->m_exclusiveProcessLock);
1454
+
1455
+ kv->sync();
1456
+ auto ret = copyFileContent(srcPath, kv->m_file->getFd());
1457
+ kv->m_file->cleanMayflyFD();
1458
+ if (ret) {
1459
+ auto srcCRCPath = srcPath + CRC_SUFFIX;
1460
+ // ret = copyFileContent(srcCRCPath, kv->m_metaFile->getFd());
1461
+ // kv->m_metaFile->cleanMayflyFD();
1462
+ #ifndef MMKV_ANDROID
1463
+ MemoryFile srcCRCFile(srcCRCPath);
1464
+ #else
1465
+ MemoryFile srcCRCFile(srcCRCPath, DEFAULT_MMAP_SIZE, MMFILE_TYPE_FILE);
1466
+ #endif
1467
+ if (srcCRCFile.isFileValid()) {
1468
+ memcpy(kv->m_metaFile->getMemory(), srcCRCFile.getMemory(), sizeof(MMKVMetaInfo));
1469
+ } else {
1470
+ ret = false;
1471
+ }
1472
+ }
1473
+
1474
+ // reload data after restore
1475
+ kv->clearMemoryCache();
1476
+ kv->loadFromFile();
1477
+ if (kv->isMultiProcess()) {
1478
+ kv->notifyContentChanged();
1479
+ }
1480
+
1481
+ MMKVInfo("finish restore one mmkv[%s], ret: %d", mmapKey.c_str(), ret);
1482
+ return ret;
1483
+ }
1484
+
1485
+ // no luck with cache, do it the hard way
1486
+ bool ret = restoreOneFromDirectoryByFilePath(mmapKey, srcPath, dstPath);
1487
+ return ret;
1488
+ }
1489
+
1490
+ bool MMKV::restoreOneFromDirectory(const string &mmapID, const MMKVPath_t &srcDir, const MMKVPath_t *dstDir) {
1491
+ auto rootPath = dstDir ? dstDir : &g_realRootDir;
1492
+ if (*rootPath == srcDir) {
1493
+ return true;
1494
+ }
1495
+ mkPath(*rootPath);
1496
+ auto srcPath = mappedKVPathWithID(mmapID, &srcDir);
1497
+ auto mmapKey = mmapedKVKey(mmapID, rootPath);
1498
+ #ifdef MMKV_ANDROID
1499
+ string dstPath;
1500
+ if (tryMigrateLegacyMMKVFile(mmapID, rootPath) == MigrateStatus::OldToNewMigrateFail) {
1501
+ auto legacyID = legacyMmapedKVKey(mmapID, rootPath);
1502
+ dstPath = mappedKVPathWithID(legacyID, rootPath);
1503
+ } else {
1504
+ dstPath = mappedKVPathWithID(mmapID, rootPath);
1505
+ }
1506
+ #else
1507
+ auto dstPath = mappedKVPathWithID(mmapID, rootPath);
1508
+ #endif
1509
+ return restoreOneFromDirectory(mmapKey, srcPath, dstPath, false);
1510
+ }
1511
+
1512
+ size_t MMKV::restoreAllFromDirectory(const MMKVPath_t &srcDir, const MMKVPath_t &dstDir, bool isInSpecialDir) {
1513
+ unordered_set<MMKVPath_t> mmapIDSet;
1514
+ unordered_set<MMKVPath_t> mmapIDCRCSet;
1515
+ walkInDir(srcDir, WalkFile, [&](const MMKVPath_t &filePath, WalkType) {
1516
+ if (endsWith(filePath, CRC_SUFFIX)) {
1517
+ mmapIDCRCSet.insert(filePath);
1518
+ } else {
1519
+ mmapIDSet.insert(filePath);
1520
+ }
1521
+ });
1522
+
1523
+ size_t count = 0;
1524
+ if (!mmapIDSet.empty()) {
1525
+ mkPath(dstDir);
1526
+ auto compareFullPath = isInSpecialDir;
1527
+ for (auto &srcPath : mmapIDSet) {
1528
+ auto srcCRCPath = srcPath + CRC_SUFFIX;
1529
+ if (mmapIDCRCSet.find(srcCRCPath) == mmapIDCRCSet.end()) {
1530
+ #ifdef MMKV_WIN32
1531
+ MMKVWarning("crc not exist [%ls]", srcCRCPath.c_str());
1532
+ #else
1533
+ MMKVWarning("crc not exist [%s]", srcCRCPath.c_str());
1534
+ #endif
1535
+ continue;
1536
+ }
1537
+ auto basename = filename(srcPath);
1538
+ const auto &strBasename = MMKVPath_t2String(basename);
1539
+ auto mmapKey = isInSpecialDir ? strBasename : mmapedKVKey(strBasename, &dstDir);
1540
+ auto dstPath = dstDir + MMKV_PATH_SLASH;
1541
+ dstPath += basename;
1542
+ if (restoreOneFromDirectory(mmapKey, srcPath, dstPath, compareFullPath)) {
1543
+ count++;
1544
+ }
1545
+ }
1546
+ }
1547
+ return count;
1548
+ }
1549
+
1550
+ size_t MMKV::restoreAllFromDirectory(const MMKVPath_t &srcDir, const MMKVPath_t *dstDir) {
1551
+ auto rootPath = dstDir ? dstDir : &g_realRootDir;
1552
+ if (*rootPath == srcDir) {
1553
+ return true;
1554
+ }
1555
+ auto count = restoreAllFromDirectory(srcDir, *rootPath, true);
1556
+
1557
+ auto specialSrcDir = srcDir + MMKV_PATH_SLASH + SPECIAL_CHARACTER_DIRECTORY_NAME;
1558
+ if (isFileExist(specialSrcDir)) {
1559
+ auto specialDstDir = *rootPath + MMKV_PATH_SLASH + SPECIAL_CHARACTER_DIRECTORY_NAME;
1560
+ count += restoreAllFromDirectory(specialSrcDir, specialDstDir, false);
1561
+ }
1562
+ return count;
1563
+ }
1564
+
1565
+ // callbacks
1566
+
1567
+ void MMKV::registerErrorHandler(ErrorHandler handler) {
1568
+ if (!g_instanceLock) {
1569
+ return;
1570
+ }
1571
+ SCOPED_LOCK(g_instanceLock);
1572
+ g_errorHandler = handler;
1573
+ }
1574
+
1575
+ void MMKV::unRegisterErrorHandler() {
1576
+ if (!g_instanceLock) {
1577
+ return;
1578
+ }
1579
+ SCOPED_LOCK(g_instanceLock);
1580
+ g_errorHandler = nullptr;
1581
+ }
1582
+
1583
+ void MMKV::registerLogHandler(LogHandler handler) {
1584
+ if (!g_instanceLock) {
1585
+ return;
1586
+ }
1587
+ SCOPED_LOCK(g_instanceLock);
1588
+ g_logHandler = handler;
1589
+ }
1590
+
1591
+ void MMKV::unRegisterLogHandler() {
1592
+ if (!g_instanceLock) {
1593
+ return;
1594
+ }
1595
+ SCOPED_LOCK(g_instanceLock);
1596
+ g_logHandler = nullptr;
1597
+ }
1598
+
1599
+ void MMKV::setLogLevel(MMKVLogLevel level) {
1600
+ if (!g_instanceLock) {
1601
+ return;
1602
+ }
1603
+ SCOPED_LOCK(g_instanceLock);
1604
+ g_currentLogLevel = level;
1605
+ }
1606
+
1607
+ static void mkSpecialCharacterFileDirectory() {
1608
+ MMKVPath_t path = g_realRootDir + MMKV_PATH_SLASH + SPECIAL_CHARACTER_DIRECTORY_NAME;
1609
+ mkPath(path);
1610
+ }
1611
+
1612
+ template <typename T>
1613
+ static string md5(const basic_string<T> &value) {
1614
+ uint8_t md[MD5_DIGEST_LENGTH] = {};
1615
+ char tmp[3] = {}, buf[33] = {};
1616
+ openssl::MD5((const uint8_t *) value.c_str(), value.size() * (sizeof(T) / sizeof(uint8_t)), md);
1617
+ for (auto ch : md) {
1618
+ snprintf(tmp, sizeof(tmp), "%2.2x", ch);
1619
+ strcat(buf, tmp);
1620
+ }
1621
+ return {buf};
1622
+ }
1623
+
1624
+ static MMKVPath_t encodeFilePath(const string &mmapID) {
1625
+ const char *specialCharacters = "\\/:*?\"<>|";
1626
+ string encodedID;
1627
+ bool hasSpecialCharacter = false;
1628
+ for (auto ch : mmapID) {
1629
+ if (strchr(specialCharacters, ch) != nullptr) {
1630
+ encodedID = md5(mmapID);
1631
+ hasSpecialCharacter = true;
1632
+ break;
1633
+ }
1634
+ }
1635
+ if (hasSpecialCharacter) {
1636
+ static ThreadOnceToken_t once = ThreadOnceUninitialized;
1637
+ ThreadLock::ThreadOnce(&once, mkSpecialCharacterFileDirectory);
1638
+ return MMKVPath_t(SPECIAL_CHARACTER_DIRECTORY_NAME) + MMKV_PATH_SLASH + string2MMKVPath_t(encodedID);
1639
+ } else {
1640
+ return string2MMKVPath_t(mmapID);
1641
+ }
1642
+ }
1643
+
1644
+ static MMKVPath_t encodeFilePath(const string &mmapID, const MMKVPath_t &rootDir) {
1645
+ const char *specialCharacters = "\\/:*?\"<>|";
1646
+ string encodedID;
1647
+ bool hasSpecialCharacter = false;
1648
+ for (auto ch : mmapID) {
1649
+ if (strchr(specialCharacters, ch) != nullptr) {
1650
+ encodedID = md5(mmapID);
1651
+ hasSpecialCharacter = true;
1652
+ break;
1653
+ }
1654
+ }
1655
+ if (hasSpecialCharacter) {
1656
+ MMKVPath_t path = rootDir + MMKV_PATH_SLASH + SPECIAL_CHARACTER_DIRECTORY_NAME;
1657
+ mkPath(path);
1658
+
1659
+ return MMKVPath_t(SPECIAL_CHARACTER_DIRECTORY_NAME) + MMKV_PATH_SLASH + string2MMKVPath_t(encodedID);
1660
+ } else {
1661
+ return string2MMKVPath_t(mmapID);
1662
+ }
1663
+ }
1664
+
1665
+ string mmapedKVKey(const string &mmapID, const MMKVPath_t *rootPath) {
1666
+ MMKVPath_t path;
1667
+ // compare by pointer to speedup a bit, it's OK false detecting
1668
+ if (rootPath && (rootPath != &g_realRootDir)) {
1669
+ auto tmp = *rootPath + MMKV_PATH_SLASH + string2MMKVPath_t(mmapID);
1670
+ path = absolutePath(tmp);
1671
+ } else {
1672
+ path = g_realRootDir + MMKV_PATH_SLASH + string2MMKVPath_t(mmapID);
1673
+ }
1674
+ return md5(path);
1675
+ }
1676
+
1677
+ string legacyMmapedKVKey(const string &mmapID, const MMKVPath_t *rootPath) {
1678
+ if (rootPath && (*rootPath != g_rootDir)) {
1679
+ return md5(*rootPath + MMKV_PATH_SLASH + string2MMKVPath_t(mmapID));
1680
+ }
1681
+ return mmapID;
1682
+ }
1683
+
1684
+ #ifndef MMKV_ANDROID
1685
+ MMKVPath_t mappedKVPathWithID(const string &mmapID, const MMKVPath_t *rootPath) {
1686
+ if (rootPath && (rootPath != &g_realRootDir)) {
1687
+ auto path = *rootPath + MMKV_PATH_SLASH + encodeFilePath(mmapID, *rootPath);
1688
+ return absolutePath(path);
1689
+ }
1690
+ auto path = g_realRootDir + MMKV_PATH_SLASH + encodeFilePath(mmapID);
1691
+ return path;
1692
+ }
1693
+ #else
1694
+ MMKVPath_t mappedKVPathWithID(const string &mmapID, const MMKVPath_t *rootPath, MMKVMode mode) {
1695
+ if (mode & MMKV_ASHMEM) {
1696
+ return ashmemMMKVPathWithID(encodeFilePath(mmapID));
1697
+ } else if (rootPath && (rootPath != &g_realRootDir)) {
1698
+ auto path = *rootPath + MMKV_PATH_SLASH + encodeFilePath(mmapID, *rootPath);
1699
+ return absolutePath(path);
1700
+ }
1701
+ auto path = g_realRootDir + MMKV_PATH_SLASH + encodeFilePath(mmapID);
1702
+ return path;
1703
+ }
1704
+ #endif
1705
+
1706
+ MMKVPath_t crcPathWithPath(const MMKVPath_t &kvPath) {
1707
+ return kvPath + CRC_SUFFIX;
1708
+ }
1709
+
1710
+ MMKVRecoverStrategic onMMKVCRCCheckFail(const string &mmapID) {
1711
+ if (g_errorHandler) {
1712
+ return g_errorHandler(mmapID, MMKVErrorType::MMKVCRCCheckFail);
1713
+ }
1714
+ return OnErrorDiscard;
1715
+ }
1716
+
1717
+ MMKVRecoverStrategic onMMKVFileLengthError(const string &mmapID) {
1718
+ if (g_errorHandler) {
1719
+ return g_errorHandler(mmapID, MMKVErrorType::MMKVFileLength);
1720
+ }
1721
+ return OnErrorDiscard;
1722
+ }
1723
+
1724
+ // NameSpace
1725
+
1726
+ NameSpace MMKV::nameSpace(const MMKVPath_t &rootDir) {
1727
+ if (!g_instanceLock) {
1728
+ ensureMinimalInitialize();
1729
+ }
1730
+
1731
+ static ThreadOnceToken_t once = ThreadOnceUninitialized;
1732
+ ThreadLock::ThreadOnce(&once, []{
1733
+ g_namespaceLock = new ThreadLock;
1734
+ g_namespaceLock->initialize();
1735
+ });
1736
+ SCOPED_LOCK(g_namespaceLock);
1737
+
1738
+ auto itr = g_realRootMap.find(rootDir);
1739
+ if (itr == g_realRootMap.end()) {
1740
+ auto realRoot = absolutePath(rootDir);
1741
+ if (realRoot.ends_with(MMKV_PATH_SLASH)) {
1742
+ realRoot.erase(realRoot.size() - 1);
1743
+ }
1744
+ itr = g_realRootMap.emplace(rootDir, realRoot).first;
1745
+ }
1746
+ return NameSpace(itr->second);
1747
+ }
1748
+
1749
+ NameSpace MMKV::defaultNameSpace() {
1750
+ if (g_rootDir.empty()) {
1751
+ MMKVWarning("MMKV has not been initialized, there's no default NameSpace.");
1752
+ return NameSpace(MMKVPath_t());
1753
+ }
1754
+ return NameSpace(g_realRootDir);
1755
+ }
1756
+
1757
+ #ifndef MMKV_ANDROID
1758
+ MMKV *NameSpace::mmkvWithID(const string &mmapID, MMKVMode mode, const string *cryptKey, size_t expectedCapacity, bool aes256) {
1759
+ return MMKV::mmkvWithID(mmapID, mode, cryptKey, &m_rootDir, expectedCapacity, aes256);
1760
+ }
1761
+ #endif
1762
+
1763
+ bool NameSpace::backupOneToDirectory(const std::string &mmapID, const MMKVPath_t &dstDir) {
1764
+ return MMKV::backupOneToDirectory(mmapID, dstDir, &m_rootDir);
1765
+ }
1766
+
1767
+ bool NameSpace::restoreOneFromDirectory(const std::string &mmapID, const MMKVPath_t &srcDir) {
1768
+ return MMKV::restoreOneFromDirectory(mmapID, srcDir, &m_rootDir);
1769
+ }
1770
+
1771
+ size_t NameSpace::backupAllToDirectory(const MMKVPath_t &dstDir) {
1772
+ return MMKV::backupAllToDirectory(dstDir, &m_rootDir);
1773
+ }
1774
+
1775
+ size_t NameSpace::restoreAllFromDirectory(const MMKVPath_t &srcDir) {
1776
+ return MMKV::restoreAllFromDirectory(srcDir, &m_rootDir);
1777
+ }
1778
+
1779
+ bool NameSpace::isFileValid(const std::string &mmapID) {
1780
+ return MMKV::isFileValid(mmapID, &m_rootDir);
1781
+ }
1782
+
1783
+ bool NameSpace::removeStorage(const std::string &mmapID) {
1784
+ return MMKV::removeStorage(mmapID, &m_rootDir);
1785
+ }
1786
+
1787
+ bool NameSpace::checkExist(const std::string &mmapID) {
1788
+ return MMKV::checkExist(mmapID, &m_rootDir);
1789
+ }
1790
+
1791
+ MMKV_NAMESPACE_END