1 | #ifndef DOMError_HEADER_GUARD_
|
---|
2 | #define DOMError_HEADER_GUARD_
|
---|
3 |
|
---|
4 | /*
|
---|
5 | * Copyright 2002,2004 The Apache Software Foundation.
|
---|
6 | *
|
---|
7 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
8 | * you may not use this file except in compliance with the License.
|
---|
9 | * You may obtain a copy of the License at
|
---|
10 | *
|
---|
11 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
12 | *
|
---|
13 | * Unless required by applicable law or agreed to in writing, software
|
---|
14 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
16 | * See the License for the specific language governing permissions and
|
---|
17 | * limitations under the License.
|
---|
18 | */
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * $Log: DOMError.hpp,v $
|
---|
22 | * Revision 1.12 2004/09/08 13:55:39 peiyongz
|
---|
23 | * Apache License Version 2.0
|
---|
24 | *
|
---|
25 | * Revision 1.11 2003/12/01 23:23:25 neilg
|
---|
26 | * fix for bug 25118; thanks to Jeroen Witmond
|
---|
27 | *
|
---|
28 | * Revision 1.10 2003/05/30 16:11:43 gareth
|
---|
29 | * Fixes so we compile under VC7.1. Patch by Alberto Massari.
|
---|
30 | *
|
---|
31 | * Revision 1.9 2003/05/14 18:06:53 gareth
|
---|
32 | * Updated DOMError to http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html.
|
---|
33 | *
|
---|
34 | * Revision 1.8 2003/03/07 19:59:04 tng
|
---|
35 | * [Bug 11692] Unimplement the hidden constructors and assignment operator to remove warnings from gcc.
|
---|
36 | *
|
---|
37 | * Revision 1.7 2002/11/04 15:09:24 tng
|
---|
38 | * C++ Namespace Support.
|
---|
39 | *
|
---|
40 | * Revision 1.6 2002/08/22 15:04:57 tng
|
---|
41 | * Remove unused parameter variables in inline functions.
|
---|
42 | *
|
---|
43 | * Revision 1.5 2002/07/15 19:25:25 tng
|
---|
44 | * DOM L3: declare a dummy DOMError::set/getRelatedException
|
---|
45 | *
|
---|
46 | * Revision 1.4 2002/06/06 21:01:21 tng
|
---|
47 | * [Bug 9639] enum_mem in DOMError clashes with constant.
|
---|
48 | *
|
---|
49 | * Revision 1.3 2002/06/06 20:53:06 tng
|
---|
50 | * Documentation Fix: Update the API Documentation for DOM headers
|
---|
51 | *
|
---|
52 | * Revision 1.2 2002/05/30 19:24:48 knoaman
|
---|
53 | * documentation update
|
---|
54 | *
|
---|
55 | * Revision 1.1 2002/05/23 15:47:24 knoaman
|
---|
56 | * DOM L3 core - support for DOMError, DOMErrorHandler and DOMLocator
|
---|
57 | *
|
---|
58 | */
|
---|
59 |
|
---|
60 |
|
---|
61 | #include <xercesc/util/XercesDefs.hpp>
|
---|
62 |
|
---|
63 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
64 |
|
---|
65 | class DOMLocator;
|
---|
66 |
|
---|
67 |
|
---|
68 | /**
|
---|
69 | * DOMError is an interface that describes an error.
|
---|
70 | *
|
---|
71 | * @see DOMErrorHandler#handleError
|
---|
72 | * @since DOM Level 3
|
---|
73 | */
|
---|
74 |
|
---|
75 | class CDOM_EXPORT DOMError
|
---|
76 | {
|
---|
77 | protected:
|
---|
78 | // -----------------------------------------------------------------------
|
---|
79 | // Hidden constructors
|
---|
80 | // -----------------------------------------------------------------------
|
---|
81 | /** @name Hidden constructors */
|
---|
82 | //@{
|
---|
83 | DOMError() {};
|
---|
84 | //@}
|
---|
85 |
|
---|
86 | private:
|
---|
87 | // -----------------------------------------------------------------------
|
---|
88 | // Unimplemented constructors and operators
|
---|
89 | // -----------------------------------------------------------------------
|
---|
90 | /** @name Unimplemented constructors and operators */
|
---|
91 | //@{
|
---|
92 | DOMError(const DOMError &);
|
---|
93 | DOMError & operator = (const DOMError &);
|
---|
94 | //@}
|
---|
95 |
|
---|
96 | public:
|
---|
97 | // -----------------------------------------------------------------------
|
---|
98 | // All constructors are hidden, just the destructor is available
|
---|
99 | // -----------------------------------------------------------------------
|
---|
100 | /** @name Destructor */
|
---|
101 | //@{
|
---|
102 | /**
|
---|
103 | * Destructor
|
---|
104 | *
|
---|
105 | */
|
---|
106 | virtual ~DOMError() {};
|
---|
107 | //@}
|
---|
108 |
|
---|
109 | // -----------------------------------------------------------------------
|
---|
110 | // Class types
|
---|
111 | // -----------------------------------------------------------------------
|
---|
112 | /** @name Public constants */
|
---|
113 | //@{
|
---|
114 | /**
|
---|
115 | * The severity of the error described by the <code>DOMError</code>.
|
---|
116 | *
|
---|
117 | * @since DOM Level 3
|
---|
118 | */
|
---|
119 | enum ErrorSeverity
|
---|
120 | {
|
---|
121 | DOM_SEVERITY_WARNING = 0,
|
---|
122 | DOM_SEVERITY_ERROR = 1,
|
---|
123 | DOM_SEVERITY_FATAL_ERROR = 2
|
---|
124 | };
|
---|
125 | //@}
|
---|
126 |
|
---|
127 |
|
---|
128 | // -----------------------------------------------------------------------
|
---|
129 | // Virtual DOMError interface
|
---|
130 | // -----------------------------------------------------------------------
|
---|
131 | /** @name Functions introduced in DOM Level 3 */
|
---|
132 | //@{
|
---|
133 | // -----------------------------------------------------------------------
|
---|
134 | // Getter methods
|
---|
135 | // -----------------------------------------------------------------------
|
---|
136 | /**
|
---|
137 | * Get the severity of the error
|
---|
138 | *
|
---|
139 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
140 | *
|
---|
141 | * @see setSeverity
|
---|
142 | * @since DOM Level 3
|
---|
143 | */
|
---|
144 | virtual short getSeverity() const = 0;
|
---|
145 |
|
---|
146 | /**
|
---|
147 | * Get the message describing the error that occured.
|
---|
148 | *
|
---|
149 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
150 | *
|
---|
151 | * @see setMessage
|
---|
152 | * @since DOM Level 3
|
---|
153 | */
|
---|
154 | virtual const XMLCh* getMessage() const = 0;
|
---|
155 |
|
---|
156 | /**
|
---|
157 | * Get the location of the error
|
---|
158 | *
|
---|
159 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
160 | *
|
---|
161 | * @see setLocation
|
---|
162 | * @since DOM Level 3
|
---|
163 | */
|
---|
164 | virtual DOMLocator* getLocation() const = 0;
|
---|
165 |
|
---|
166 | /**
|
---|
167 | * The related platform dependent exception if any.
|
---|
168 | *
|
---|
169 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
170 | *
|
---|
171 | * @see setRelatedException
|
---|
172 | * @since DOM Level 3
|
---|
173 | */
|
---|
174 | virtual void* getRelatedException() const = 0;
|
---|
175 |
|
---|
176 | /**
|
---|
177 | * A <code>XMLCh*</code> indicating which related data is expected in
|
---|
178 | * relatedData. Users should refer to the specification of the error
|
---|
179 | * in order to find its <code>XMLCh*</code> type and relatedData
|
---|
180 | * definitions if any.
|
---|
181 | *
|
---|
182 | * Note: As an example, [DOM Level 3 Load and Save] does not keep the
|
---|
183 | * [baseURI] property defined on a Processing Instruction information item.
|
---|
184 | * Therefore, the DOMBuilder generates a SEVERITY_WARNING with type
|
---|
185 | * "infoset-baseURI" and the lost [baseURI] property represented as a
|
---|
186 | * DOMString in the relatedData attribute.
|
---|
187 | *
|
---|
188 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
189 | *
|
---|
190 | * @see setType
|
---|
191 | * @since DOM Level 3
|
---|
192 | */
|
---|
193 | virtual const XMLCh* getType() const = 0;
|
---|
194 |
|
---|
195 | /**
|
---|
196 | * The related DOMError.type dependent data if any.
|
---|
197 | *
|
---|
198 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
199 | *
|
---|
200 | * @see setRelatedData
|
---|
201 | * @since DOM Level 3
|
---|
202 | */
|
---|
203 | virtual void* getRelatedData() const = 0;
|
---|
204 |
|
---|
205 |
|
---|
206 | // -----------------------------------------------------------------------
|
---|
207 | // Setter methods
|
---|
208 | // -----------------------------------------------------------------------
|
---|
209 | /**
|
---|
210 | * Set the severity of the error
|
---|
211 | *
|
---|
212 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
213 | *
|
---|
214 | * @param severity the type of the error to set
|
---|
215 | * @see getLocation
|
---|
216 | * @since DOM Level 3
|
---|
217 | */
|
---|
218 | virtual void setSeverity(const short severity) = 0;
|
---|
219 |
|
---|
220 | /**
|
---|
221 | * Set the error message
|
---|
222 | *
|
---|
223 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
224 | *
|
---|
225 | * @param message the error message to set.
|
---|
226 | * @see getMessage
|
---|
227 | * @since DOM Level 3
|
---|
228 | */
|
---|
229 | virtual void setMessage(const XMLCh* const message) = 0;
|
---|
230 |
|
---|
231 | /**
|
---|
232 | * Set the location of the error
|
---|
233 | *
|
---|
234 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
235 | *
|
---|
236 | * @param location the location of the error to set.
|
---|
237 | * @see getLocation
|
---|
238 | * @since DOM Level 3
|
---|
239 | */
|
---|
240 | virtual void setLocation(DOMLocator* const location) = 0;
|
---|
241 |
|
---|
242 | /**
|
---|
243 | * The related platform dependent exception if any.
|
---|
244 | *
|
---|
245 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
246 | *
|
---|
247 | * @param exc the related exception to set.
|
---|
248 | * @see getRelatedException
|
---|
249 | * @since DOM Level 3
|
---|
250 | */
|
---|
251 | virtual void setRelatedException(void* exc) const = 0;
|
---|
252 |
|
---|
253 | /**
|
---|
254 | * A <code>XMLCh*</code> indicating which related data is expected in
|
---|
255 | * relatedData. Users should refer to the specification of the error
|
---|
256 | * in order to find its <code>XMLCh*</code> type and relatedData
|
---|
257 | * definitions if any.
|
---|
258 | *
|
---|
259 | * Note: As an example, [DOM Level 3 Load and Save] does not keep the
|
---|
260 | * [baseURI] property defined on a Processing Instruction information item.
|
---|
261 | * Therefore, the DOMBuilder generates a SEVERITY_WARNING with type
|
---|
262 | * "infoset-baseURI" and the lost [baseURI] property represented as a
|
---|
263 | * DOMString in the relatedData attribute.
|
---|
264 | *
|
---|
265 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
266 | *
|
---|
267 | * @see getType
|
---|
268 | * @since DOM Level 3
|
---|
269 | */
|
---|
270 | virtual void setType(const XMLCh* type) = 0;
|
---|
271 |
|
---|
272 | /**
|
---|
273 | * The related DOMError.type dependent data if any.
|
---|
274 | *
|
---|
275 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
276 | *
|
---|
277 | * @see getRelatedData
|
---|
278 | * @since DOM Level 3
|
---|
279 | */
|
---|
280 | virtual void setRelatedData(void* relatedData) = 0;
|
---|
281 |
|
---|
282 | //@}
|
---|
283 |
|
---|
284 | };
|
---|
285 |
|
---|
286 | XERCES_CPP_NAMESPACE_END
|
---|
287 |
|
---|
288 | #endif
|
---|