source: icXML/icXML-devel/src/xercesc/sax/SAXParseException.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 5.8 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: SAXParseException.hpp 932887 2010-04-11 13:04:59Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_SAXPARSEEXCEPTION_HPP)
23#define XERCESC_INCLUDE_GUARD_SAXPARSEEXCEPTION_HPP
24
25#include <xercesc/sax/SAXException.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29class Locator;
30
31/**
32  * Encapsulate an XML parse error or warning.
33  *
34  * <p>This exception will include information for locating the error
35  * in the original XML document.  Note that although the application
36  * will receive a SAXParseException as the argument to the handlers
37  * in the ErrorHandler interface, the application is not actually
38  * required to throw the exception; instead, it can simply read the
39  * information in it and take a different action.</p>
40  *
41  * <p>Since this exception is a subclass of SAXException, it
42  * inherits the ability to wrap another exception.</p>
43  *
44  * @see SAXException#SAXException
45  * @see Locator#Locator
46  * @see ErrorHandler#ErrorHandler
47  */
48class SAX_EXPORT SAXParseException : public SAXException
49{
50public:
51    /** @name Constructors and Destructor */
52    //@{
53  /**
54    * Create a new SAXParseException from a message and a Locator.
55    *
56    * <p>This constructor is especially useful when an application is
57    * creating its own exception from within a DocumentHandler
58    * callback.</p>
59    *
60    * @param message The error or warning message.
61    * @param locator The locator object for the error or warning.
62    * @param manager    Pointer to the memory manager to be used to
63    *                   allocate objects.
64    * @see Locator#Locator
65    * @see Parser#setLocale
66    */
67    SAXParseException(const XMLCh* const message, const Locator& locator,
68                      MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
69
70
71  /**
72    * Create a new SAXParseException.
73    *
74    * <p>This constructor is most useful for parser writers.</p>
75    *
76    * <p>If the system identifier is a URL, the parser must resolve it
77    * fully before creating the exception.</p>
78    *
79    * @param message The error or warning message.
80    * @param publicId The public identifier of the entity that generated
81    *                 the error or warning.
82    * @param systemId The system identifier of the entity that generated
83    *                 the error or warning.
84    * @param lineNumber The line number of the end of the text that
85    *                   caused the error or warning.
86    * @param columnNumber The column number of the end of the text that
87    *                     caused the error or warning.
88    * @param manager    Pointer to the memory manager to be used to
89    *                   allocate objects.
90    * @see Parser#setLocale
91    */
92    SAXParseException
93    (
94        const   XMLCh* const    message
95        , const XMLCh* const    publicId
96        , const XMLCh* const    systemId
97        , const XMLFileLoc   lineNumber
98        , const XMLFileLoc   columnNumber
99        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
100    );
101
102  /**
103    * Copy constructor
104    *
105    * @param toCopy The object to be copied
106    */
107    SAXParseException(const SAXParseException& toCopy);
108
109    /**
110      * Destructor
111      */
112    ~SAXParseException();
113
114    //@}
115
116    /** @name Assignment operator */
117    //@{
118   /**
119    * Assignment operator
120    *
121    * @param toAssign The object to be copied through assignment
122    *
123    */
124    SAXParseException& operator=(const SAXParseException& toAssign);
125    //@}
126
127    /** @name Getter methods */
128    //@{
129   /**
130    * The column number of the end of the text where the exception occurred.
131    *
132    * <p>The first column in a line is position 1.</p>
133    *
134    * @return An integer representing the column number, or 0
135    *         if none is available.
136    * @see Locator#getColumnNumber
137    */
138    XMLFileLoc getColumnNumber() const;
139  /**
140    * The line number of the end of the text where the exception occurred.
141    *
142    * @return An integer representing the line number, or 0
143    *         if none is available.
144    * @see Locator#getLineNumber
145    */
146    XMLFileLoc getLineNumber() const;
147  /**
148    * Get the public identifier of the entity where the exception occurred.
149    *
150    * @return A string containing the public identifier, or null
151    *         if none is available.
152    * @see Locator#getPublicId
153    */
154    const XMLCh* getPublicId() const;
155  /**
156    * Get the system identifier of the entity where the exception occurred.
157    *
158    * <p>If the system identifier is a URL, it will be resolved
159    * fully.</p>
160    *
161    * @return A string containing the system identifier, or null
162    *         if none is available.
163    * @see Locator#getSystemId
164    */
165    const XMLCh* getSystemId() const;
166    //@}
167
168private:
169    /* Data Members */
170
171    /* The column in the source text where the error occured. */
172    XMLFileLoc   fColumnNumber;
173    /* The line in the source text where the error occured. */
174    XMLFileLoc   fLineNumber;
175    /* The public id of the file where the error occured. */
176    XMLCh*          fPublicId;
177    /* The system id of the file where the error occured. */
178    XMLCh*          fSystemId;
179
180
181};
182
183XERCES_CPP_NAMESPACE_END
184
185#endif
Note: See TracBrowser for help on using the repository browser.