source: trunk/VUT/GtpVisibilityPreprocessor/support/xerces/samples/Redirect/RedirectHandlers.hpp @ 358

Revision 358, 4.4 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: RedirectHandlers.hpp,v $
19 * Revision 1.8  2004/09/08 13:55:33  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.7  2004/02/15 19:43:15  amassari
23 * Removed cause for warnings in VC 7.1
24 *
25 * Revision 1.6  2002/11/05 21:46:19  tng
26 * Explicit code using namespace in application.
27 *
28 * Revision 1.5  2002/11/04 15:23:03  tng
29 * C++ Namespace Support.
30 *
31 * Revision 1.4  2002/02/01 22:38:26  peiyongz
32 * sane_include
33 *
34 * Revision 1.3  2000/03/02 19:53:46  roddey
35 * This checkin includes many changes done while waiting for the
36 * 1.1.0 code to be finished. I can't list them all here, but a list is
37 * available elsewhere.
38 *
39 * Revision 1.2  2000/02/06 07:47:22  rahulj
40 * Year 2K copyright swat.
41 *
42 * Revision 1.1.1.1  1999/11/09 01:09:38  twl
43 * Initial checkin
44 *
45 * Revision 1.6  1999/11/08 20:43:39  rahul
46 * Swat for adding in Product name and CVS comment log variable.
47 *
48 */
49
50
51// ---------------------------------------------------------------------------
52//  Includes
53// ---------------------------------------------------------------------------
54#include <xercesc/sax/HandlerBase.hpp>
55
56XERCES_CPP_NAMESPACE_USE
57
58XERCES_CPP_NAMESPACE_BEGIN
59class AttributeList;
60XERCES_CPP_NAMESPACE_END
61
62
63class RedirectHandlers : public HandlerBase
64{
65public:
66    // -----------------------------------------------------------------------
67    //  Constructors and Destructor
68    // -----------------------------------------------------------------------
69    RedirectHandlers();
70    ~RedirectHandlers();
71
72
73    // -----------------------------------------------------------------------
74    //  Getter methods
75    // -----------------------------------------------------------------------
76    unsigned int getElementCount()
77    {
78        return fElementCount;
79    }
80
81    unsigned int getAttrCount()
82    {
83        return fAttrCount;
84    }
85
86    unsigned int getCharacterCount()
87    {
88        return fCharacterCount;
89    }
90
91    unsigned int getSpaceCount()
92    {
93        return fSpaceCount;
94    }
95
96
97    // -----------------------------------------------------------------------
98    //  Handlers for the SAX DocumentHandler interface
99    // -----------------------------------------------------------------------
100    void startElement(const XMLCh* const name, AttributeList& attributes);
101    void characters(const XMLCh* const chars, const unsigned int length);
102    void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
103    void resetDocument();
104
105
106    // -----------------------------------------------------------------------
107    //  Handlers for the SAX ErrorHandler interface
108    // -----------------------------------------------------------------------
109    void warning(const SAXParseException& exc);
110    void error(const SAXParseException& exc);
111    void fatalError(const SAXParseException& exc);
112
113
114    // -----------------------------------------------------------------------
115    //  Handlers for the SAX EntityResolver interface
116    // -----------------------------------------------------------------------
117    InputSource* resolveEntity
118    (
119        const   XMLCh* const    publicId
120        , const XMLCh* const    systemId
121    );
122
123
124private:
125    // -----------------------------------------------------------------------
126    //  Private data members
127    //
128    //  fAttrCount
129    //  fCharacterCount
130    //  fElementCount
131    //  fSpaceCount
132    //      These are just counters that are run upwards based on the input
133    //      from the document handlers.
134    // -----------------------------------------------------------------------
135    unsigned int    fAttrCount;
136    unsigned int    fCharacterCount;
137    unsigned int    fElementCount;
138    unsigned int    fSpaceCount;
139};
Note: See TracBrowser for help on using the repository browser.