|
@@ -480,6 +480,7 @@ public:
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// WARNING: must match XMLErrorNames[]
|
|
|
enum XMLError {
|
|
enum XMLError {
|
|
|
XML_SUCCESS = 0,
|
|
XML_SUCCESS = 0,
|
|
|
XML_NO_ERROR = 0,
|
|
XML_NO_ERROR = 0,
|
|
@@ -501,34 +502,12 @@ enum XMLError {
|
|
|
XML_ERROR_MISMATCHED_ELEMENT,
|
|
XML_ERROR_MISMATCHED_ELEMENT,
|
|
|
XML_ERROR_PARSING,
|
|
XML_ERROR_PARSING,
|
|
|
XML_CAN_NOT_CONVERT_TEXT,
|
|
XML_CAN_NOT_CONVERT_TEXT,
|
|
|
- XML_NO_TEXT_NODE
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
|
|
+ XML_NO_TEXT_NODE,
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-static const char *ErrorNames[] = {
|
|
|
|
|
- "XML_SUCCESS",
|
|
|
|
|
- "XML_NO_ATTRIBUTE",
|
|
|
|
|
- "XML_WRONG_ATTRIBUTE_TYPE",
|
|
|
|
|
- "XML_ERROR_FILE_NOT_FOUND",
|
|
|
|
|
- "XML_ERROR_FILE_COULD_NOT_BE_OPENED",
|
|
|
|
|
- "XML_ERROR_FILE_READ_ERROR",
|
|
|
|
|
- "XML_ERROR_ELEMENT_MISMATCH",
|
|
|
|
|
- "XML_ERROR_PARSING_ELEMENT",
|
|
|
|
|
- "XML_ERROR_PARSING_ATTRIBUTE",
|
|
|
|
|
- "XML_ERROR_IDENTIFYING_TAG",
|
|
|
|
|
- "XML_ERROR_PARSING_TEXT",
|
|
|
|
|
- "XML_ERROR_PARSING_CDATA",
|
|
|
|
|
- "XML_ERROR_PARSING_COMMENT",
|
|
|
|
|
- "XML_ERROR_PARSING_DECLARATION",
|
|
|
|
|
- "XML_ERROR_PARSING_UNKNOWN",
|
|
|
|
|
- "XML_ERROR_EMPTY_DOCUMENT",
|
|
|
|
|
- "XML_ERROR_MISMATCHED_ELEMENT",
|
|
|
|
|
- "XML_ERROR_PARSING",
|
|
|
|
|
- "XML_CAN_NOT_CONVERT_TEXT",
|
|
|
|
|
- "XML_NO_TEXT_NODE"
|
|
|
|
|
|
|
+ XML_ERROR_COUNT
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
Utility functionality.
|
|
Utility functionality.
|
|
|
*/
|
|
*/
|
|
@@ -605,9 +584,6 @@ public:
|
|
|
static bool ToBool( const char* str, bool* value );
|
|
static bool ToBool( const char* str, bool* value );
|
|
|
static bool ToFloat( const char* str, float* value );
|
|
static bool ToFloat( const char* str, float* value );
|
|
|
static bool ToDouble( const char* str, double* value );
|
|
static bool ToDouble( const char* str, double* value );
|
|
|
-
|
|
|
|
|
- // converts XMLError to strings
|
|
|
|
|
- static const char* ToErrorName( const XMLError errorID );
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1687,6 +1663,8 @@ public:
|
|
|
XMLError ErrorID() const {
|
|
XMLError ErrorID() const {
|
|
|
return _errorID;
|
|
return _errorID;
|
|
|
}
|
|
}
|
|
|
|
|
+ const char* ErrorName() const;
|
|
|
|
|
+
|
|
|
/// Return a possibly helpful diagnostic location or string.
|
|
/// Return a possibly helpful diagnostic location or string.
|
|
|
const char* GetErrorStr1() const {
|
|
const char* GetErrorStr1() const {
|
|
|
return _errorStr1;
|
|
return _errorStr1;
|
|
@@ -1727,6 +1705,8 @@ private:
|
|
|
MemPoolT< sizeof(XMLAttribute) > _attributePool;
|
|
MemPoolT< sizeof(XMLAttribute) > _attributePool;
|
|
|
MemPoolT< sizeof(XMLText) > _textPool;
|
|
MemPoolT< sizeof(XMLText) > _textPool;
|
|
|
MemPoolT< sizeof(XMLComment) > _commentPool;
|
|
MemPoolT< sizeof(XMLComment) > _commentPool;
|
|
|
|
|
+
|
|
|
|
|
+ static const char* _errorNames[XML_ERROR_COUNT];
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|