MCPcopy Create free account
hub / github.com/Tencent/MMKV / decodeNumberSet

Function decodeNumberSet

OpenHarmony/MMKV/src/main/cpp/native_bridge.cpp:1080–1095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078}
1079
1080static napi_value decodeNumberSet(napi_env env, napi_callback_info info) {
1081 size_t argc = 3;
1082 napi_value args[3] = {nullptr};
1083 NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr));
1084
1085 auto handle = NValueToUInt64(env, args[0]);
1086 auto key = NValueToString(env, args[1]);
1087 MMKV *kv = reinterpret_cast<MMKV *>(handle);
1088 if (kv && key.length() > 0) {
1089 vector<double> result;
1090 if (kv->getVector(key, result)) {
1091 return DoubleArrayToNValue(env, result);
1092 }
1093 }
1094 return args[2];
1095}
1096
1097static napi_value encodeBoolSet(napi_env env, napi_callback_info info) {
1098 size_t argc = 4;

Callers

nothing calls this directly

Calls 4

NValueToUInt64Function · 0.85
DoubleArrayToNValueFunction · 0.85
NValueToStringFunction · 0.70
getVectorMethod · 0.45

Tested by

no test coverage detected