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

Function encodeUInt64

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

Source from the content-addressed store, hash-verified

861}
862
863static napi_value encodeUInt64(napi_env env, napi_callback_info info) {
864 size_t argc = 4;
865 napi_value args[4] = {nullptr};
866 NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr));
867
868 auto handle = NValueToUInt64(env, args[0]);
869 auto key = NValueToString(env, args[1]);
870 MMKV *kv = reinterpret_cast<MMKV *>(handle);
871 if (kv && key.length() > 0) {
872 auto value = NValueToUInt64(env, args[2]);
873 if (IsNValueUndefined(env, args[3])) {
874 auto ret = kv->set(value, key);
875 return BoolToNValue(env, ret);
876 }
877 uint32_t expiration = NValueToUInt32(env, args[3]);
878 auto ret = kv->set(value, key, expiration);
879 return BoolToNValue(env, ret);
880 }
881 return BoolToNValue(env, false);
882}
883
884static napi_value decodeUInt64(napi_env env, napi_callback_info info) {
885 size_t argc = 3;

Callers

nothing calls this directly

Calls 6

NValueToUInt64Function · 0.85
NValueToUInt32Function · 0.85
NValueToStringFunction · 0.70
IsNValueUndefinedFunction · 0.70
BoolToNValueFunction · 0.70
setMethod · 0.45

Tested by

no test coverage detected