| 640 | } |
| 641 | |
| 642 | MMKV_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 | |
| 657 | MMKV_JNI jstring decodeString(JNIEnv *env, jobject obj, jlong handle, jstring oKey, jstring oDefaultValue) { |
| 658 | MMKV *kv = reinterpret_cast<MMKV *>(handle); |
nothing calls this directly
no test coverage detected