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) |
---|
17 | : Exception(_code) |
---|
18 | { /* Ne rien faire de plus */ } |
---|
19 | |
---|
20 | XMLIOException(const std::string& _msg, int _code) |
---|
21 | : Exception(_msg, _code) |
---|
22 | { /* Ne rien faire de plus */ } |
---|
23 | |
---|
24 | XMLIOException(const std::string& _msg, const std::string& _arg, int _code) |
---|
25 | : Exception(_msg, _arg, _code) |
---|
26 | { /* Ne rien faire de plus */ } |
---|
27 | |
---|
28 | XMLIOException(const std::string& _msg, const Poco::Exception& _exc, int _code) |
---|
29 | : Exception(_msg, _exc, _code) |
---|
30 | { /* Ne rien faire de plus */ } |
---|
31 | |
---|
32 | XMLIOException(const XMLIOException& _exc) |
---|
33 | : Exception(_exc) |
---|
34 | { /* Ne rien faire de plus */ } |
---|
35 | |
---|
36 | ~XMLIOException() throw() |
---|
37 | { /* Ne rien faire de plus */ } |
---|
38 | |
---|
39 | XMLIOException& operator = (const XMLIOException& _exc) |
---|
40 | { Exception::operator = (_exc); return *this; } |
---|
41 | |
---|
42 | virtual const char* name(void) const throw() { return ("XMLIO>XMLIOException"); } |
---|
43 | virtual const char* className(void) const throw() { return (typeid(*this).name()); } |
---|
44 | |
---|
45 | virtual Exception* clone(void) const { return new XMLIOException(*this); } |
---|
46 | virtual void rethrow(void) const { throw *this; } |
---|
47 | |
---|
48 | }; // class XMLIOException |
---|
49 | |
---|
50 | class XMLIOUndefinedValueException : public XMLIOException |
---|
51 | { |
---|
52 | public : |
---|
53 | XMLIOUndefinedValueException(const std::string& _msg) |
---|
54 | : XMLIOException(_msg, 1001) |
---|
55 | { /* Ne rien faire de plus */ } |
---|
56 | |
---|
57 | const char* name(void) const throw() |
---|
58 | { return ("XMLIO>UndefinedValueException"); } |
---|
59 | |
---|
60 | }; //class XMLIOUndefinedException |
---|
61 | |
---|
62 | class XMLIOStreamException : public XMLIOException |
---|
63 | { |
---|
64 | public : |
---|
65 | XMLIOStreamException(const std::string& _msg) |
---|
66 | : XMLIOException(_msg, 1002) |
---|
67 | { /* Ne rien faire de plus */ } |
---|
68 | |
---|
69 | const char* name(void) const throw() |
---|
70 | { return ("XMLIO>StreamException"); } |
---|
71 | |
---|
72 | }; //class XMLIOStreamException |
---|
73 | |
---|
74 | class XMLParsingException : public XMLIOException |
---|
75 | { |
---|
76 | public : |
---|
77 | XMLParsingException(const std::string& _msg) |
---|
78 | : XMLIOException(_msg, 1003) |
---|
79 | { /* Ne rien faire de plus */ } |
---|
80 | |
---|
81 | const char* name(void) const throw() |
---|
82 | { return ("XMLIO>XMLParsingException"); } |
---|
83 | |
---|
84 | }; //class XMLParsingException |
---|
85 | |
---|
86 | class XMLIOIncompatibleTypeException : public XMLIOException |
---|
87 | { |
---|
88 | public : |
---|
89 | XMLIOIncompatibleTypeException(const std::string& _msg) |
---|
90 | : XMLIOException(_msg, 1003) |
---|
91 | { /* Ne rien faire de plus */ } |
---|
92 | |
---|
93 | const char* name(void) const throw() |
---|
94 | { return ("XMLIO>XMLIOIncompatibeTypeException"); } |
---|
95 | |
---|
96 | }; //class XMLIOIncompatibleTypeException |
---|
97 | |
---|
98 | // A compléter. |
---|
99 | |
---|
100 | }// namespace XMLIOSERVER |
---|
101 | |
---|
102 | #endif // __XMLIO_EXCEPTION__ |
---|