File indexing completed on 2025-01-18 10:15:15
0001
0002
0003 #if !defined(XERCESC_INCLUDE_GUARD_ERRHEADER_XMLDOMMsg)
0004 #define XERCESC_INCLUDE_GUARD_ERRHEADER_XMLDOMMsg
0005
0006 #include <xercesc/framework/XMLErrorReporter.hpp>
0007 #include <xercesc/util/XercesDefs.hpp>
0008 #include <xercesc/dom/DOMError.hpp>
0009
0010 XERCES_CPP_NAMESPACE_BEGIN
0011
0012
0013 #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
0014 # pragma GCC diagnostic push
0015 # pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
0016 #endif
0017
0018 class XMLDOMMsg
0019 {
0020 public :
0021 enum Codes
0022 {
0023 NoError = 0
0024 , F_LowBounds = 1
0025 , DOMEXCEPTION_ERRX = 2
0026 , INDEX_SIZE_ERR = 3
0027 , DOMSTRING_SIZE_ERR = 4
0028 , HIERARCHY_REQUEST_ERR = 5
0029 , WRONG_DOCUMENT_ERR = 6
0030 , INVALID_CHARACTER_ERR = 7
0031 , NO_DATA_ALLOWED_ERR = 8
0032 , NO_MODIFICATION_ALLOWED_ERR = 9
0033 , NOT_FOUND_ERR = 10
0034 , NOT_SUPPORTED_ERR = 11
0035 , INUSE_ATTRIBUTE_ERR = 12
0036 , INVALID_STATE_ERR = 13
0037 , SYNTAX_ERR = 14
0038 , INVALID_MODIFICATION_ERR = 15
0039 , NAMESPACE_ERR = 16
0040 , INVALID_ACCESS_ERR = 17
0041 , VALIDATION_ERR = 18
0042 , TYPE_MISMATCH_ERR = 19
0043 , DOMRANGEEXCEPTION_ERRX = 20
0044 , BAD_BOUNDARYPOINTS_ERR = 21
0045 , INVALID_NODE_TYPE_ERR = 22
0046 , DOMLSEXCEPTION_ERRX = 23
0047 , PARSE_ERR = 24
0048 , SERIALIZE_ERR = 25
0049 , DOMXPATHEXCEPTION_ERRX = 26
0050 , INVALID_EXPRESSION_ERR = 27
0051 , TYPE_ERR = 28
0052 , NO_RESULT_ERR = 29
0053 , Writer_NestedCDATA = 30
0054 , Writer_NotRepresentChar = 31
0055 , Writer_NotRecognizedType = 32
0056 , LSParser_ParseInProgress = 33
0057 , LSParser_ParsingAborted = 34
0058 , LSParser_ParsingFailed = 35
0059 , F_HighBounds = 36
0060 , W_LowBounds = 37
0061 , W_HighBounds = 38
0062 , E_LowBounds = 39
0063 , E_HighBounds = 40
0064 };
0065
0066 static bool isFatal(const XMLDOMMsg::Codes toCheck)
0067 {
0068 return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds));
0069 }
0070
0071 static bool isWarning(const XMLDOMMsg::Codes toCheck)
0072 {
0073 return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
0074 }
0075
0076 static bool isError(const XMLDOMMsg::Codes toCheck)
0077 {
0078 return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
0079 }
0080
0081 static XMLErrorReporter::ErrTypes errorType(const XMLDOMMsg::Codes toCheck)
0082 {
0083 if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
0084 return XMLErrorReporter::ErrType_Warning;
0085 else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
0086 return XMLErrorReporter::ErrType_Fatal;
0087 else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
0088 return XMLErrorReporter::ErrType_Error;
0089 return XMLErrorReporter::ErrTypes_Unknown;
0090 }
0091 static DOMError::ErrorSeverity DOMErrorType(const XMLDOMMsg::Codes toCheck)
0092 {
0093 if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
0094 return DOMError::DOM_SEVERITY_WARNING;
0095 else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
0096 return DOMError::DOM_SEVERITY_FATAL_ERROR;
0097 else return DOMError::DOM_SEVERITY_ERROR;
0098 }
0099
0100 private:
0101
0102
0103
0104 XMLDOMMsg();
0105 };
0106
0107 #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
0108 # pragma GCC diagnostic pop
0109 #endif
0110
0111 XERCES_CPP_NAMESPACE_END
0112
0113 #endif
0114