#ifndef JEZUK_DOM_TRAVERSAL_NODEITERATOR_H #define JEZUK_DOM_TRAVERSAL_NODEITERATOR_H ///////////////////////////////////////// // C++ DOM Traversal Implementation // // $Id$ ///////////////////////////////////////// #include #include namespace DOM { namespace Traversal { template class NodeIterator_impl; template class NodeIterator : protected DOM::Proxy { public: NodeIterator() : Proxy(0) { } explicit NodeIterator(NodeIterator_impl* const impl) : Proxy(impl) { } NodeIterator(const NodeIterator& rhs) : Proxy(rhs) { } virtual ~NodeIterator() { } bool operator==(const NodeIterator& rhs) const { return Proxy::operator==(rhs); } bool operator!=(const NodeIterator& rhs) const { return Proxy::operator!=(rhs); } bool operator==(int dummy) const { return Proxy::operator==(dummy); } bool operator!=(int dummy) const { return Proxy::operator!=(dummy); } NodeIterator& operator=(const NodeIterator& rhs) { Proxy::operator=(rhs); return *this; } // operator= /////////////////////////////////////////////////////////////// // NodeIterator methods DOM::Node getRoot() const { return Impl()->getRoot(); } int getWhatToShow() const { return Impl()->getWhatToShow(); } NodeFilter* getFilter() const { return Impl()->getFilter(); } bool getExpandEntityReferences() const { return Impl()->getExpandEntityReferences(); } DOM::Node nextNode() { return Impl()->nextNode(); } DOM::Node previousNode() { return Impl()->prevNode(); } void detach() { return Impl()->detach(); } private: NodeIterator_impl* Impl() const { return dynamic_cast*>(impl()); } }; // class NodeIterator //////////////////////////////////////////////// template class DocumentTraversal_impl; template class NodeIterator_impl : virtual public DOM::Impl { public: virtual DOM::Node getRoot() const = 0; virtual int getWhatToShow() const = 0; virtual NodeFilter* getFilter() const = 0; virtual bool getExpandEntityReferences() const = 0; virtual DOM::Node nextNode() = 0; virtual DOM::Node previousNode() = 0; virtual void detach() = 0; }; // class NodeIterator_impl } // namespace Traversal } // namespace DOM #endif // end of file