1 | #ifndef __XMLIO_EXCEPTION__ |
---|
2 | #define __XMLIO_EXCEPTION__ |
---|
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 : |
---|
15 | |
---|
16 | XMLIOException(int _code): Exception(_code) |
---|
17 | { /* Ne rien faire de plus */ } |
---|
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 | |
---|
29 | ~XMLIOException() throw() |
---|
30 | { /* Ne rien faire de plus */ } |
---|
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); } |
---|
39 | virtual void rethrow(void) const { throw *this; } |
---|
40 | |
---|
41 | }; // class XMLIOException |
---|
42 | |
---|
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"); } |
---|
48 | |
---|
49 | }; //class XMLIOUndefinedException |
---|
50 | |
---|
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"); } |
---|
56 | |
---|
57 | }; //class XMLIOStreamException |
---|
58 | |
---|
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"); } |
---|
64 | |
---|
65 | }; //class XMLParsingException |
---|
66 | |
---|
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"); } |
---|
72 | |
---|
73 | }; //class XMLIOIncompatibleTypeException |
---|
74 | |
---|
75 | // A compléter. |
---|
76 | |
---|
77 | }// namespace XMLIOSERVER |
---|
78 | |
---|
79 | #endif // __XMLIO_EXCEPTION__ |
---|