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

Function getValueSize

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

Source from the content-addressed store, hash-verified

1431}
1432
1433static napi_value getValueSize(napi_env env, napi_callback_info info) {
1434 size_t argc = 3;
1435 napi_value args[3] = {nullptr};
1436 NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr));
1437
1438 auto handle = NValueToUInt64(env, args[0]);
1439 auto key = NValueToString(env, args[1]);
1440 MMKV *kv = reinterpret_cast<MMKV *>(handle);
1441 if (kv && key.length() > 0) {
1442 auto actualSize = NValueToBool(env, args[2]);
1443 return UInt32ToNValue(env, kv->getValueSize(key, actualSize));
1444 }
1445 return NAPIUndefined(env);
1446}
1447
1448static napi_value trim(napi_env env, napi_callback_info info) {
1449 size_t argc = 1;

Callers

nothing calls this directly

Calls 6

NValueToUInt64Function · 0.85
NValueToBoolFunction · 0.85
UInt32ToNValueFunction · 0.85
NAPIUndefinedFunction · 0.85
NValueToStringFunction · 0.70
getValueSizeMethod · 0.45

Tested by

no test coverage detected