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

Function encodeString

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

Source from the content-addressed store, hash-verified

625}
626
627MMKV_JNI jboolean encodeString(JNIEnv *env, jobject, jlong handle, jstring oKey, jstring oValue) {
628 MMKV *kv = reinterpret_cast<MMKV *>(handle);
629 if (kv && oKey) {
630 string key = jstring2string(env, oKey);
631 if (oValue) {
632 string value = jstring2string(env, oValue);
633 return (jboolean) kv->set(value, key);
634 } else {
635 kv->removeValueForKey(key);
636 return (jboolean) true;
637 }
638 }
639 return (jboolean) false;
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);

Callers

nothing calls this directly

Calls 3

jstring2stringFunction · 0.70
setMethod · 0.45
removeValueForKeyMethod · 0.45

Tested by

no test coverage detected