arabica/include/DOM/Traversal/NodeIterator.h

87 lines
2.4 KiB
C
Raw Normal View History

2002-06-21 13:16:28 +02:00
#ifndef JEZUK_DOM_TRAVERSAL_NODEITERATOR_H
#define JEZUK_DOM_TRAVERSAL_NODEITERATOR_H
/////////////////////////////////////////
// C++ DOM Traversal Implementation
//
// $Id$
/////////////////////////////////////////
#include <DOM/Traversal/NodeFilter.h>
#include <DOM/Node.h>
namespace DOM
{
namespace Traversal
{
template<class stringT> class NodeIterator_impl;
template<class stringT>
2007-01-12 15:52:14 +01:00
class NodeIterator : protected DOM::Proxy<NodeIterator_impl<stringT> >
2002-06-21 13:16:28 +02:00
{
2007-01-12 15:52:14 +01:00
private:
typedef DOM::Proxy<NodeIterator_impl<stringT> > proxy_t;
2002-06-21 13:16:28 +02:00
public:
2007-01-12 15:52:14 +01:00
NodeIterator() : proxy_t(0) { }
explicit NodeIterator(NodeIterator_impl<stringT>* const impl) : proxy_t(impl) { }
NodeIterator(const NodeIterator& rhs) : proxy_t(rhs) { }
2002-06-21 13:16:28 +02:00
virtual ~NodeIterator() { }
2007-01-12 15:52:14 +01:00
bool operator==(const NodeIterator& rhs) const { return proxy_t::operator==(rhs); }
bool operator!=(const NodeIterator& rhs) const { return proxy_t::operator!=(rhs); }
bool operator==(int dummy) const { return proxy_t::operator==(dummy); }
bool operator!=(int dummy) const { return proxy_t::operator!=(dummy); }
2002-06-21 13:16:28 +02:00
NodeIterator& operator=(const NodeIterator& rhs)
{
2007-01-12 15:52:14 +01:00
proxy_t::operator=(rhs);
2002-06-21 13:16:28 +02:00
return *this;
} // operator=
///////////////////////////////////////////////////////////////
// NodeIterator methods
2007-01-12 15:52:14 +01:00
DOM::Node<stringT> getRoot() const { return proxy_t::impl()->getRoot(); }
2002-06-21 13:16:28 +02:00
2007-01-12 15:52:14 +01:00
unsigned long getWhatToShow() const { return proxy_t::impl()->getWhatToShow(); }
2002-06-21 13:16:28 +02:00
2007-01-12 15:52:14 +01:00
NodeFilter<stringT>* getFilter() const { return proxy_t::impl()->getFilter(); }
2002-06-21 13:16:28 +02:00
2007-01-12 15:52:14 +01:00
bool getExpandEntityReferences() const { return proxy_t::impl()->getExpandEntityReferences(); }
2002-06-21 13:16:28 +02:00
2007-01-12 15:52:14 +01:00
DOM::Node<stringT> nextNode() { return proxy_t::impl()->nextNode(); }
2002-06-21 13:16:28 +02:00
2007-01-12 15:52:14 +01:00
DOM::Node<stringT> previousNode() { return proxy_t::impl()->prevNode(); }
2002-06-21 13:16:28 +02:00
2007-01-12 15:52:14 +01:00
void detach() { return proxy_t::impl()->detach(); }
2002-06-21 13:16:28 +02:00
}; // class NodeIterator
////////////////////////////////////////////////
template<class stringT>
class NodeIterator_impl
2002-06-21 13:16:28 +02:00
{
public:
virtual DOM::Node<stringT> getRoot() const = 0;
virtual unsigned long getWhatToShow() const = 0;
2002-06-21 13:16:28 +02:00
virtual NodeFilter<stringT>* getFilter() const = 0;
virtual bool getExpandEntityReferences() const = 0;
virtual DOM::Node<stringT> nextNode() = 0;
virtual DOM::Node<stringT> previousNode() = 0;
virtual void detach() = 0;
}; // class NodeIterator_impl
} // namespace Traversal
} // namespace DOM
#endif
2007-01-12 15:52:14 +01:00
// end of file