MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / GetKeyValueList

Method GetKeyValueList

pcsx2/LayeredSettingsInterface.cpp:225–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225std::vector<std::pair<std::string, std::string>> LayeredSettingsInterface::GetKeyValueList(const char* section) const
226{
227 std::unordered_set<std::string_view> seen;
228 std::vector<std::pair<std::string, std::string>> ret;
229 for (u32 layer = FIRST_LAYER; layer <= LAST_LAYER; layer++)
230 {
231 if (SettingsInterface* sif = m_layers[layer])
232 {
233 const size_t newly_added_begin = ret.size();
234 std::vector<std::pair<std::string, std::string>> entries = sif->GetKeyValueList(section);
235 for (std::pair<std::string, std::string>& entry : entries)
236 {
237 if (seen.find(entry.first) != seen.end())
238 continue;
239 ret.push_back(std::move(entry));
240 }
241 // Mark keys as seen after processing all entries in case the layer has multiple entries for a specific key
242 for (auto cur = ret.begin() + newly_added_begin; cur != ret.end(); ++cur)
243 seen.insert(cur->first);
244 }
245 }
246 return ret;
247}
248
249void LayeredSettingsInterface::SetKeyValueList(const char* section, const std::vector<std::pair<std::string, std::string>>& items)
250{

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected