| 781 | } |
| 782 | |
| 783 | bool 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 | |
| 803 | void MMKV::shared_lock() { |
| 804 | m_lock->lock(); |
nothing calls this directly
no test coverage detected