source: NonGTP/Xerces/xerces/include/xercesc/sax2/LexicalHandler.hpp @ 358

Revision 358, 5.5 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2000,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * $Log: LexicalHandler.hpp,v $
19 * Revision 1.4  2004/09/08 13:56:20  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.3  2003/03/07 18:10:30  tng
23 * Return a reference instead of void for operator=
24 *
25 * Revision 1.2  2002/11/04 14:55:45  tng
26 * C++ Namespace Support.
27 *
28 * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
29 * sane_include
30 *
31 * Revision 1.1  2000/12/22 15:17:04  tng
32 * SAX2-ext's LexicalHandler support added by David Bertoni.
33 *
34 *
35 */
36
37
38#ifndef LEXICALHANDLER_HPP
39#define LEXICALHANDLER_HPP
40
41#include <xercesc/util/XercesDefs.hpp>
42
43XERCES_CPP_NAMESPACE_BEGIN
44
45/**
46  * Receive notification of lexical events.
47  *
48  * <p>This is an extension handler for that provides lexical information
49  * about an XML document.  It does not provide information about document
50  * content.  For those events, an application must register an instance of
51  * a ContentHandler.</p>
52  *
53  * <p>The order of events in this interface is very important, and
54  * mirrors the order of information in the document itself.  For
55  * example, startDTD() and endDTD() events will occur before the
56  * first element in the document.</p>
57  *
58  * @see SAX2XMLReader#setLexicalHandler
59  * @see SAX2XMLReader#setContentHandler
60  */
61
62class SAX2_EXPORT LexicalHandler
63{
64public:
65    /** @name Constructors and Destructor */
66    //@{
67    /** Default constructor */
68    LexicalHandler()
69    {
70    }
71
72    /** Destructor */
73    virtual ~LexicalHandler()
74    {
75    }
76    //@}
77
78    /** @name The virtual document handler interface */
79
80    //@{
81   /**
82    * Receive notification of comments.
83    *
84    * <p>The Parser will call this method to report each occurence of
85    * a comment in the XML document.</p>
86    *
87    * <p>The application must not attempt to read from the array
88    * outside of the specified range.</p>
89    *
90    * @param chars The characters from the XML document.
91    * @param length The number of characters to read from the array.
92    * @exception SAXException Any SAX exception, possibly
93    *            wrapping another exception.
94    */
95    virtual void comment
96    (
97        const   XMLCh* const    chars
98        , const unsigned int    length
99    ) = 0;
100
101  /**
102    * Receive notification of the end of a CDATA section.
103    *
104    * <p>The SAX parser will invoke this method at the end of
105    * each CDATA parsed.</p>
106    *
107    * @exception SAXException Any SAX exception, possibly
108    *            wrapping another exception.
109    */
110    virtual void endCDATA () = 0;
111
112  /**
113    * Receive notification of the end of the DTD declarations.
114    *
115    * <p>The SAX parser will invoke this method at the end of the
116    * DTD</p>
117    *
118    * @exception SAXException Any SAX exception, possibly
119    *            wrapping another exception.
120    */
121    virtual void endDTD () = 0;
122
123  /**
124    * Receive notification of the end of an entity.
125    *
126    * <p>The SAX parser will invoke this method at the end of an
127    * entity</p>
128    *
129    * @param name The name of the entity that is ending.
130    * @exception SAXException Any SAX exception, possibly
131    *            wrapping another exception.
132    */
133    virtual void endEntity (const XMLCh* const name) = 0;
134
135  /**
136    * Receive notification of the start of a CDATA section.
137    *
138    * <p>The SAX parser will invoke this method at the start of
139    * each CDATA parsed.</p>
140    *
141    * @exception SAXException Any SAX exception, possibly
142    *            wrapping another exception.
143    */
144    virtual void startCDATA () = 0;
145
146  /**
147    * Receive notification of the start of the DTD declarations.
148    *
149    * <p>The SAX parser will invoke this method at the start of the
150    * DTD</p>
151    *
152    * @param name The document type name.
153    * @param publicId The declared public identifier for the external DTD subset, or null if none was declared.
154    * @param systemId The declared system identifier for the external DTD subset, or null if none was declared.
155    * @exception SAXException Any SAX exception, possibly
156    *            wrapping another exception.
157    */
158    virtual void startDTD
159    (
160        const   XMLCh* const    name
161        , const   XMLCh* const    publicId
162        , const   XMLCh* const    systemId
163    ) = 0;
164
165  /**
166    * Receive notification of the start of an entity.
167    *
168    * <p>The SAX parser will invoke this method at the start of an
169    * entity</p>
170    *
171    * @param name The name of the entity that is starting.
172    * @exception SAXException Any SAX exception, possibly
173    *            wrapping another exception.
174    */
175    virtual void startEntity (const XMLCh* const name) = 0;
176
177    //@}
178private :
179    /* Unimplemented Constructors and operators */
180    /* Copy constructor */
181    LexicalHandler(const LexicalHandler&);
182    /** Assignment operator */
183    LexicalHandler& operator=(const LexicalHandler&);
184};
185
186XERCES_CPP_NAMESPACE_END
187
188#endif
Note: See TracBrowser for help on using the repository browser.