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

Function encodeBytes

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

Source from the content-addressed store, hash-verified

332}
333
334MMKV_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
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);

Callers

nothing calls this directly

Calls 3

MMBufferFunction · 0.50
setMethod · 0.45
removeValueForKeyMethod · 0.45

Tested by

no test coverage detected