Xerces-C++: DOMTreeWalker.hpp Source File

Xerces-C++ 3.3.0

DOMTreeWalker.hpp
Go to the documentation of this file.
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$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP
24
25#include <xercesc/dom/DOMNode.hpp>
26#include <xercesc/dom/DOMNodeFilter.hpp>
27
28 XERCES_CPP_NAMESPACE_BEGIN
29
30
50 class CDOM_EXPORT DOMTreeWalker {
51protected:
52 // -----------------------------------------------------------------------
53 // Hidden constructors
54 // -----------------------------------------------------------------------
57 DOMTreeWalker() {}
58 DOMTreeWalker(const DOMTreeWalker &) {}
60
61private:
62 // -----------------------------------------------------------------------
63 // Unimplemented constructors and operators
64 // -----------------------------------------------------------------------
67 DOMTreeWalker & operator = (const DOMTreeWalker &);
69
70public:
71 // -----------------------------------------------------------------------
72 // All constructors are hidden, just the destructor is available
73 // -----------------------------------------------------------------------
80 virtual ~DOMTreeWalker() {};
82
83 // -----------------------------------------------------------------------
84 // Virtual DOMTreeWalker interface
85 // -----------------------------------------------------------------------
88 // -----------------------------------------------------------------------
89 // Getter methods
90 // -----------------------------------------------------------------------
91
98 virtual DOMNode* getRoot() = 0;
109 virtual DOMNodeFilter::ShowType getWhatToShow()= 0;
110
116 virtual DOMNodeFilter* getFilter()= 0;
117
135 virtual bool getExpandEntityReferences()= 0;
136
142 virtual DOMNode* getCurrentNode()= 0;
143
144 // -----------------------------------------------------------------------
145 // Query methods
146 // -----------------------------------------------------------------------
158 virtual DOMNode* parentNode()= 0;
159
170 virtual DOMNode* firstChild()= 0;
171
182 virtual DOMNode* lastChild()= 0;
183
194 virtual DOMNode* previousSibling()= 0;
195
205 virtual DOMNode* nextSibling()= 0;
206
219 virtual DOMNode* previousNode()= 0;
220
232 virtual DOMNode* nextNode()= 0;
233
234 // -----------------------------------------------------------------------
235 // Setter methods
236 // -----------------------------------------------------------------------
254 virtual void setCurrentNode(DOMNode* currentNode)= 0;
256
257 // -----------------------------------------------------------------------
258 // Non-standard Extension
259 // -----------------------------------------------------------------------
268 virtual void release() = 0;
270};
271
272#define GetDOMTreeWalkerMemoryManager GET_INDIRECT_MM(fCurrentNode)
273
274 XERCES_CPP_NAMESPACE_END
275
276#endif
DOMNodeFilter.hpp
DOMNode.hpp
CDOM_EXPORT
#define CDOM_EXPORT
Definition XercesDefs.hpp:166
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
DOMNodeFilter
Filters are objects that know how to "filter out" nodes.
Definition DOMNodeFilter.hpp:50
DOMNodeFilter::ShowType
unsigned long ShowType
Definition DOMNodeFilter.hpp:193
DOMNode
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition DOMNode.hpp:139
DOMTreeWalker
DOMTreeWalker objects are used to navigate a document tree or subtree using the view of the document ...
Definition DOMTreeWalker.hpp:50
DOMTreeWalker::getCurrentNode
virtual DOMNode * getCurrentNode()=0
Return the node at which the DOMTreeWalker is currently positioned.
DOMTreeWalker::~DOMTreeWalker
virtual ~DOMTreeWalker()
Destructor.
Definition DOMTreeWalker.hpp:80
DOMTreeWalker::DOMTreeWalker
DOMTreeWalker(const DOMTreeWalker &)
Definition DOMTreeWalker.hpp:58
DOMTreeWalker::getFilter
virtual DOMNodeFilter * getFilter()=0
Return The filter used to screen nodes.
DOMTreeWalker::DOMTreeWalker
DOMTreeWalker()
Definition DOMTreeWalker.hpp:57
DOMTreeWalker::nextNode
virtual DOMNode * nextNode()=0
Moves the DOMTreeWalker to the next visible node in document order relative to the current node,...
DOMTreeWalker::setCurrentNode
virtual void setCurrentNode(DOMNode *currentNode)=0
The node at which the DOMTreeWalker is currently positioned.
DOMTreeWalker::parentNode
virtual DOMNode * parentNode()=0
Moves to and returns the closest visible ancestor node of the current node.
DOMTreeWalker::lastChild
virtual DOMNode * lastChild()=0
Moves the DOMTreeWalker to the last visible child of the current node, and returns the new node.
DOMTreeWalker::release
virtual void release()=0
Called to indicate that this TreeWalker is no longer in use and that the implementation may relinquis...
DOMTreeWalker::getRoot
virtual DOMNode * getRoot()=0
The root node of the DOMTreeWalker, as specified when it was created.
DOMTreeWalker::nextSibling
virtual DOMNode * nextSibling()=0
Moves the DOMTreeWalker to the next sibling of the current node, and returns the new node.
DOMTreeWalker::previousSibling
virtual DOMNode * previousSibling()=0
Moves the DOMTreeWalker to the previous sibling of the current node, and returns the new node.
DOMTreeWalker::firstChild
virtual DOMNode * firstChild()=0
Moves the DOMTreeWalker to the first visible child of the current node, and returns the new node.
DOMTreeWalker::getWhatToShow
virtual DOMNodeFilter::ShowType getWhatToShow()=0
This attribute determines which node types are presented via the DOMTreeWalker.
DOMTreeWalker::previousNode
virtual DOMNode * previousNode()=0
Moves the DOMTreeWalker to the previous visible node in document order relative to the current node,...
DOMTreeWalker::getExpandEntityReferences
virtual bool getExpandEntityReferences()=0
The value of this flag determines whether the children of entity reference nodes are visible to the D...