00001
00002
00003 #include "ACEXML/common/SAXExceptions.h"
00004 #include "ace/Log_Msg.h"
00005 #include "ace/ACE.h"
00006 #include "ace/OS_Memory.h"
00007 #include "ace/OS_NS_string.h"
00008
00009 const ACEXML_Char *ACEXML_SAXException::exception_name_ = ACE_TEXT ("ACEXML_SAXException");
00010
00011 const ACEXML_Char *ACEXML_SAXNotSupportedException::exception_name_ = ACE_TEXT ("ACEXML_SAXNotSupportedException");
00012
00013 const ACEXML_Char *ACEXML_SAXNotRecognizedException::exception_name_ = ACE_TEXT ("ACEXML_SAXNotRecognizedException");
00014
00015 const ACEXML_Char *ACEXML_SAXParseException::exception_name_ = ACE_TEXT ("ACEXML_SAXParseException");
00016
00017 #if !defined (__ACEXML_INLINE__)
00018 # include "ACEXML/common/SAXExceptions.i"
00019 #endif
00020
00021 ACEXML_SAXException::ACEXML_SAXException (void)
00022 : message_ (0)
00023 {
00024 }
00025
00026 ACEXML_SAXException::ACEXML_SAXException (const ACEXML_Char *msg)
00027 : message_ (ACE::strnew (msg))
00028 {
00029 }
00030
00031 ACEXML_SAXException::ACEXML_SAXException (const ACEXML_SAXException &ex)
00032 : ACEXML_Exception (ex),
00033 message_ (ACE::strnew (ex.message_))
00034
00035 {
00036 }
00037
00038 ACEXML_SAXException&
00039 ACEXML_SAXException::operator= (const ACEXML_SAXException& src)
00040 {
00041 ACEXML_SAXException temp (src);
00042 ACEXML_Char* message = this->message_;
00043 this->exception_name_ = temp.exception_name_;
00044 this->message_ = temp.message_;
00045 temp.message_ = message;
00046 return *this;
00047 }
00048
00049
00050 ACEXML_SAXException*
00051 ACEXML_SAXException::_downcast (ACEXML_Exception* ex)
00052 {
00053 if (ex->is_a (ACE_TEXT ("ACEXML_SAXException")))
00054 return dynamic_cast<ACEXML_SAXException*> (ex);
00055 return 0;
00056 }
00057
00058 ACEXML_SAXException::~ACEXML_SAXException (void)
00059 {
00060 delete[] this->message_;
00061 }
00062
00063
00064
00065 ACEXML_Exception *
00066 ACEXML_SAXException::duplicate (void) const
00067 {
00068 ACEXML_Exception *tmp;
00069 ACE_NEW_RETURN (tmp, ACEXML_SAXException (*this), 0);
00070 return tmp;
00071 }
00072
00073 int
00074 ACEXML_SAXException::is_a (const ACEXML_Char *name)
00075 {
00076 return ACE_OS::strcmp (ACEXML_SAXException::exception_name_, name) == 0
00077 || this->ACEXML_Exception::is_a (name);
00078 }
00079
00080 void
00081 ACEXML_SAXException::print (void)
00082 {
00083 ACE_ERROR ((LM_ERROR,
00084 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
00085 this->exception_name_, this->message()));
00086 }
00087
00088 ACEXML_SAXNotSupportedException::ACEXML_SAXNotSupportedException (void)
00089 {
00090 }
00091
00092 ACEXML_SAXNotSupportedException::ACEXML_SAXNotSupportedException (const ACEXML_SAXNotSupportedException &ex)
00093 : ACEXML_SAXException (ex)
00094 {
00095 }
00096
00097 ACEXML_SAXNotSupportedException&
00098 ACEXML_SAXNotSupportedException::operator= (const
00099 ACEXML_SAXNotSupportedException &ex)
00100 {
00101 this->ACEXML_SAXException::operator= (ex);
00102 return *this;
00103 }
00104
00105 ACEXML_SAXNotSupportedException*
00106 ACEXML_SAXNotSupportedException::_downcast (ACEXML_Exception* ex)
00107 {
00108 if (ex->is_a (ACE_TEXT ("ACEXML_SAXNotSupportedException")))
00109 return dynamic_cast<ACEXML_SAXNotSupportedException*> (ex);
00110 return 0;
00111 }
00112
00113 ACEXML_SAXNotSupportedException::ACEXML_SAXNotSupportedException (const ACEXML_Char* msg)
00114 : ACEXML_SAXException (msg)
00115 {
00116 }
00117
00118 ACEXML_SAXNotSupportedException::~ACEXML_SAXNotSupportedException (void)
00119 {
00120 delete[] this->message_;
00121 }
00122
00123
00124 ACEXML_Exception *
00125 ACEXML_SAXNotSupportedException::duplicate (void) const
00126 {
00127 ACEXML_Exception *tmp;
00128 ACE_NEW_RETURN (tmp, ACEXML_SAXNotSupportedException (*this), 0);
00129 return tmp;
00130 }
00131
00132 int
00133 ACEXML_SAXNotSupportedException::is_a (const ACEXML_Char *name)
00134 {
00135 return ACE_OS::strcmp (ACEXML_SAXNotSupportedException::exception_name_,
00136 name) == 0
00137 || this->ACEXML_SAXException::is_a (name);
00138 }
00139
00140 void
00141 ACEXML_SAXNotSupportedException::print (void)
00142 {
00143 ACE_DEBUG ((LM_ERROR,
00144 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
00145 this->exception_name_, this->message()));
00146 }
00147
00148 ACEXML_SAXNotRecognizedException::ACEXML_SAXNotRecognizedException (void)
00149 {
00150 }
00151
00152 ACEXML_SAXNotRecognizedException::ACEXML_SAXNotRecognizedException (const ACEXML_Char *msg)
00153 : ACEXML_SAXException (msg)
00154 {
00155 }
00156
00157 ACEXML_SAXNotRecognizedException::ACEXML_SAXNotRecognizedException (const ACEXML_SAXNotRecognizedException &ex)
00158 : ACEXML_SAXException (ex)
00159 {
00160 }
00161
00162 ACEXML_SAXNotRecognizedException&
00163 ACEXML_SAXNotRecognizedException::operator= (const ACEXML_SAXNotRecognizedException &ex)
00164 {
00165 this->ACEXML_SAXException::operator= (ex);
00166 return *this;
00167 }
00168
00169 ACEXML_SAXNotRecognizedException*
00170 ACEXML_SAXNotRecognizedException::_downcast (ACEXML_Exception* ex)
00171 {
00172 if (ex->is_a (ACE_TEXT ("ACEXML_SAXNotRecognizedException")))
00173 return dynamic_cast<ACEXML_SAXNotRecognizedException*> (ex);
00174 return 0;
00175 }
00176
00177 ACEXML_SAXNotRecognizedException::~ACEXML_SAXNotRecognizedException (void)
00178 {
00179 delete[] this->message_;
00180 }
00181
00182 ACEXML_Exception *
00183 ACEXML_SAXNotRecognizedException::duplicate (void) const
00184 {
00185 ACEXML_Exception *tmp;
00186 ACE_NEW_RETURN (tmp, ACEXML_SAXNotRecognizedException (*this), 0);
00187 return tmp;
00188 }
00189
00190 int
00191 ACEXML_SAXNotRecognizedException::is_a (const ACEXML_Char *name)
00192 {
00193 return ACE_OS::strcmp (ACEXML_SAXNotRecognizedException::exception_name_,
00194 name) == 0
00195 || this->ACEXML_SAXException::is_a (name);
00196 }
00197
00198 void
00199 ACEXML_SAXNotRecognizedException::print (void)
00200 {
00201 ACE_DEBUG ((LM_ERROR,
00202 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
00203 this->exception_name_, this->message()));
00204 }
00205
00206 ACEXML_SAXParseException::ACEXML_SAXParseException (void)
00207 {
00208 }
00209
00210 ACEXML_SAXParseException::ACEXML_SAXParseException (const ACEXML_Char *msg)
00211 : ACEXML_SAXException (msg)
00212 {
00213 }
00214
00215 ACEXML_SAXParseException::ACEXML_SAXParseException (const ACEXML_SAXParseException &ex)
00216 : ACEXML_SAXException (ex)
00217 {
00218 }
00219
00220 ACEXML_SAXParseException&
00221 ACEXML_SAXParseException::operator= (const ACEXML_SAXParseException &ex)
00222 {
00223 this->ACEXML_SAXException::operator= (ex);
00224 return *this;
00225 }
00226
00227 ACEXML_SAXParseException*
00228 ACEXML_SAXParseException::_downcast (ACEXML_Exception* ex)
00229 {
00230 if (ex->is_a (ACE_TEXT ("ACEXML_SAXParseException")))
00231 return dynamic_cast<ACEXML_SAXParseException*> (ex);
00232 return 0;
00233 }
00234
00235 ACEXML_SAXParseException::~ACEXML_SAXParseException (void)
00236 {
00237 }
00238
00239 ACEXML_Exception *
00240 ACEXML_SAXParseException::duplicate (void) const
00241 {
00242 ACEXML_Exception *tmp;
00243 ACE_NEW_RETURN (tmp, ACEXML_SAXParseException (*this), 0);
00244 return tmp;
00245 }
00246
00247 int
00248 ACEXML_SAXParseException::is_a (const ACEXML_Char *name)
00249 {
00250 return ACE_OS::strcmp (ACEXML_SAXParseException::exception_name_,
00251 name) == 0
00252 || this->ACEXML_SAXException::is_a (name);
00253 }
00254
00255 void
00256 ACEXML_SAXParseException::print (void)
00257 {
00258 ACE_ERROR ((LM_ERROR,
00259 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
00260 this->exception_name_, this->message()));
00261 }