Search for usage in LXR

DOM::CustomNodeFilter Class Reference

#include <dom2_traversal.h>

Inherits DOM::DomShared.

Public Member Functions

virtual short acceptNode (const Node &n)
virtual DOMString customNodeFilterType ()
virtual bool isNull ()

Protected Attributes

CustomNodeFilterImpl * impl

Detailed Description

CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers.

You can create a custom filter by doing the following:

class MyCustomNodeFilter { ..... virtual short acceptNode (const Node &n); ..... }

Then in your program:

short MyCustomNodeFilter::acceptNode (const Node &n) { if (condition) return NodeFilter::FILTER_ACCEPT; else .... }

MyCustomFilter *filter = new MyCustomFilter(); NodeFilter nf = NodeFilter::createCustom(filter); NodeIterator ni = document.createNodeIterator(document,NodeFilter.SHOW_ALL,nf,false);

The default implementation of acceptNode() returns NodeFilter::FILTER_ACCEPT for all nodes.

Definition at line 294 of file dom2_traversal.h.

Member Function Documentation

◆ customNodeFilterType()

DOMString CustomNodeFilter::customNodeFilterType ( )

not part of the DOM

Returns a name specifying the type of custom node filter. Useful for checking if an custom node filter is of a particular sublass.

Definition at line 263 of file dom2_traversal.cpp.

Member Data Documentation

◆ impl

CustomNodeFilterImpl* DOM::CustomNodeFilter::impl

Reserved. Do not use in your subclasses.

Definition at line 317 of file dom2_traversal.h.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Jun 29 2022 04:11:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.