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

Function encodeBytes_v2

flutter/mmkv_linux/linux/flutter-bridge.cpp:327–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327MMKV_EXPORT bool encodeBytes_v2(void *handle, const char *oKey, void *oValue, uint64_t length, uint32_t expiration) {
328 MMKV *kv = static_cast<MMKV *>(handle);
329 if (kv && oKey) {
330 auto key = string(oKey);
331 if (oValue) {
332 auto value = MMBuffer(oValue, static_cast<size_t>(length), MMBufferNoCopy);
333 return kv->set(value, key, expiration);
334 } else {
335 kv->removeValueForKey(key);
336 return true;
337 }
338 }
339 return false;
340}
341
342MMKV_EXPORT void *decodeBytes(void *handle, const char *oKey, uint64_t *lengthPtr) {
343 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