source: NonGTP/Xerces/xercesc/dom/DOMError.hpp @ 188

Revision 188, 10.6 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
1#ifndef DOMError_HEADER_GUARD_
2#define DOMError_HEADER_GUARD_
3
4/*
5 * The Apache Software License, Version 1.1
6 *
7 * Copyright (c) 2002 The Apache Software Foundation.  All rights
8 * reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 *
17 * 2. Redistributions in binary form must reproduce the above copyright
18 *    notice, this list of conditions and the following disclaimer in
19 *    the documentation and/or other materials provided with the
20 *    distribution.
21 *
22 * 3. The end-user documentation included with the redistribution,
23 *    if any, must include the following acknowledgment:
24 *       "This product includes software developed by the
25 *        Apache Software Foundation (http://www.apache.org/)."
26 *    Alternately, this acknowledgment may appear in the software itself,
27 *    if and wherever such third-party acknowledgments normally appear.
28 *
29 * 4. The names "Xerces" and "Apache Software Foundation" must
30 *    not be used to endorse or promote products derived from this
31 *    software without prior written permission. For written
32 *    permission, please contact apache\@apache.org.
33 *
34 * 5. Products derived from this software may not be called "Apache",
35 *    nor may "Apache" appear in their name, without prior written
36 *    permission of the Apache Software Foundation.
37 *
38 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
39 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
42 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
45 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
46 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 * SUCH DAMAGE.
50 * ====================================================================
51 *
52 * This software consists of voluntary contributions made by many
53 * individuals on behalf of the Apache Software Foundation, and was
54 * originally based on software copyright (c) 1999, International
55 * Business Machines, Inc., http://www.ibm.com .  For more information
56 * on the Apache Software Foundation, please see
57 * <http://www.apache.org/>.
58 */
59
60/*
61 * $Log: DOMError.hpp,v $
62 * Revision 1.11  2003/12/01 23:23:25  neilg
63 * fix for bug 25118; thanks to Jeroen Witmond
64 *
65 * Revision 1.10  2003/05/30 16:11:43  gareth
66 * Fixes so we compile under VC7.1. Patch by Alberto Massari.
67 *
68 * Revision 1.9  2003/05/14 18:06:53  gareth
69 * Updated DOMError to http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html.
70 *
71 * Revision 1.8  2003/03/07 19:59:04  tng
72 * [Bug 11692] Unimplement the hidden constructors and assignment operator to remove warnings from gcc.
73 *
74 * Revision 1.7  2002/11/04 15:09:24  tng
75 * C++ Namespace Support.
76 *
77 * Revision 1.6  2002/08/22 15:04:57  tng
78 * Remove unused parameter variables in inline functions.
79 *
80 * Revision 1.5  2002/07/15 19:25:25  tng
81 * DOM L3:  declare a dummy DOMError::set/getRelatedException
82 *
83 * Revision 1.4  2002/06/06 21:01:21  tng
84 * [Bug 9639] enum_mem in DOMError clashes with constant.
85 *
86 * Revision 1.3  2002/06/06 20:53:06  tng
87 * Documentation Fix: Update the API Documentation for DOM headers
88 *
89 * Revision 1.2  2002/05/30 19:24:48  knoaman
90 * documentation update
91 *
92 * Revision 1.1  2002/05/23 15:47:24  knoaman
93 * DOM L3 core - support for DOMError, DOMErrorHandler and DOMLocator
94 *
95 */
96
97
98#include <xercesc/util/XercesDefs.hpp>
99
100XERCES_CPP_NAMESPACE_BEGIN
101
102class DOMLocator;
103
104
105/**
106  * DOMError is an interface that describes an error.
107  *
108  * @see DOMErrorHandler#handleError
109  * @since DOM Level 3
110  */
111
112class CDOM_EXPORT DOMError
113{
114protected:
115    // -----------------------------------------------------------------------
116    //  Hidden constructors
117    // -----------------------------------------------------------------------
118    /** @name Hidden constructors */
119    //@{   
120    DOMError() {};
121    //@}
122
123private:
124    // -----------------------------------------------------------------------
125    // Unimplemented constructors and operators
126    // -----------------------------------------------------------------------
127    /** @name Unimplemented constructors and operators */
128    //@{
129    DOMError(const DOMError &);
130    DOMError & operator = (const DOMError &);
131    //@}
132
133public:
134    // -----------------------------------------------------------------------
135    //  All constructors are hidden, just the destructor is available
136    // -----------------------------------------------------------------------
137    /** @name Destructor */
138    //@{
139    /**
140     * Destructor
141     *
142     */
143    virtual ~DOMError() {};
144    //@}
145
146    // -----------------------------------------------------------------------
147    //  Class types
148    // -----------------------------------------------------------------------
149    /** @name Public constants */
150    //@{
151    /**
152     * The severity of the error described by the <code>DOMError</code>.
153     *
154     * @since DOM Level 3
155     */
156    enum ErrorSeverity
157    {
158        DOM_SEVERITY_WARNING     = 0,
159        DOM_SEVERITY_ERROR       = 1,
160        DOM_SEVERITY_FATAL_ERROR = 2
161    };
162    //@}
163
164
165    // -----------------------------------------------------------------------
166    //  Virtual DOMError interface
167    // -----------------------------------------------------------------------
168    /** @name Functions introduced in DOM Level 3 */
169    //@{
170    // -----------------------------------------------------------------------
171    //  Getter methods
172    // -----------------------------------------------------------------------
173    /**
174     * Get the severity of the error
175     *
176     * <p><b>"Experimental - subject to change"</b></p>
177     *
178     * @see   setSeverity
179     * @since DOM Level 3
180     */
181    virtual short getSeverity() const = 0;
182
183    /**
184     * Get the message describing the error that occured.
185     *
186     * <p><b>"Experimental - subject to change"</b></p>
187     *
188     * @see   setMessage
189     * @since DOM Level 3
190     */
191    virtual const XMLCh* getMessage() const = 0;
192
193    /**
194     * Get the location of the error
195     *
196     * <p><b>"Experimental - subject to change"</b></p>
197     *
198     * @see   setLocation
199     * @since DOM Level 3
200     */
201    virtual DOMLocator* getLocation() const = 0;
202
203    /**
204     * The related platform dependent exception if any.
205     *
206     * <p><b>"Experimental - subject to change"</b></p>
207     *
208     * @see   setRelatedException
209     * @since DOM Level 3
210     */
211    virtual void* getRelatedException() const = 0;
212
213    /**
214     * A <code>XMLCh*</code> indicating which related data is expected in
215     * relatedData. Users should refer to the specification of the error
216     * in order to find its <code>XMLCh*</code> type and relatedData
217     * definitions if any.
218     *
219     * Note: As an example, [DOM Level 3 Load and Save] does not keep the
220     * [baseURI] property defined on a Processing Instruction information item.
221     * Therefore, the DOMBuilder generates a SEVERITY_WARNING with type
222     * "infoset-baseURI" and the lost [baseURI] property represented as a
223     * DOMString in the relatedData attribute.
224     *
225     * <p><b>"Experimental - subject to change"</b></p>
226     *
227     * @see   setType
228     * @since DOM Level 3
229     */
230    virtual const XMLCh* getType() const = 0;
231
232    /**
233     * The related DOMError.type dependent data if any.
234     *
235     * <p><b>"Experimental - subject to change"</b></p>
236     *
237     * @see   setRelatedData
238     * @since DOM Level 3
239     */
240    virtual void* getRelatedData() const = 0;
241
242
243    // -----------------------------------------------------------------------
244    //  Setter methods
245    // -----------------------------------------------------------------------
246    /**
247     * Set the severity of the error
248     *
249     * <p><b>"Experimental - subject to change"</b></p>
250     *
251     * @param severity the type of the error to set
252     * @see   getLocation
253     * @since DOM Level 3
254     */
255    virtual void setSeverity(const short severity) = 0;
256
257    /**
258     * Set the error message
259     *
260     * <p><b>"Experimental - subject to change"</b></p>
261     *
262     * @param message the error message to set.
263     * @see   getMessage
264     * @since DOM Level 3
265     */
266    virtual void setMessage(const XMLCh* const message) = 0;
267
268    /**
269     * Set the location of the error
270     *
271     * <p><b>"Experimental - subject to change"</b></p>
272     *
273     * @param location the location of the error to set.
274     * @see   getLocation
275     * @since DOM Level 3
276     */
277    virtual void setLocation(DOMLocator* const location) = 0;
278
279    /**
280     * The related platform dependent exception if any.
281     *
282     * <p><b>"Experimental - subject to change"</b></p>
283     *
284     * @param exc the related exception to set.
285     * @see   getRelatedException
286     * @since DOM Level 3
287     */
288    virtual void setRelatedException(void* exc) const = 0;
289
290    /**
291     * A <code>XMLCh*</code> indicating which related data is expected in
292     * relatedData. Users should refer to the specification of the error
293     * in order to find its <code>XMLCh*</code> type and relatedData
294     * definitions if any.
295     *
296     * Note: As an example, [DOM Level 3 Load and Save] does not keep the
297     * [baseURI] property defined on a Processing Instruction information item.
298     * Therefore, the DOMBuilder generates a SEVERITY_WARNING with type
299     * "infoset-baseURI" and the lost [baseURI] property represented as a
300     * DOMString in the relatedData attribute.
301     *
302     * <p><b>"Experimental - subject to change"</b></p>
303     *
304     * @see   getType
305     * @since DOM Level 3
306     */
307    virtual void setType(const XMLCh* type) = 0;
308
309    /**
310     * The related DOMError.type dependent data if any.
311     *
312     * <p><b>"Experimental - subject to change"</b></p>
313     *
314     * @see   getRelatedData
315     * @since DOM Level 3
316     */
317    virtual void setRelatedData(void* relatedData) = 0;
318
319    //@}
320
321};
322
323XERCES_CPP_NAMESPACE_END
324
325#endif
Note: See TracBrowser for help on using the repository browser.