source: icXML/icXML-devel/src/xercesc/dom/impl/DOMTreeWalkerImpl.hpp @ 2722

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

Original Xerces files with import mods for icxercesc

File size: 5.4 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: DOMTreeWalkerImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP
24
25//
26//  This file is part of the internal implementation of the C++ XML DOM.
27//  It should NOT be included or used directly by application programs.
28//
29//  Applications should include the file <xercesc/dom/DOM.hpp> for the entire
30//  DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
31//  name is substituded for the *.
32//
33
34#include <xercesc/dom/DOMTreeWalker.hpp>
35
36XERCES_CPP_NAMESPACE_BEGIN
37
38
39class CDOM_EXPORT DOMTreeWalkerImpl : public DOMTreeWalker {
40protected:
41        // The whatToShow mask.
42        DOMNodeFilter::ShowType fWhatToShow;
43
44        // The NodeFilter reference.
45        DOMNodeFilter* fNodeFilter;
46
47        // The current Node.
48        DOMNode* fCurrentNode;
49
50        // The root Node.
51        DOMNode* fRoot;
52
53        // The expandEntity reference flag.
54        bool fExpandEntityReferences;
55
56public:
57    // Implementation Note: No state is kept except the data above
58    // (fWhatToShow, fNodeFilter, fCurrentNode, fRoot) such that
59    // setters could be created for these data values and the
60    // implementation will still work.
61
62    /** Public constructor */
63    DOMTreeWalkerImpl (
64        DOMNode* root,
65        DOMNodeFilter::ShowType whatToShow,
66        DOMNodeFilter* nodeFilter,
67        bool expandEntityRef);
68    DOMTreeWalkerImpl (const DOMTreeWalkerImpl& twi);
69    DOMTreeWalkerImpl& operator= (const DOMTreeWalkerImpl& twi);
70
71    // Return the root node.
72    virtual DOMNode* getRoot ();
73
74    // Return the whatToShow value.
75    virtual DOMNodeFilter::ShowType  getWhatToShow ();
76
77    // Return the NodeFilter.
78    virtual DOMNodeFilter* getFilter ();
79
80
81    // Return the current DOMNode.
82    virtual DOMNode* getCurrentNode ();
83
84    // Return the current Node.
85    virtual void setCurrentNode (DOMNode* node);
86
87    // Return the parent Node from the current node,
88    //  after applying filter, whatToshow.
89    //  If result is not null, set the current Node.
90    virtual DOMNode* parentNode ();
91
92    // Return the first child Node from the current node,
93    //  after applying filter, whatToshow.
94    //  If result is not null, set the current Node.
95    virtual DOMNode* firstChild ();
96
97    // Return the last child Node from the current node,
98    //  after applying filter, whatToshow.
99    //  If result is not null, set the current Node.
100    virtual DOMNode* lastChild ();
101
102    // Return the previous sibling Node from the current node,
103    //  after applying filter, whatToshow.
104    //  If result is not null, set the current Node.
105    virtual DOMNode* previousSibling ();
106
107    // Return the next sibling Node from the current node,
108    //  after applying filter, whatToshow.
109    //  If result is not null, set the current Node.
110
111    virtual DOMNode* nextSibling ();
112    // Return the previous Node from the current node,
113    //  after applying filter, whatToshow.
114    //  If result is not null, set the current Node.
115    virtual DOMNode* previousNode ();
116
117    // Return the next Node from the current node,
118    //  after applying filter, whatToshow.
119    //  If result is not null, set the current Node.
120    virtual DOMNode* nextNode ();
121
122    // Get the expandEntity reference flag.
123    virtual bool getExpandEntityReferences();
124
125    // release the resource
126    virtual void release();
127
128protected:
129
130    // Internal function.
131    //  Return the parent Node, from the input node
132    //  after applying filter, whatToshow.
133    //  The current node is not consulted or set.
134    DOMNode* getParentNode (DOMNode* node);
135
136    // Internal function.
137    //  Return the nextSibling Node, from the input node
138    //  after applying filter, whatToshow.
139    //  The current node is not consulted or set.
140    DOMNode* getNextSibling (DOMNode* node);
141
142    // Internal function.
143    //  Return the previous sibling Node, from the input node
144    //  after applying filter, whatToshow.
145    //  The current node is not consulted or set.
146    DOMNode* getPreviousSibling (DOMNode* node);
147
148    // Internal function.
149    //  Return the first child Node, from the input node
150    //  after applying filter, whatToshow.
151    //  The current node is not consulted or set.
152    DOMNode* getFirstChild (DOMNode* node);
153
154    // Internal function.
155    //  Return the last child Node, from the input node
156    //  after applying filter, whatToshow.
157    //  The current node is not consulted or set.
158    DOMNode* getLastChild (DOMNode* node);
159
160    // The node is accepted if it passes the whatToShow and the filter.
161    short acceptNode (DOMNode* node);
162
163
164};
165
166XERCES_CPP_NAMESPACE_END
167
168#endif
Note: See TracBrowser for help on using the repository browser.