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

Function decodeStringSet

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

Source from the content-addressed store, hash-verified

1040}
1041
1042static napi_value decodeStringSet(napi_env env, napi_callback_info info) {
1043 size_t argc = 3;
1044 napi_value args[3] = {nullptr};
1045 NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr));
1046
1047 auto handle = NValueToUInt64(env, args[0]);
1048 auto key = NValueToString(env, args[1]);
1049 MMKV *kv = reinterpret_cast<MMKV *>(handle);
1050 if (kv && key.length() > 0) {
1051 vector<string> result;
1052 if (kv->getVector(key, result)) {
1053 return StringArrayToNValue(env, result);
1054 }
1055 }
1056 return args[2];
1057}
1058
1059static napi_value encodeNumberSet(napi_env env, napi_callback_info info) {
1060 size_t argc = 4;

Callers

nothing calls this directly

Calls 4

NValueToUInt64Function · 0.85
StringArrayToNValueFunction · 0.85
NValueToStringFunction · 0.70
getVectorMethod · 0.45

Tested by

no test coverage detected