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

Method save

Tools/LayoutEditor/EditorWidgets.cpp:141–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139 }
140
141 bool EditorWidgets::save(const MyGUI::UString& _fileName)
142 {
143 size_t index = _fileName.find("|");
144 if (index != MyGUI::UString::npos)
145 {
146 MyGUI::UString fileName = _fileName.substr(0, index);
147 MyGUI::UString itemIndex = _fileName.substr(index + 1);
148
149 return saveToProject(fileName, MyGUI::utility::parseValue<size_t>(itemIndex));
150 }
151
152 mCurrentFileName = _fileName;
153 mCurrentItemName.clear();
154
155 MyGUI::xml::Document doc;
156 doc.createDeclaration();
157 MyGUI::xml::ElementPtr root = doc.createRoot("MyGUI");
158 root->addAttribute("type", "Layout");
159
160 saveWidgetsToXmlNode(root, true);
161
162 if (!doc.save(_fileName))
163 {
164 MYGUI_LOGGING(LogSection, Error, getClassTypeName() << " : " << doc.getLastError());
165 return false;
166 }
167
168 return true;
169 }
170
171 bool EditorWidgets::saveToProject(const MyGUI::UString& _fileName, size_t _index)
172 {

Callers 1

saveToProjectMethod · 0.45

Calls 8

getClassTypeNameFunction · 0.85
substrMethod · 0.80
createDeclarationMethod · 0.80
createRootMethod · 0.80
addAttributeMethod · 0.80
getLastErrorMethod · 0.80
findMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected