MCPcopy Create free account
hub / github.com/Tencent/MMKV / encodeBytes_v2

Function encodeBytes_v2

Android/MMKV/mmkv/src/main/cpp/flutter-bridge.cpp:349–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349MMKV_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
364MMKV_EXPORT void *decodeBytes(void *handle, const char *oKey, uint64_t *lengthPtr) {
365 MMKV *kv = static_cast<MMKV *>(handle);

Callers

nothing calls this directly

Calls 3

MMBufferFunction · 0.50
setMethod · 0.45
removeValueForKeyMethod · 0.45

Tested by

no test coverage detected