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

Method save

Tools/FontEditor/EditorState.cpp:464–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462 }
463
464 bool EditorState::save()
465 {
466 pugi::xml_document doc;
467 pugi::xml_node decl = doc.prepend_child(pugi::node_declaration);
468 decl.append_attribute("version") = "1.0";
469 decl.append_attribute("encoding") = "UTF-8";
470
471 ExportManager::getInstance().serialization(doc);
472
473 bool result = doc.save_file(
474 mFileName.asWStr_c_str(),
475 "\t",
476 (pugi::format_indent | pugi::format_write_bom | pugi::format_win_new_line) &
477 (~pugi::format_space_before_slash));
478
479 if (result)
480 {
481 if (mFileName != mDefaultFileName)
482 RecentFilesManager::getInstance().addRecentFile(mFileName);
483
484 ActionManager::getInstance().saveChanges();
485 return true;
486 }
487
488 /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create(
489 replaceTags("Error"),
490 "Error save file",
491 MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes);
492
493 return false;
494 }
495
496 void EditorState::commandRecentFiles(const MyGUI::UString& _commandName, bool& _result)
497 {

Callers 1

exportDataMethod · 0.45

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