| 625 | } |
| 626 | |
| 627 | MMKV_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 | |
| 642 | MMKV_JNI jboolean encodeString_2(JNIEnv *env, jobject, jlong handle, jstring oKey, jstring oValue, jint expiration) { |
| 643 | MMKV *kv = reinterpret_cast<MMKV *>(handle); |
nothing calls this directly
no test coverage detected