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

Function encodeSet

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

Source from the content-addressed store, hash-verified

836}
837
838MMKV_JNI jboolean encodeSet(JNIEnv *env, jobject, jlong handle, jstring oKey, jobjectArray arrStr) {
839 MMKV *kv = reinterpret_cast<MMKV *>(handle);
840 if (kv && oKey) {
841 string key = jstring2string(env, oKey);
842 if (arrStr) {
843 vector<string> value = jarray2vector(env, arrStr);
844 return (jboolean) kv->set(value, key);
845 } else {
846 kv->removeValueForKey(key);
847 return (jboolean) true;
848 }
849 }
850 return (jboolean) false;
851}
852
853MMKV_JNI jboolean encodeSet_2(JNIEnv *env, jobject, jlong handle, jstring oKey, jobjectArray arrStr, jint expiration) {
854 MMKV *kv = reinterpret_cast<MMKV *>(handle);

Callers

nothing calls this directly

Calls 4

jarray2vectorFunction · 0.85
jstring2stringFunction · 0.70
setMethod · 0.45
removeValueForKeyMethod · 0.45

Tested by

no test coverage detected