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

Function encodeBytes

OpenHarmony/MMKV/src/main/cpp/flutter-bridge.cpp:331–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331MMKV_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
346MMKV_EXPORT bool encodeBytes_v2(void *handle, const char *oKey, void *oValue, uint64_t length, uint32_t expiration) {
347 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