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

Function encodeString_2

Android/MMKV/mmkv/src/main/cpp/native-bridge.cpp:642–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640}
641
642MMKV_JNI jboolean encodeString_2(JNIEnv *env, jobject, jlong handle, jstring oKey, jstring oValue, jint expiration) {
643 MMKV *kv = reinterpret_cast<MMKV *>(handle);
644 if (kv && oKey) {
645 string key = jstring2string(env, oKey);
646 if (oValue) {
647 string value = jstring2string(env, oValue);
648 return (jboolean) kv->set(value, key, (uint32_t) expiration);
649 } else {
650 kv->removeValueForKey(key);
651 return (jboolean) true;
652 }
653 }
654 return (jboolean) false;
655}
656
657MMKV_JNI jstring decodeString(JNIEnv *env, jobject obj, jlong handle, jstring oKey, jstring oDefaultValue) {
658 MMKV *kv = reinterpret_cast<MMKV *>(handle);

Callers

nothing calls this directly

Calls 3

jstring2stringFunction · 0.70
setMethod · 0.45
removeValueForKeyMethod · 0.45

Tested by

no test coverage detected