00001
00002
00003 #if !defined(XERCESC_INCLUDE_GUARD_ERRHEADER_XMLDOMMsg)
00004 #define XERCESC_INCLUDE_GUARD_ERRHEADER_XMLDOMMsg
00005
00006 #include <xercesc/framework/XMLErrorReporter.hpp>
00007 #include <xercesc/util/XercesDefs.hpp>
00008 #include <xercesc/dom/DOMError.hpp>
00009
00010 XERCES_CPP_NAMESPACE_BEGIN
00011
00012 class XMLDOMMsg
00013 {
00014 public :
00015 enum Codes
00016 {
00017 NoError = 0
00018 , F_LowBounds = 1
00019 , DOMEXCEPTION_ERRX = 2
00020 , INDEX_SIZE_ERR = 3
00021 , DOMSTRING_SIZE_ERR = 4
00022 , HIERARCHY_REQUEST_ERR = 5
00023 , WRONG_DOCUMENT_ERR = 6
00024 , INVALID_CHARACTER_ERR = 7
00025 , NO_DATA_ALLOWED_ERR = 8
00026 , NO_MODIFICATION_ALLOWED_ERR = 9
00027 , NOT_FOUND_ERR = 10
00028 , NOT_SUPPORTED_ERR = 11
00029 , INUSE_ATTRIBUTE_ERR = 12
00030 , INVALID_STATE_ERR = 13
00031 , SYNTAX_ERR = 14
00032 , INVALID_MODIFICATION_ERR = 15
00033 , NAMESPACE_ERR = 16
00034 , INVALID_ACCESS_ERR = 17
00035 , VALIDATION_ERR = 18
00036 , TYPE_MISMATCH_ERR = 19
00037 , DOMRANGEEXCEPTION_ERRX = 20
00038 , BAD_BOUNDARYPOINTS_ERR = 21
00039 , INVALID_NODE_TYPE_ERR = 22
00040 , DOMLSEXCEPTION_ERRX = 23
00041 , PARSE_ERR = 24
00042 , SERIALIZE_ERR = 25
00043 , DOMXPATHEXCEPTION_ERRX = 26
00044 , INVALID_EXPRESSION_ERR = 27
00045 , TYPE_ERR = 28
00046 , NO_RESULT_ERR = 29
00047 , Writer_NestedCDATA = 30
00048 , Writer_NotRepresentChar = 31
00049 , Writer_NotRecognizedType = 32
00050 , LSParser_ParseInProgress = 33
00051 , LSParser_ParsingAborted = 34
00052 , F_HighBounds = 35
00053 , W_LowBounds = 36
00054 , W_HighBounds = 37
00055 , E_LowBounds = 38
00056 , E_HighBounds = 39
00057 };
00058
00059 static bool isFatal(const XMLDOMMsg::Codes toCheck)
00060 {
00061 return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds));
00062 }
00063
00064 static bool isWarning(const XMLDOMMsg::Codes toCheck)
00065 {
00066 return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
00067 }
00068
00069 static bool isError(const XMLDOMMsg::Codes toCheck)
00070 {
00071 return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
00072 }
00073
00074 static XMLErrorReporter::ErrTypes errorType(const XMLDOMMsg::Codes toCheck)
00075 {
00076 if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
00077 return XMLErrorReporter::ErrType_Warning;
00078 else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
00079 return XMLErrorReporter::ErrType_Fatal;
00080 else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
00081 return XMLErrorReporter::ErrType_Error;
00082 return XMLErrorReporter::ErrTypes_Unknown;
00083 }
00084 static DOMError::ErrorSeverity DOMErrorType(const XMLDOMMsg::Codes toCheck)
00085 {
00086 if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
00087 return DOMError::DOM_SEVERITY_WARNING;
00088 else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
00089 return DOMError::DOM_SEVERITY_FATAL_ERROR;
00090 else return DOMError::DOM_SEVERITY_ERROR;
00091 }
00092
00093 private:
00094
00095
00096
00097 XMLDOMMsg();
00098 };
00099
00100 XERCES_CPP_NAMESPACE_END
00101
00102 #endif
00103