source: icXML/icXML-devel/samples/src/SAXPrint/SAXPrintHandlers.hpp @ 2733

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

More path fixes.

File size: 3.9 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: SAXPrintHandlers.hpp 557282 2007-07-18 14:54:15Z amassari $
20 */
21
22
23#include    <icxercesc/sax/HandlerBase.hpp>
24#include    <xercesc/framework/XMLFormatter.hpp>
25
26XERCES_CPP_NAMESPACE_USE
27
28class SAXPrintHandlers : public HandlerBase, private XMLFormatTarget
29{
30public:
31    // -----------------------------------------------------------------------
32    //  Constructors
33    // -----------------------------------------------------------------------
34    SAXPrintHandlers
35    (
36        const   char* const                 encodingName
37        , const XMLFormatter::UnRepFlags    unRepFlags
38    );
39    ~SAXPrintHandlers();
40
41
42    // -----------------------------------------------------------------------
43    //  Implementations of the format target interface
44    // -----------------------------------------------------------------------
45    void writeChars
46    (
47        const   XMLByte* const  toWrite
48    );
49
50    virtual void writeChars
51    (
52        const   XMLByte* const  toWrite
53        , const XMLSize_t       count
54        , XMLFormatter* const   formatter
55    );
56
57
58    // -----------------------------------------------------------------------
59    //  Implementations of the SAX DocumentHandler interface
60    // -----------------------------------------------------------------------
61    void endDocument();
62
63    void endElement(const XMLCh* const name);
64
65    void characters(const XMLCh* const chars, const XMLSize_t length);
66
67    void ignorableWhitespace
68    (
69        const   XMLCh* const    chars
70        , const XMLSize_t       length
71    );
72
73    void processingInstruction
74    (
75        const   XMLCh* const    target
76        , const XMLCh* const    data
77    );
78
79    void startDocument();
80
81    void startElement(const XMLCh* const name, AttributeList& attributes);
82
83
84
85    // -----------------------------------------------------------------------
86    //  Implementations of the SAX ErrorHandler interface
87    // -----------------------------------------------------------------------
88    void warning(const SAXParseException& exc);
89    void error(const SAXParseException& exc);
90    void fatalError(const SAXParseException& exc);
91
92
93
94    // -----------------------------------------------------------------------
95    //  Implementation of the SAX DTDHandler interface
96    // -----------------------------------------------------------------------
97    void notationDecl
98    (
99        const   XMLCh* const    name
100        , const XMLCh* const    publicId
101        , const XMLCh* const    systemId
102    );
103
104    void unparsedEntityDecl
105    (
106        const   XMLCh* const    name
107        , const XMLCh* const    publicId
108        , const XMLCh* const    systemId
109        , const XMLCh* const    notationName
110    );
111
112
113private :
114    // -----------------------------------------------------------------------
115    //  Private data members
116    //
117    //  fFormatter
118    //      This is the formatter object that is used to output the data
119    //      to the target. It is set up to format to the standard output
120    //      stream.
121    // -----------------------------------------------------------------------
122    XMLFormatter    fFormatter;
123};
Note: See TracBrowser for help on using the repository browser.