source: icXML/icXML-devel/src/xercesc/dom/impl/DOMNodeIteratorImpl.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: 4.0 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: DOMNodeIteratorImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_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//////////////////////////////////////////////////////////////////////
35// DOMNodeIteratorImpl.hpp: interface for the DOMNodeIteratorImpl class.
36//
37//////////////////////////////////////////////////////////////////////
38
39#include <xercesc/dom/DOMNode.hpp>
40#include <xercesc/dom/DOMNodeIterator.hpp>
41
42XERCES_CPP_NAMESPACE_BEGIN
43
44class CDOM_EXPORT DOMNodeIteratorImpl : public DOMNodeIterator {
45    protected:
46        //
47        // Data
48        //
49        // The root.
50        DOMNode* fRoot;
51
52        // The Document used to create this iterator
53        DOMDocument* fDocument;
54
55        // The whatToShow mask.
56        DOMNodeFilter::ShowType fWhatToShow;
57
58        // The NodeFilter reference.
59        DOMNodeFilter* fNodeFilter;
60
61
62        // The expandEntity reference flag.
63        bool  fExpandEntityReferences;
64        bool fDetached;
65
66
67        //
68        // Iterator state - current node and direction.
69        //
70        // Note: The current node and direction are sufficient to implement
71        // the desired behaviour of the current pointer being _between_
72        // two nodes. The fCurrentNode is actually the last node returned,
73        // and the
74        // direction is whether the pointer is in front or behind this node.
75        // (usually akin to whether the node was returned via nextNode())
76        // (eg fForward = true) or previousNode() (eg fForward = false).
77        // The last Node returned.
78        DOMNode* fCurrentNode;
79
80        // The direction of the iterator on the fCurrentNode.
81        //  <code>
82        //  nextNode()  ==      fForward = true;<br>
83        //  previousNode() ==   fForward = false;<br>
84        //  </code>
85        bool fForward;
86
87    public:
88        virtual ~DOMNodeIteratorImpl ();
89        DOMNodeIteratorImpl (
90            DOMDocument* fDocument,
91            DOMNode* root,
92            DOMNodeFilter::ShowType whatToShow,
93            DOMNodeFilter* nodeFilter,
94            bool expandEntityRef);
95
96        DOMNodeIteratorImpl ( const DOMNodeIteratorImpl& toCopy);
97        DOMNodeIteratorImpl& operator= (const DOMNodeIteratorImpl& other);
98
99        virtual DOMNode* getRoot ();
100        virtual DOMNodeFilter::ShowType getWhatToShow ();
101        virtual DOMNodeFilter* getFilter ();
102        // Get the expandEntity reference flag.
103        virtual bool getExpandEntityReferences();
104
105        virtual DOMNode* nextNode ();
106        virtual DOMNode* previousNode ();
107        virtual void detach ();
108
109        virtual void release();
110        void removeNode (DOMNode* node);
111
112    protected:
113        DOMNode* matchNodeOrParent (DOMNode* node);
114        DOMNode* nextNode (DOMNode* node, bool visitChildren);
115        DOMNode* previousNode (DOMNode* node);
116        bool acceptNode (DOMNode* node);
117
118};
119
120XERCES_CPP_NAMESPACE_END
121
122#endif
Note: See TracBrowser for help on using the repository browser.