| 217 | } |
| 218 | |
| 219 | void SettingsManager::setValueListImpl(std::string_view _path, const VectorString& _values) |
| 220 | { |
| 221 | if (!MyGUI::utility::endWith(_path, ".List")) |
| 222 | return; |
| 223 | |
| 224 | pugi::xml_node targetNode; |
| 225 | |
| 226 | pugi::xpath_node node = mUserDocument->document_element().select_single_node(_path.data()); |
| 227 | if (!node.node().empty()) |
| 228 | { |
| 229 | targetNode = node.node(); |
| 230 | while (!targetNode.first_child().empty()) |
| 231 | targetNode.remove_child(targetNode.first_child()); |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | std::vector<std::string> names; |
| 236 | names = MyGUI::utility::split(_path, "/"); |
| 237 | |
| 238 | pugi::xml_node currentNode = mUserDocument->document_element(); |
| 239 | for (const auto& name : names) |
| 240 | { |
| 241 | pugi::xml_node childNode = currentNode.child(name.data()); |
| 242 | if (childNode.empty()) |
| 243 | childNode = currentNode.append_child(name.data()); |
| 244 | |
| 245 | currentNode = childNode; |
| 246 | } |
| 247 | |
| 248 | targetNode = currentNode; |
| 249 | } |
| 250 | |
| 251 | for (const auto& _value : _values) |
| 252 | targetNode.append_child("Value").text().set(_value.data()); |
| 253 | |
| 254 | eventSettingsChanged(_path); |
| 255 | } |
| 256 | |
| 257 | pugi::xpath_node_set SettingsManager::getValueNodeList(std::string_view _path) |
| 258 | { |
nothing calls this directly
no test coverage detected