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

Method getVector

Core/MMKV.cpp:783–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783bool MMKV::getVector(MMKVKey_t key, vector<string> &result) {
784 if (isKeyEmpty(key)) {
785 return false;
786 }
787 SCOPED_LOCK(m_lock);
788 SCOPED_LOCK(m_sharedProcessLock);
789 auto data = getDataForKey(key);
790 if (data.length() > 0) {
791 try {
792 result = MiniPBCoder::decodeVector(data);
793 return true;
794 } catch (std::exception &exception) {
795 MMKVError("%s", exception.what());
796 } catch (...) {
797 MMKVError("decode fail");
798 }
799 }
800 return false;
801}
802
803void MMKV::shared_lock() {
804 m_lock->lock();

Callers

nothing calls this directly

Calls 2

isKeyEmptyFunction · 0.85
decodeVectorFunction · 0.85

Tested by

no test coverage detected