1 | #ifndef DOMWriterFilter_HEADER_GUARD_
|
---|
2 | #define DOMWriterFilter_HEADER_GUARD_
|
---|
3 |
|
---|
4 | /*
|
---|
5 | * Copyright 2002,2004 The Apache Software Foundation.
|
---|
6 | *
|
---|
7 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
8 | * you may not use this file except in compliance with the License.
|
---|
9 | * You may obtain a copy of the License at
|
---|
10 | *
|
---|
11 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
12 | *
|
---|
13 | * Unless required by applicable law or agreed to in writing, software
|
---|
14 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
16 | * See the License for the specific language governing permissions and
|
---|
17 | * limitations under the License.
|
---|
18 | */
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * $Id: DOMWriterFilter.hpp,v 1.10 2004/09/08 13:55:39 peiyongz Exp $
|
---|
22 | * $Log: DOMWriterFilter.hpp,v $
|
---|
23 | * Revision 1.10 2004/09/08 13:55:39 peiyongz
|
---|
24 | * Apache License Version 2.0
|
---|
25 | *
|
---|
26 | * Revision 1.9 2003/03/07 19:59:09 tng
|
---|
27 | * [Bug 11692] Unimplement the hidden constructors and assignment operator to remove warnings from gcc.
|
---|
28 | *
|
---|
29 | * Revision 1.8 2002/11/04 15:09:25 tng
|
---|
30 | * C++ Namespace Support.
|
---|
31 | *
|
---|
32 | * Revision 1.7 2002/08/22 15:04:57 tng
|
---|
33 | * Remove unused parameter variables in inline functions.
|
---|
34 | *
|
---|
35 | * Revision 1.6 2002/06/06 20:53:07 tng
|
---|
36 | * Documentation Fix: Update the API Documentation for DOM headers
|
---|
37 | *
|
---|
38 | * Revision 1.5 2002/06/04 14:24:04 peiyongz
|
---|
39 | * Make DOMWriterFilter pure abstract class w/o implementing any method
|
---|
40 | * and data
|
---|
41 | *
|
---|
42 | * Revision 1.4 2002/06/03 22:34:53 peiyongz
|
---|
43 | * DOMWriterFilter: setter provided, and allows any SHOW setting
|
---|
44 | *
|
---|
45 | * Revision 1.3 2002/05/31 20:59:40 peiyongz
|
---|
46 | * Add "introduced in DOM3"
|
---|
47 | *
|
---|
48 | * Revision 1.2 2002/05/30 16:25:33 tng
|
---|
49 | * Fix doxygen warning message.
|
---|
50 | *
|
---|
51 | * Revision 1.1 2002/05/28 22:38:55 peiyongz
|
---|
52 | * DOM3 Save Interface: DOMWriter/DOMWriterFilter
|
---|
53 | *
|
---|
54 | */
|
---|
55 |
|
---|
56 | /**
|
---|
57 | *
|
---|
58 | * DOMWriterFilter.hpp: interface for the DOMWriterFilter class.
|
---|
59 | *
|
---|
60 | * DOMWriterFilter provide applications the ability to examine nodes
|
---|
61 | * as they are being serialized.
|
---|
62 | *
|
---|
63 | * DOMWriterFilter lets the application decide what nodes should be
|
---|
64 | * serialized or not.
|
---|
65 | *
|
---|
66 | * The DOMDocument, DOMDocumentType, DOMNotation, and DOMEntity nodes are not passed
|
---|
67 | * to the filter.
|
---|
68 | *
|
---|
69 | * @since DOM Level 3
|
---|
70 | */
|
---|
71 |
|
---|
72 |
|
---|
73 | #include <xercesc/dom/DOMNodeFilter.hpp>
|
---|
74 |
|
---|
75 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
76 |
|
---|
77 |
|
---|
78 | class CDOM_EXPORT DOMWriterFilter : public DOMNodeFilter {
|
---|
79 | protected:
|
---|
80 | // -----------------------------------------------------------------------
|
---|
81 | // Hidden constructors
|
---|
82 | // -----------------------------------------------------------------------
|
---|
83 | /** @name Hidden constructors */
|
---|
84 | //@{
|
---|
85 | DOMWriterFilter() {};
|
---|
86 | //@}
|
---|
87 |
|
---|
88 | private:
|
---|
89 | // -----------------------------------------------------------------------
|
---|
90 | // Unimplemented constructors and operators
|
---|
91 | // -----------------------------------------------------------------------
|
---|
92 | /** @name Unimplemented constructors and operators */
|
---|
93 | //@{
|
---|
94 | DOMWriterFilter(const DOMWriterFilter &);
|
---|
95 | DOMWriterFilter & operator = (const DOMWriterFilter &);
|
---|
96 | //@}
|
---|
97 |
|
---|
98 |
|
---|
99 | public:
|
---|
100 | // -----------------------------------------------------------------------
|
---|
101 | // All constructors are hidden, just the destructor is available
|
---|
102 | // -----------------------------------------------------------------------
|
---|
103 | /** @name Destructor */
|
---|
104 | //@{
|
---|
105 | /**
|
---|
106 | * Destructor
|
---|
107 | *
|
---|
108 | */
|
---|
109 | virtual ~DOMWriterFilter() {};
|
---|
110 | //@}
|
---|
111 |
|
---|
112 | // -----------------------------------------------------------------------
|
---|
113 | // Virtual DOMWriterFilter interface
|
---|
114 | // -----------------------------------------------------------------------
|
---|
115 | /** @name Functions introduced in DOM Level 3 */
|
---|
116 | //@{
|
---|
117 | /**
|
---|
118 | * Interface from <code>DOMNodeFilter</code>,
|
---|
119 | * to be implemented by implementation (derived class)
|
---|
120 | */
|
---|
121 | virtual short acceptNode(const DOMNode* node) const = 0;
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * Tells the DOMWriter what types of nodes to show to the filter.
|
---|
125 | * See <code>DOMNodeFilter</code> for definition of the constants.
|
---|
126 | * The constant SHOW_ATTRIBUTE is meaningless here, attribute nodes will
|
---|
127 | * never be passed to a DOMWriterFilter.
|
---|
128 | *
|
---|
129 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
130 | *
|
---|
131 | * @return The constants of what types of nodes to show.
|
---|
132 | * @see setWhatToShow
|
---|
133 | * @since DOM Level 3
|
---|
134 | */
|
---|
135 | virtual unsigned long getWhatToShow() const =0;
|
---|
136 |
|
---|
137 | /**
|
---|
138 | * Set what types of nodes are to be presented.
|
---|
139 | * See <code>DOMNodeFilter</code> for definition of the constants.
|
---|
140 | *
|
---|
141 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
142 | *
|
---|
143 | * @param toShow The constants of what types of nodes to show.
|
---|
144 | * @see getWhatToShow
|
---|
145 | * @since DOM Level 3
|
---|
146 | */
|
---|
147 | virtual void setWhatToShow(unsigned long toShow) =0;
|
---|
148 | //@}
|
---|
149 |
|
---|
150 | private:
|
---|
151 |
|
---|
152 | // -----------------------------------------------------------------------
|
---|
153 | // Private data members
|
---|
154 | //
|
---|
155 | // fWhatToShow
|
---|
156 | //
|
---|
157 | // The whatToShow mask.
|
---|
158 | // Tells the DOMWriter what types of nodes to show to the filter.
|
---|
159 | // See NodeFilter for definition of the constants.
|
---|
160 | // The constants
|
---|
161 | // SHOW_ATTRIBUTE,
|
---|
162 | // SHOW_DOCUMENT,
|
---|
163 | // SHOW_DOCUMENT_TYPE,
|
---|
164 | // SHOW_NOTATION, and
|
---|
165 | // SHOW_DOCUMENT_FRAGMENT are meaningless here,
|
---|
166 | // Entity nodes are not passed to the filter.
|
---|
167 | //
|
---|
168 | // Those nodes will never be passed to a DOMWriterFilter.
|
---|
169 | //
|
---|
170 | // Derived class shall add this data member:
|
---|
171 | //
|
---|
172 | // unsigned long fWhatToShow;
|
---|
173 | // -----------------------------------------------------------------------
|
---|
174 |
|
---|
175 | };
|
---|
176 |
|
---|
177 | XERCES_CPP_NAMESPACE_END
|
---|
178 |
|
---|
179 | #endif
|
---|