XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMNodeIteratorImpl : public DOMNodeIterator {
private:
//
// Data
//
// The root.
DOMNode* fRoot;
// The Document used to create this iterator
DOMDocument* fDocument;
// The whatToShow mask.
unsigned long fWhatToShow;
// The NodeFilter reference.
DOMNodeFilter* fNodeFilter;
// The expandEntity reference flag.
bool fExpandEntityReferences;
bool fDetached;
//
// Iterator state - current node and direction.
//
// Note: The current node and direction are sufficient to implement
// the desired behaviour of the current pointer being _between_
// two nodes. The fCurrentNode is actually the last node returned,
// and the
// direction is whether the pointer is in front or behind this node.
// (usually akin to whether the node was returned via nextNode())
// (eg fForward = true) or previousNode() (eg fForward = false).
// The last Node returned.
DOMNode* fCurrentNode;
// The direction of the iterator on the fCurrentNode.
//
// nextNode() == fForward = true;
// previousNode() == fForward = false;
//
bool fForward;
public:
virtual ~DOMNodeIteratorImpl ();
DOMNodeIteratorImpl (
DOMDocument* fDocument,
DOMNode* root,
unsigned long whatToShow,
DOMNodeFilter* nodeFilter,
bool expandEntityRef);
DOMNodeIteratorImpl ( const DOMNodeIteratorImpl& toCopy);
DOMNodeIteratorImpl& operator= (const DOMNodeIteratorImpl& other);
virtual DOMNode* getRoot ();
virtual unsigned long getWhatToShow ();
virtual DOMNodeFilter* getFilter ();
// Get the expandEntity reference flag.
virtual bool getExpandEntityReferences();
virtual DOMNode* nextNode ();
virtual DOMNode* previousNode ();
virtual void detach ();
virtual void release();
void removeNode (DOMNode* node);
private:
DOMNode* matchNodeOrParent (DOMNode* node);
DOMNode* nextNode (DOMNode* node, bool visitChildren);
DOMNode* previousNode (DOMNode* node);
bool acceptNode (DOMNode* node);
};
XERCES_CPP_NAMESPACE_END
#endif