[112] | 1 | #ifndef __XMLIO_EXCEPTION__ |
---|
[114] | 2 | #define __XMLIO_EXCEPTION__ |
---|
[112] | 3 | |
---|
| 4 | // Classes utilisées issues de la STL |
---|
| 5 | using std::string; |
---|
| 6 | |
---|
| 7 | // Classes utilisées issues de Poco |
---|
| 8 | using Poco::Exception; |
---|
| 9 | |
---|
| 10 | namespace XMLIOSERVER |
---|
| 11 | { |
---|
| 12 | class XMLIOException : public Exception |
---|
| 13 | { |
---|
| 14 | public : |
---|
[114] | 15 | |
---|
| 16 | XMLIOException(int _code): Exception(_code) |
---|
[112] | 17 | { /* Ne rien faire de plus */ } |
---|
[114] | 18 | XMLIOException(const std::string& _msg, int _code): Exception(_msg, _code) |
---|
| 19 | { /* Ne rien faire de plus */ } |
---|
| 20 | XMLIOException(const std::string& _msg, const std::string& _arg, int _code): Exception(_msg, _arg, _code) |
---|
| 21 | { /* Ne rien faire de plus */ } |
---|
| 22 | XMLIOException(const std::string& _msg, const Poco::Exception& _exc, int _code): Exception(_msg, _exc, _code) |
---|
| 23 | { /* Ne rien faire de plus */ } |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | XMLIOException(const XMLIOException& _exc): Exception(_exc) |
---|
| 27 | { /* Ne rien faire de plus */ } |
---|
| 28 | |
---|
[112] | 29 | ~XMLIOException() throw() |
---|
| 30 | { /* Ne rien faire de plus */ } |
---|
[114] | 31 | |
---|
| 32 | XMLIOException& operator = (const XMLIOException& _exc) |
---|
| 33 | { Exception::operator = (_exc); return *this; } |
---|
| 34 | |
---|
| 35 | virtual const char* name(void) const throw() { return ("XMLIO>XMLIOException"); } |
---|
| 36 | virtual const char* className(void) const throw() { return (typeid(*this).name()); } |
---|
| 37 | |
---|
| 38 | virtual Exception* clone(void) const { return new XMLIOException(*this); } |
---|
[112] | 39 | virtual void rethrow(void) const { throw *this; } |
---|
[114] | 40 | |
---|
[115] | 41 | }; // class XMLIOException |
---|
[114] | 42 | |
---|
[112] | 43 | class XMLIOUndefinedValueException : public XMLIOException |
---|
| 44 | { |
---|
| 45 | public : |
---|
| 46 | XMLIOUndefinedValueException(const std::string& _msg): XMLIOException(_msg, 1001) {} |
---|
| 47 | const char* name(void) const throw() { return ("XMLIO>UndefinedValueException"); } |
---|
[114] | 48 | |
---|
[112] | 49 | }; //class XMLIOUndefinedException |
---|
[114] | 50 | |
---|
[112] | 51 | class XMLIOStreamException : public XMLIOException |
---|
| 52 | { |
---|
| 53 | public : |
---|
| 54 | XMLIOStreamException(const std::string& _msg): XMLIOException(_msg, 1002) {} |
---|
| 55 | const char* name(void) const throw() { return ("XMLIO>StreamException"); } |
---|
[114] | 56 | |
---|
[112] | 57 | }; //class XMLIOStreamException |
---|
[114] | 58 | |
---|
[112] | 59 | class XMLParsingException : public XMLIOException |
---|
| 60 | { |
---|
| 61 | public : |
---|
| 62 | XMLParsingException(const std::string& _msg): XMLIOException(_msg, 1003) {} |
---|
| 63 | const char* name(void) const throw() { return ("XMLIO>XMLParsingException"); } |
---|
[114] | 64 | |
---|
[112] | 65 | }; //class XMLParsingException |
---|
[114] | 66 | |
---|
[112] | 67 | class XMLIOIncompatibleTypeException : public XMLIOException |
---|
| 68 | { |
---|
| 69 | public : |
---|
| 70 | XMLIOIncompatibleTypeException(const std::string& _msg): XMLIOException(_msg, 1003) {} |
---|
| 71 | const char* name(void) const throw() { return ("XMLIO>XMLIOIncompatibeTypeException"); } |
---|
[114] | 72 | |
---|
[115] | 73 | }; //class XMLIOIncompatibleTypeException |
---|
[114] | 74 | |
---|
[112] | 75 | // A compléter. |
---|
| 76 | |
---|
[114] | 77 | }// namespace XMLIOSERVER |
---|
| 78 | |
---|
| 79 | #endif // __XMLIO_EXCEPTION__ |
---|