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

Method save

Tools/SkinEditor/EditorState.cpp:437–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435 }
436
437 bool EditorState::save()
438 {
439 pugi::xml_document doc;
440 pugi::xml_node decl = doc.prepend_child(pugi::node_declaration);
441 decl.append_attribute("version") = "1.0";
442 decl.append_attribute("encoding") = "UTF-8";
443
444 ExportManager::getInstance().serialization(doc);
445
446 bool result = doc.save_file(
447 mFileName.asWStr_c_str(),
448 "\t",
449 (pugi::format_indent | pugi::format_write_bom | pugi::format_win_new_line) &
450 (~pugi::format_space_before_slash));
451
452 if (result)
453 {
454 if (mFileName != mDefaultFileName)
455 RecentFilesManager::getInstance().addRecentFile(mFileName);
456
457 ActionManager::getInstance().saveChanges();
458 return true;
459 }
460
461 /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create(
462 replaceTags("Error"),
463 "Error save file",
464 MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes);
465
466 return false;
467 }
468
469 void EditorState::commandRecentFiles(const MyGUI::UString& _commandName, bool& _result)
470 {

Callers

nothing calls this directly

Calls 9

replaceTagsFunction · 0.85
asWStr_c_strMethod · 0.80
saveChangesMethod · 0.80
prepend_childMethod · 0.45
append_attributeMethod · 0.45
serializationMethod · 0.45
save_fileMethod · 0.45
addRecentFileMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected