MCPcopy Create free account
hub / github.com/Tencent/phxqueue / GetValue

Method GetValue

phxqueue_phxrpc/comm/iniparser.cpp:113–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112
113bool INIParser::GetValue(const string &section, const string &key, string &val) {
114 phxqueue::comm::utils::RWLock rwlock_read(&impl_->rwlock, phxqueue::comm::utils::RWLock::LockMode::READ);
115
116 val = "";
117 auto &&it = impl_->section_key2val.find(make_pair(section, key));
118 if (impl_->section_key2val.end() == it) {
119 return false;
120 }
121 val = it->second;
122 if (impl_->del_after_get) impl_->section_key2val.erase(it);
123 return true;
124}
125
126void INIParser::SetDelAfterGet(bool del_after_get) {
127 impl_->del_after_get = del_after_get;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected