| 194 | } |
| 195 | |
| 196 | void MemorySettingsInterface::SetValue(const char* section, const char* key, std::string value) |
| 197 | { |
| 198 | auto sit = m_sections.find(section); |
| 199 | if (sit == m_sections.end()) |
| 200 | sit = m_sections.emplace(std::make_pair(std::string(section), KeyMap())).first; |
| 201 | |
| 202 | const auto range = sit->second.equal_range(key); |
| 203 | if (range.first == sit->second.end()) |
| 204 | { |
| 205 | sit->second.emplace(std::string(key), std::move(value)); |
| 206 | return; |
| 207 | } |
| 208 | |
| 209 | auto iter = range.first; |
| 210 | iter->second = std::move(value); |
| 211 | ++iter; |
| 212 | |
| 213 | // remove other values |
| 214 | while (iter != range.second) |
| 215 | { |
| 216 | auto remove = iter++; |
| 217 | sit->second.erase(remove); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | std::vector<std::string> MemorySettingsInterface::GetStringList(const char* section, const char* key) const |
| 222 | { |
no test coverage detected