1//
2// XMLFilter.h
3//
4// Library: XML
5// Package: SAX
6// Module: SAXFilters
7//
8// SAX2 XMLFilter Interface.
9//
10// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef SAX_XMLFilter_INCLUDED
18#define SAX_XMLFilter_INCLUDED
19
20
21#include "Poco/XML/XML.h"
22#include "Poco/SAX/XMLReader.h"
23
24
25namespace Poco {
26namespace XML {
27
28
29class XML_API XMLFilter: public XMLReader
30 /// Interface for an XML filter.
31 ///
32 /// An XML filter is like an XML reader, except that it obtains its events from another XML reader
33 /// rather than a primary source like an XML document or database. Filters can modify a stream of
34 /// events as they pass on to the final application.
35 ///
36 /// The XMLFilterImpl helper class provides a convenient base for creating SAX2 filters, by passing on
37 /// all EntityResolver, DTDHandler, ContentHandler and ErrorHandler events automatically.
38{
39public:
40 virtual XMLReader* getParent() const = 0;
41 /// Set the parent reader.
42 ///
43 /// This method allows the application to link the filter to a parent reader (which may be another
44 /// filter). The argument may not be null.
45
46 virtual void setParent(XMLReader* pParent) = 0;
47 /// Get the parent reader.
48 ///
49 /// This method allows the application to query the parent reader (which may be another filter).
50 /// It is generally a bad idea to perform any operations on the parent reader directly: they should
51 /// all pass through this filter.
52
53protected:
54 virtual ~XMLFilter();
55};
56
57
58} } // namespace Poco::XML
59
60
61#endif // SAX_XMLFilter_INCLUDED
62