| 85 | } |
| 86 | |
| 87 | void SettingsManager::setValueImpl(std::string_view _path, CString _value) |
| 88 | { |
| 89 | const char* path = _path.empty() ? "" : _path.data(); |
| 90 | pugi::xpath_node node = mUserDocument->document_element().select_single_node(path); |
| 91 | if (!node.node().empty()) |
| 92 | { |
| 93 | node.node().text().set(_value.c_str()); |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | std::vector<std::string> names; |
| 98 | names = MyGUI::utility::split(_path, "/"); |
| 99 | |
| 100 | pugi::xml_node currentNode = mUserDocument->document_element(); |
| 101 | for (const auto& name : names) |
| 102 | { |
| 103 | pugi::xml_node childNode = currentNode.child(name.data()); |
| 104 | if (childNode.empty()) |
| 105 | childNode = currentNode.append_child(name.data()); |
| 106 | |
| 107 | currentNode = childNode; |
| 108 | } |
| 109 | |
| 110 | currentNode.text().set(_value.c_str()); |
| 111 | } |
| 112 | |
| 113 | eventSettingsChanged(_path); |
| 114 | } |
| 115 | |
| 116 | SettingsManager::VectorString SettingsManager::getValueList(std::string_view _path) |
| 117 | { |
nothing calls this directly
no test coverage detected