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

Method getRawDataForKey

Core/MMKV_IO.cpp:624–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622}
623
624MMBuffer MMKV::getRawDataForKey(MMKVKey_t key) {
625 checkLoadData();
626#ifndef MMKV_DISABLE_CRYPT
627 if (m_crypter) {
628 auto itr = m_dicCrypt->find(key);
629 if (itr != m_dicCrypt->end()) {
630 auto basePtr = (uint8_t *) (m_file->getMemory()) + Fixed32Size;
631 return itr->second.toMMBuffer(basePtr, m_crypter);
632 }
633 } else
634#endif
635 {
636 auto itr = m_dic->find(key);
637 if (itr != m_dic->end()) {
638 auto basePtr = (uint8_t *) (m_file->getMemory()) + Fixed32Size;
639 return itr->second.toMMBuffer(basePtr);
640 }
641 }
642 MMBuffer nan;
643 return nan;
644}
645
646mmkv::MMBuffer MMKV::getDataForKey(MMKVKey_t key) {
647 if (mmkv_unlikely(m_enableKeyExpire)) {

Callers

nothing calls this directly

Calls 2

getMemoryMethod · 0.80
toMMBufferMethod · 0.80

Tested by

no test coverage detected