MCPcopy Create free account
hub / github.com/MyGUI/mygui / setValueListImpl

Method setValueListImpl

Tools/EditorFramework/SettingsManager.cpp:219–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 13

splitFunction · 0.85
endWithFunction · 0.50
select_single_nodeMethod · 0.45
document_elementMethod · 0.45
dataMethod · 0.45
emptyMethod · 0.45
nodeMethod · 0.45
first_childMethod · 0.45
remove_childMethod · 0.45
childMethod · 0.45
append_childMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected