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
9
* http://www.apache.org/licenses/LICENSE-2.0
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.
19
* $Id: MemParseHandlers.hpp 679377 2008-07-24 11:56:42Z borisk $
23
// ---------------------------------------------------------------------------
25
// ---------------------------------------------------------------------------
26
#include <xercesc/sax/HandlerBase.hpp>
28
XERCES_CPP_NAMESPACE_USE
30
XERCES_CPP_NAMESPACE_BEGIN
32
XERCES_CPP_NAMESPACE_END
35
class MemParseHandlers : public HandlerBase
38
// -----------------------------------------------------------------------
39
// Constructors and Destructor
40
// -----------------------------------------------------------------------
45
// -----------------------------------------------------------------------
47
// -----------------------------------------------------------------------
48
XMLSize_t getElementCount()
53
XMLSize_t getAttrCount()
58
XMLSize_t getCharacterCount()
60
return fCharacterCount;
63
XMLSize_t getSpaceCount()
69
// -----------------------------------------------------------------------
70
// Handlers for the SAX DocumentHandler interface
71
// -----------------------------------------------------------------------
72
void startElement(const XMLCh* const name, AttributeList& attributes);
73
void characters(const XMLCh* const chars, const XMLSize_t length);
74
void ignorableWhitespace(const XMLCh* const chars, const XMLSize_t length);
78
// -----------------------------------------------------------------------
79
// Handlers for the SAX ErrorHandler interface
80
// -----------------------------------------------------------------------
81
void warning(const SAXParseException& exc);
82
void error(const SAXParseException& exc);
83
void fatalError(const SAXParseException& exc);
88
// -----------------------------------------------------------------------
89
// Private data members
95
// These are just counters that are run upwards based on the input
96
// from the document handlers.
97
// -----------------------------------------------------------------------
99
XMLSize_t fCharacterCount;
100
XMLSize_t fElementCount;
101
XMLSize_t fSpaceCount;