24 int code =
m_xml.LoadFile(filename.c_str());
27 std::string errorString;
30 case tinyxml2::XML_ERROR_FILE_NOT_FOUND:
31 errorString =
"File not found.";
33 case tinyxml2::XML_ERROR_FILE_COULD_NOT_BE_OPENED:
34 errorString =
"File couldn't be opened.";
39 case tinyxml2::XML_ERROR_PARSING_ELEMENT:
40 errorString =
"Error while parsing element.";
42 case tinyxml2::XML_ERROR_PARSING_ATTRIBUTE:
43 errorString =
"Error while parsing attribute.";
45 case tinyxml2::XML_ERROR_PARSING_TEXT:
46 errorString =
"Error while parsing text.";
48 case tinyxml2::XML_ERROR_PARSING_CDATA:
49 errorString =
"Error while parsing cdata.";
51 case tinyxml2::XML_ERROR_PARSING_COMMENT:
52 errorString =
"Error while parsing comment.";
54 case tinyxml2::XML_ERROR_PARSING_DECLARATION:
55 errorString =
"Error while parsing declaration.";
57 case tinyxml2::XML_ERROR_PARSING_UNKNOWN:
58 errorString =
"Parsing error: Unknown object.";
60 case tinyxml2::XML_ERROR_EMPTY_DOCUMENT:
61 errorString =
"Empty document.";
63 case tinyxml2::XML_ERROR_MISMATCHED_ELEMENT:
64 errorString =
"Element mismatched.";
66 case tinyxml2::XML_ERROR_PARSING:
67 errorString =
"Parsing error.";
70 errorString =
"Unknown error.";
74 throw EXCEPTION(
"Failed to load", filename,
"\nError", code,
":", errorString);
#define EXCEPTION(args...)
tinyxml2::XMLDocument m_xml
void load(const std::string &filename)