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

Method overrideDataWithKey

Core/MMKV_IO.cpp:1067–1075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1065}
1066
1067KVHolderRet_t MMKV::overrideDataWithKey(const MMBuffer &data, MMKVKey_t key, bool isDataHolder) {
1068#ifdef MMKV_APPLE
1069 auto oData = [key dataUsingEncoding:NSUTF8StringEncoding];
1070 auto keyData = MMBuffer(oData, MMBufferNoCopy);
1071#else
1072 auto keyData = MMBuffer((void *) key.data(), key.size(), MMBufferNoCopy);
1073#endif
1074 return doOverrideDataWithKey(data, keyData, isDataHolder, static_cast<uint32_t>(keyData.length()));
1075}
1076
1077KVHolderRet_t MMKV::appendDataWithKey(const MMBuffer &data, const KeyValueHolder &kvHolder, bool isDataHolder) {
1078 SCOPED_LOCK(m_exclusiveProcessLock);

Callers

nothing calls this directly

Calls 3

getMemoryMethod · 0.80
MMBufferFunction · 0.70
pbRawVarint32SizeFunction · 0.70

Tested by

no test coverage detected