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

Function decodeString

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

Source from the content-addressed store, hash-verified

655}
656
657MMKV_JNI jstring decodeString(JNIEnv *env, jobject obj, jlong handle, jstring oKey, jstring oDefaultValue) {
658 MMKV *kv = reinterpret_cast<MMKV *>(handle);
659 if (kv && oKey) {
660 string key = jstring2string(env, oKey);
661 string value;
662 bool hasValue = kv->getString(key, value);
663 if (hasValue) {
664 return string2jstring(env, value);
665 }
666 }
667 return oDefaultValue;
668}
669
670MMKV_JNI jboolean encodeBytes(JNIEnv *env, jobject, jlong handle, jstring oKey, jbyteArray oValue) {
671 MMKV *kv = reinterpret_cast<MMKV *>(handle);

Callers

nothing calls this directly

Calls 3

string2jstringFunction · 0.85
jstring2stringFunction · 0.70
getStringMethod · 0.45

Tested by

no test coverage detected