00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SAXEXCEPTION_HPP
00024 #define SAXEXCEPTION_HPP
00025
00026 #include <xercesc/util/XMLString.hpp>
00027 #include <xercesc/util/XMLUni.hpp>
00028 #include <xercesc/util/XMemory.hpp>
00029
00030 XERCES_CPP_NAMESPACE_BEGIN
00031
00032
00052 class SAXException : public XMemory
00053 {
00054 public:
00061 SAXException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
00062
00063 fMsg(XMLString::replicate(XMLUni::fgZeroLenString, manager))
00064 , fMemoryManager(manager)
00065 {
00066 }
00067
00075 SAXException(const XMLCh* const msg,
00076 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
00077
00078 fMsg(XMLString::replicate(msg, manager))
00079 , fMemoryManager(manager)
00080 {
00081 }
00082
00090 SAXException(const char* const msg,
00091 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
00092
00093 fMsg(XMLString::transcode(msg, manager))
00094 , fMemoryManager(manager)
00095 {
00096 }
00097
00103 SAXException(const SAXException& toCopy) :
00104 XMemory(toCopy)
00105 , fMsg(XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager))
00106 , fMemoryManager(toCopy.fMemoryManager)
00107 {
00108 }
00109
00111 virtual ~SAXException()
00112 {
00113 fMemoryManager->deallocate(fMsg);
00114 }
00115
00117
00118
00126 SAXException& operator=(const SAXException& toCopy)
00127 {
00128 if (this == &toCopy)
00129 return *this;
00130
00131 fMemoryManager->deallocate(fMsg);
00132 fMsg = XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager);
00133 fMemoryManager = toCopy.fMemoryManager;
00134 return *this;
00135 }
00137
00144 virtual const XMLCh* getMessage() const
00145 {
00146 return fMsg;
00147 }
00149
00150
00151 protected :
00152
00153
00154
00155
00156
00157
00158 XMLCh* fMsg;
00159 MemoryManager* fMemoryManager;
00160 };
00161
00162 class SAXNotSupportedException : public SAXException
00163 {
00164
00165 public:
00166 SAXNotSupportedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00167
00175 SAXNotSupportedException(const XMLCh* const msg,
00176 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00177
00185 SAXNotSupportedException(const char* const msg,
00186 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00187
00193 SAXNotSupportedException(const SAXException& toCopy);
00194 };
00195
00196 class SAXNotRecognizedException : public SAXException
00197 {
00198 public:
00199 SAXNotRecognizedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00200
00208 SAXNotRecognizedException(const XMLCh* const msg,
00209 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00210
00218 SAXNotRecognizedException(const char* const msg,
00219 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00220
00226 SAXNotRecognizedException(const SAXException& toCopy);
00227 };
00228
00229 XERCES_CPP_NAMESPACE_END
00230
00231 #endif