3 #include "ACEXML/common/SAXExceptions.h"
4 #include "ace/Log_Msg.h"
6 #include "ace/OS_Memory.h"
7 #include "ace/OS_NS_string.h"
9 const ACEXML_Char
* ACEXML_SAXException::exception_name_
= ACE_TEXT ("ACEXML_SAXException");
11 const ACEXML_Char
ACEXML_SAXNotSupportedException::exception_name_
[] = ACE_TEXT ("ACEXML_SAXNotSupportedException");
13 const ACEXML_Char
ACEXML_SAXNotRecognizedException::exception_name_
[] = ACE_TEXT ("ACEXML_SAXNotRecognizedException");
15 const ACEXML_Char
ACEXML_SAXParseException::exception_name_
[] = ACE_TEXT ("ACEXML_SAXParseException");
17 #if !defined (__ACEXML_INLINE__)
18 # include "ACEXML/common/SAXExceptions.inl"
19 #endif /* __ACEXML_INLINE__ */
21 ACEXML_SAXException::ACEXML_SAXException ()
26 ACEXML_SAXException::ACEXML_SAXException (const ACEXML_Char
*msg
)
27 : message_ (ACE::strnew (msg
))
31 ACEXML_SAXException::ACEXML_SAXException (const ACEXML_SAXException
&ex
)
32 : ACEXML_Exception (ex
),
33 message_ (ACE::strnew (ex
.message_
))
39 ACEXML_SAXException::operator= (const ACEXML_SAXException
& src
)
43 ACE::strdelete (this->message_
);
44 this->message_
= ACE::strnew (src
.message_
);
51 ACEXML_SAXException::_downcast (ACEXML_Exception
* ex
)
53 return dynamic_cast<ACEXML_SAXException
*> (ex
);
56 ACEXML_SAXException::~ACEXML_SAXException ()
58 ACE::strdelete (this->message_
);
62 ACEXML_SAXException::duplicate () const
64 ACEXML_Exception
*tmp
;
65 ACE_NEW_RETURN (tmp
, ACEXML_SAXException (*this), 0);
70 ACEXML_SAXException::is_a (const ACEXML_Char
*name
)
72 return ACE_OS::strcmp (ACEXML_SAXException::exception_name_
, name
) == 0
73 || this->ACEXML_Exception::is_a (name
);
77 ACEXML_SAXException::print () const
80 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
81 this->exception_name_
, this->message()));
84 ACEXML_SAXNotSupportedException::ACEXML_SAXNotSupportedException ()
88 ACEXML_SAXNotSupportedException::ACEXML_SAXNotSupportedException (const ACEXML_SAXNotSupportedException
&ex
)
89 : ACEXML_SAXException (ex
)
93 ACEXML_SAXNotSupportedException
&
94 ACEXML_SAXNotSupportedException::operator= (const
95 ACEXML_SAXNotSupportedException
&ex
)
97 this->ACEXML_SAXException::operator= (ex
);
101 ACEXML_SAXNotSupportedException
*
102 ACEXML_SAXNotSupportedException::_downcast (ACEXML_Exception
* ex
)
104 return dynamic_cast<ACEXML_SAXNotSupportedException
*> (ex
);
107 ACEXML_SAXNotSupportedException::ACEXML_SAXNotSupportedException (const ACEXML_Char
* msg
)
108 : ACEXML_SAXException (msg
)
112 ACEXML_SAXNotSupportedException::~ACEXML_SAXNotSupportedException ()
118 ACEXML_SAXNotSupportedException::duplicate () const
120 ACEXML_Exception
*tmp
;
121 ACE_NEW_RETURN (tmp
, ACEXML_SAXNotSupportedException (*this), 0);
126 ACEXML_SAXNotSupportedException::is_a (const ACEXML_Char
*name
)
128 return ACE_OS::strcmp (ACEXML_SAXNotSupportedException::exception_name_
,
130 || this->ACEXML_SAXException::is_a (name
);
134 ACEXML_SAXNotSupportedException::print () const
136 ACE_DEBUG ((LM_ERROR
,
137 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
138 this->exception_name_
, this->message()));
141 ACEXML_SAXNotRecognizedException::ACEXML_SAXNotRecognizedException ()
145 ACEXML_SAXNotRecognizedException::ACEXML_SAXNotRecognizedException (const ACEXML_Char
*msg
)
146 : ACEXML_SAXException (msg
)
150 ACEXML_SAXNotRecognizedException::ACEXML_SAXNotRecognizedException (const ACEXML_SAXNotRecognizedException
&ex
)
151 : ACEXML_SAXException (ex
)
155 ACEXML_SAXNotRecognizedException
&
156 ACEXML_SAXNotRecognizedException::operator= (const ACEXML_SAXNotRecognizedException
&ex
)
158 this->ACEXML_SAXException::operator= (ex
);
162 ACEXML_SAXNotRecognizedException
*
163 ACEXML_SAXNotRecognizedException::_downcast (ACEXML_Exception
* ex
)
165 return dynamic_cast<ACEXML_SAXNotRecognizedException
*> (ex
);
168 ACEXML_SAXNotRecognizedException::~ACEXML_SAXNotRecognizedException ()
173 ACEXML_SAXNotRecognizedException::duplicate () const
175 ACEXML_Exception
*tmp
;
176 ACE_NEW_RETURN (tmp
, ACEXML_SAXNotRecognizedException (*this), 0);
181 ACEXML_SAXNotRecognizedException::is_a (const ACEXML_Char
*name
)
183 return ACE_OS::strcmp (ACEXML_SAXNotRecognizedException::exception_name_
,
185 || this->ACEXML_SAXException::is_a (name
);
189 ACEXML_SAXNotRecognizedException::print () const
191 ACE_DEBUG ((LM_ERROR
,
192 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
193 this->exception_name_
, this->message()));
196 ACEXML_SAXParseException::ACEXML_SAXParseException ()
200 ACEXML_SAXParseException::ACEXML_SAXParseException (const ACEXML_Char
*msg
)
201 : ACEXML_SAXException (msg
)
205 ACEXML_SAXParseException::ACEXML_SAXParseException (const ACEXML_SAXParseException
&ex
)
206 : ACEXML_SAXException (ex
)
210 ACEXML_SAXParseException
&
211 ACEXML_SAXParseException::operator= (const ACEXML_SAXParseException
&ex
)
213 this->ACEXML_SAXException::operator= (ex
);
217 ACEXML_SAXParseException
*
218 ACEXML_SAXParseException::_downcast (ACEXML_Exception
* ex
)
220 return dynamic_cast<ACEXML_SAXParseException
*> (ex
);
223 ACEXML_SAXParseException::~ACEXML_SAXParseException ()
228 ACEXML_SAXParseException::duplicate () const
230 ACEXML_Exception
*tmp
;
231 ACE_NEW_RETURN (tmp
, ACEXML_SAXParseException (*this), 0);
236 ACEXML_SAXParseException::is_a (const ACEXML_Char
*name
)
238 return ACE_OS::strcmp (ACEXML_SAXParseException::exception_name_
,
240 || this->ACEXML_SAXException::is_a (name
);
244 ACEXML_SAXParseException::print () const
246 ACE_ERROR ((LM_ERROR
,
247 ACE_TEXT ("ACEXML: (%P|%t) %s: %s\n"),
248 this->exception_name_
, this->message()));