MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / open_xml

Function open_xml

src/app/xml_document.cpp:21–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using namespace base;
20
21XmlDocumentRef open_xml(const std::string& filename)
22{
23 FileHandle file(open_file(filename, "rb"));
24 if (!file)
25 throw Exception("Error loading file: " + filename);
26
27 // Try to load the XML file
28 XmlDocumentRef doc(new tinyxml2::XMLDocument());
29 doc->SetValue(filename.c_str());
30 if (doc->LoadFile(file.get()) != tinyxml2::XML_SUCCESS)
31 throw Exception(doc->ErrorStr());
32
33 return doc;
34}
35
36void save_xml(XmlDocumentRef doc, const std::string& filename)
37{

Callers 7

loadWidgetFromXmlFileMethod · 0.85
loadMethod · 0.85
GuiXmlMethod · 0.85
importFileMethod · 0.85
loadThemeXmlMethod · 0.85
loadSkinXmlMethod · 0.85
onLoadMethod · 0.85

Calls 3

ExceptionClass · 0.85
open_fileFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected