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: StdInParseHandlers.hpp,v $
|
---|
19 | * Revision 1.8 2004/09/08 13:55:34 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:20 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:41:37 peiyongz
|
---|
32 | * sane_include
|
---|
33 | *
|
---|
34 | * Revision 1.3 2000/03/02 19:53:50 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:25 rahulj
|
---|
40 | * Year 2K copyright swat.
|
---|
41 | *
|
---|
42 | * Revision 1.1.1.1 1999/11/09 01:09:28 twl
|
---|
43 | * Initial checkin
|
---|
44 | *
|
---|
45 | * Revision 1.5 1999/11/08 20:43:43 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 |
|
---|
56 | XERCES_CPP_NAMESPACE_USE
|
---|
57 |
|
---|
58 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
59 | class AttributeList;
|
---|
60 | XERCES_CPP_NAMESPACE_END
|
---|
61 |
|
---|
62 | class StdInParseHandlers : public HandlerBase
|
---|
63 | {
|
---|
64 | public:
|
---|
65 | // -----------------------------------------------------------------------
|
---|
66 | // Constructors and Destructor
|
---|
67 | // -----------------------------------------------------------------------
|
---|
68 | StdInParseHandlers();
|
---|
69 | ~StdInParseHandlers();
|
---|
70 |
|
---|
71 |
|
---|
72 | // -----------------------------------------------------------------------
|
---|
73 | // Getter methods
|
---|
74 | // -----------------------------------------------------------------------
|
---|
75 | unsigned int getElementCount()
|
---|
76 | {
|
---|
77 | return fElementCount;
|
---|
78 | }
|
---|
79 |
|
---|
80 | unsigned int getAttrCount()
|
---|
81 | {
|
---|
82 | return fAttrCount;
|
---|
83 | }
|
---|
84 |
|
---|
85 | unsigned int getCharacterCount()
|
---|
86 | {
|
---|
87 | return fCharacterCount;
|
---|
88 | }
|
---|
89 |
|
---|
90 | unsigned int getSpaceCount()
|
---|
91 | {
|
---|
92 | return fSpaceCount;
|
---|
93 | }
|
---|
94 |
|
---|
95 |
|
---|
96 | // -----------------------------------------------------------------------
|
---|
97 | // Handlers for the SAX DocumentHandler interface
|
---|
98 | // -----------------------------------------------------------------------
|
---|
99 | void endElement(const XMLCh* const name);
|
---|
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 | private:
|
---|
115 | // -----------------------------------------------------------------------
|
---|
116 | // Private data members
|
---|
117 | //
|
---|
118 | // fAttrCount
|
---|
119 | // fCharacterCount
|
---|
120 | // fElementCount
|
---|
121 | // fSpaceCount
|
---|
122 | // These are just counters that are run upwards based on the input
|
---|
123 | // from the document handlers.
|
---|
124 | // -----------------------------------------------------------------------
|
---|
125 | unsigned int fAttrCount;
|
---|
126 | unsigned int fCharacterCount;
|
---|
127 | unsigned int fElementCount;
|
---|
128 | unsigned int fSpaceCount;
|
---|
129 | };
|
---|