00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 /* 00019 * $Id: DOMTreeWalker.hpp 671894 2008-06-26 13:29:21Z borisk $ 00020 */ 00021 00022 #if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP) 00023 #define XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP 00024 00025 #include <xercesc/dom/DOMNode.hpp> 00026 #include <xercesc/dom/DOMNodeFilter.hpp> 00027 00028 XERCES_CPP_NAMESPACE_BEGIN 00029 00030 00050 class CDOM_EXPORT DOMTreeWalker { 00051 protected: 00052 // ----------------------------------------------------------------------- 00053 // Hidden constructors 00054 // ----------------------------------------------------------------------- 00057 DOMTreeWalker() {} 00058 DOMTreeWalker(const DOMTreeWalker &) {} 00060 00061 private: 00062 // ----------------------------------------------------------------------- 00063 // Unimplemented constructors and operators 00064 // ----------------------------------------------------------------------- 00067 DOMTreeWalker & operator = (const DOMTreeWalker &); 00069 00070 public: 00071 // ----------------------------------------------------------------------- 00072 // All constructors are hidden, just the destructor is available 00073 // ----------------------------------------------------------------------- 00080 virtual ~DOMTreeWalker() {}; 00082 00083 // ----------------------------------------------------------------------- 00084 // Virtual DOMTreeWalker interface 00085 // ----------------------------------------------------------------------- 00088 // ----------------------------------------------------------------------- 00089 // Getter methods 00090 // ----------------------------------------------------------------------- 00091 00098 virtual DOMNode* getRoot() = 0; 00109 virtual DOMNodeFilter::ShowType getWhatToShow()= 0; 00110 00116 virtual DOMNodeFilter* getFilter()= 0; 00117 00135 virtual bool getExpandEntityReferences()= 0; 00136 00142 virtual DOMNode* getCurrentNode()= 0; 00143 00144 // ----------------------------------------------------------------------- 00145 // Query methods 00146 // ----------------------------------------------------------------------- 00158 virtual DOMNode* parentNode()= 0; 00159 00170 virtual DOMNode* firstChild()= 0; 00171 00182 virtual DOMNode* lastChild()= 0; 00183 00194 virtual DOMNode* previousSibling()= 0; 00195 00205 virtual DOMNode* nextSibling()= 0; 00206 00219 virtual DOMNode* previousNode()= 0; 00220 00232 virtual DOMNode* nextNode()= 0; 00233 00234 // ----------------------------------------------------------------------- 00235 // Setter methods 00236 // ----------------------------------------------------------------------- 00254 virtual void setCurrentNode(DOMNode* currentNode)= 0; 00256 00257 // ----------------------------------------------------------------------- 00258 // Non-standard Extension 00259 // ----------------------------------------------------------------------- 00268 virtual void release() = 0; 00270 }; 00271 00272 #define GetDOMTreeWalkerMemoryManager GET_INDIRECT_MM(fCurrentNode) 00273 00274 XERCES_CPP_NAMESPACE_END 00275 00276 #endif