| 310 | } |
| 311 | |
| 312 | MMKV_EXPORT bool encodeBytes(void *handle, const char *oKey, void *oValue, uint64_t length) { |
| 313 | MMKV *kv = static_cast<MMKV *>(handle); |
| 314 | if (kv && oKey) { |
| 315 | auto key = string(oKey); |
| 316 | if (oValue) { |
| 317 | auto value = MMBuffer(oValue, static_cast<size_t>(length), MMBufferNoCopy); |
| 318 | return kv->set(value, key); |
| 319 | } else { |
| 320 | kv->removeValueForKey(key); |
| 321 | return true; |
| 322 | } |
| 323 | } |
| 324 | return false; |
| 325 | } |
| 326 | |
| 327 | MMKV_EXPORT bool encodeBytes_v2(void *handle, const char *oKey, void *oValue, uint64_t length, uint32_t expiration) { |
| 328 | MMKV *kv = static_cast<MMKV *>(handle); |
nothing calls this directly
no test coverage detected