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