| 1 | // |
| 2 | // EventException.h |
| 3 | // |
| 4 | // Library: XML |
| 5 | // Package: DOM |
| 6 | // Module: DOMEvents |
| 7 | // |
| 8 | // Definition of the DOM EventException class. |
| 9 | // |
| 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
| 11 | // and Contributors. |
| 12 | // |
| 13 | // SPDX-License-Identifier: BSL-1.0 |
| 14 | // |
| 15 | |
| 16 | |
| 17 | #ifndef DOM_EventException_INCLUDED |
| 18 | #define DOM_EventException_INCLUDED |
| 19 | |
| 20 | |
| 21 | #include "Poco/XML/XML.h" |
| 22 | #include "Poco/XML/XMLException.h" |
| 23 | |
| 24 | |
| 25 | namespace Poco { |
| 26 | namespace XML { |
| 27 | |
| 28 | |
| 29 | class XML_API EventException: public XMLException |
| 30 | /// Event operations may throw an EventException as |
| 31 | /// specified in their method descriptions. |
| 32 | { |
| 33 | public: |
| 34 | enum |
| 35 | { |
| 36 | UNSPECIFIED_EVENT_TYPE_ERR = 0 /// If the Event's type was not specified by initializing the |
| 37 | /// event before the method was called. Specification of the Event's |
| 38 | /// type as null or an empty string will also trigger this exception. |
| 39 | }; |
| 40 | |
| 41 | EventException(int code); |
| 42 | /// Creates an EventException with the given error code. |
| 43 | |
| 44 | EventException(const EventException& exc); |
| 45 | /// Creates an EventException by copying another one. |
| 46 | |
| 47 | ~EventException() throw(); |
| 48 | /// Destroys the EventException. |
| 49 | |
| 50 | EventException& operator = (const EventException& exc); |
| 51 | |
| 52 | const char* name() const throw(); |
| 53 | /// Returns a static string describing the exception. |
| 54 | |
| 55 | const char* className() const throw(); |
| 56 | /// Returns the name of the exception class. |
| 57 | |
| 58 | unsigned short code() const; |
| 59 | /// Returns the Event exception code. |
| 60 | |
| 61 | protected: |
| 62 | Poco::Exception* clone() const; |
| 63 | |
| 64 | private: |
| 65 | EventException(); |
| 66 | }; |
| 67 | |
| 68 | |
| 69 | // |
| 70 | // inlines |
| 71 | // |
| 72 | inline unsigned short EventException::code() const |
| 73 | { |
| 74 | return UNSPECIFIED_EVENT_TYPE_ERR; |
| 75 | } |
| 76 | |
| 77 | |
| 78 | } } // namespace Poco::XML |
| 79 | |
| 80 | |
| 81 | #endif // DOM_EventException_INCLUDED |
| 82 | |