00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 #ifndef SAXEXCEPTION_HPP
00112 #define SAXEXCEPTION_HPP
00113
00114 #include <xercesc/util/XMLString.hpp>
00115 #include <xercesc/util/XMLUni.hpp>
00116 #include <xercesc/util/XMemory.hpp>
00117
00118 XERCES_CPP_NAMESPACE_BEGIN
00119
00120
00140 class SAXException : public XMemory
00141 {
00142 public:
00149 SAXException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
00150
00151 fMsg(XMLString::replicate(XMLUni::fgZeroLenString, manager))
00152 , fMemoryManager(manager)
00153 {
00154 }
00155
00163 SAXException(const XMLCh* const msg,
00164 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
00165
00166 fMsg(XMLString::replicate(msg, manager))
00167 , fMemoryManager(manager)
00168 {
00169 }
00170
00178 SAXException(const char* const msg,
00179 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
00180
00181 fMsg(XMLString::transcode(msg, manager))
00182 , fMemoryManager(manager)
00183 {
00184 }
00185
00191 SAXException(const SAXException& toCopy) :
00192
00193 fMsg(XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager))
00194 , fMemoryManager(toCopy.fMemoryManager)
00195 {
00196 }
00197
00199 virtual ~SAXException()
00200 {
00201 fMemoryManager->deallocate(fMsg);
00202 }
00203
00205
00206
00214 SAXException& operator=(const SAXException& toCopy)
00215 {
00216 if (this == &toCopy)
00217 return *this;
00218
00219 fMemoryManager->deallocate(fMsg);
00220 fMsg = XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager);
00221 fMemoryManager = toCopy.fMemoryManager;
00222 return *this;
00223 }
00225
00232 virtual const XMLCh* getMessage() const
00233 {
00234 return fMsg;
00235 }
00237
00238
00239 protected :
00240
00241
00242
00243
00244
00245
00246 XMLCh* fMsg;
00247 MemoryManager* fMemoryManager;
00248 };
00249
00250 class SAXNotSupportedException : public SAXException
00251 {
00252
00253 public:
00254 SAXNotSupportedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00255
00263 SAXNotSupportedException(const XMLCh* const msg,
00264 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00265
00273 SAXNotSupportedException(const char* const msg,
00274 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00275
00281 SAXNotSupportedException(const SAXException& toCopy);
00282 };
00283
00284 class SAXNotRecognizedException : public SAXException
00285 {
00286 public:
00287 SAXNotRecognizedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00288
00296 SAXNotRecognizedException(const XMLCh* const msg,
00297 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00298
00306 SAXNotRecognizedException(const char* const msg,
00307 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00308
00314 SAXNotRecognizedException(const SAXException& toCopy);
00315 };
00316
00317 XERCES_CPP_NAMESPACE_END
00318
00319 #endif