| 347 | } |
| 348 | |
| 349 | MMKV_EXPORT bool encodeBytes_v2(void *handle, const char *oKey, void *oValue, uint64_t length, uint32_t expiration) { |
| 350 | MMKV *kv = static_cast<MMKV *>(handle); |
| 351 | if (kv && oKey) { |
| 352 | auto key = string(oKey); |
| 353 | if (oValue) { |
| 354 | auto value = MMBuffer(oValue, static_cast<size_t>(length), MMBufferNoCopy); |
| 355 | return kv->set(value, key, expiration); |
| 356 | } else { |
| 357 | kv->removeValueForKey(key); |
| 358 | return true; |
| 359 | } |
| 360 | } |
| 361 | return false; |
| 362 | } |
| 363 | |
| 364 | MMKV_EXPORT void *decodeBytes(void *handle, const char *oKey, uint64_t *lengthPtr) { |
| 365 | MMKV *kv = static_cast<MMKV *>(handle); |
nothing calls this directly
no test coverage detected