| 332 | } |
| 333 | |
| 334 | MMKV_EXPORT bool encodeBytes(void *handle, const char *oKey, void *oValue, uint64_t length) { |
| 335 | MMKV *kv = static_cast<MMKV *>(handle); |
| 336 | if (kv && oKey) { |
| 337 | auto key = string(oKey); |
| 338 | if (oValue) { |
| 339 | auto value = MMBuffer(oValue, static_cast<size_t>(length), MMBufferNoCopy); |
| 340 | return kv->set(value, key); |
| 341 | } else { |
| 342 | kv->removeValueForKey(key); |
| 343 | return true; |
| 344 | } |
| 345 | } |
| 346 | return false; |
| 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); |
nothing calls this directly
no test coverage detected