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

Function encodeBytes

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

Source from the content-addressed store, hash-verified

310}
311
312MMKV_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
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);

Callers

nothing calls this directly

Calls 3

MMBufferFunction · 0.50
setMethod · 0.45
removeValueForKeyMethod · 0.45

Tested by

no test coverage detected