## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Namespace List
- Namespace Members

# CrystalSpace::DocumentHelper Namespace Reference

Namespace contains helper functions and classes which operate on iDocumentNode and iDocumentNodeIterator. More...

## Classes

struct | NodeAttributeCompare
| Node comparator. More...
struct | NodeAttributeRegexpTest
| Check if a regular expression matches(case-insensitive) with the value of the given attribute. More...
struct | NodeAttributeValueTest
| Compare (case-sensitive) node attribute to given. More...
struct | NodeNameCompare
| Node comparator. More...
struct | NodeValueTest
| Compare (case-sensitive) node value to given. More...

## Namespaces

namespace | Implementation

## Functions

template<class T>
csPtr< iDocumentNodeIterator > | FilterDocumentNodeIterator (csRef< iDocumentNodeIterator > parent, T filter)
| Get a filtering iDocumentNodeIterator Example usage:.
template<class T>
void | RemoveDuplicateChildren (iDocumentNode *rootNode, csRef< iDocumentNodeIterator > childIt, T eq)
| Remove duplicate child-nodes.
template<class T>
void | RemoveDuplicateChildren (iDocumentNode *rootNode, T eq)
| Remove duplicate child-nodes.

## Detailed Description

Namespace contains helper functions and classes which operate on iDocumentNode and iDocumentNodeIterator.

## Function Documentation

template<class T>
csPtr<iDocumentNodeIterator> CrystalSpace::DocumentHelper::FilterDocumentNodeIterator | ( | csRef< iDocumentNodeIterator > | parent,
|  | T | filter
| ) |

Get a filtering iDocumentNodeIterator Example usage:.

     DocumentHelper::NodeAttributeValueTest test ("name", "Marten");
     csRef<iDocumentNodeIterator> it =
       DocumentHelper::FilterDocumentNodeIterator (node->GetNodes(), test);
     while (it->HasNext ())
     { ... }

Definition at line 303 of file documenthelper.h.

template<class T>
void CrystalSpace::DocumentHelper::RemoveDuplicateChildren | ( | iDocumentNode * | rootNode,
|  | csRef< iDocumentNodeIterator > | childIt,
|  | T | eq
| ) |

| Remove duplicate child-nodes. The functor T is used to determine what should be seen as equal nodes. This is potentially an O(n^2) operation! Definition at line 119 of file documenthelper.h.

template<class T>
void CrystalSpace::DocumentHelper::RemoveDuplicateChildren | ( | iDocumentNode * | rootNode,
|  | T | eq
| ) |

| Remove duplicate child-nodes. The functor T is used to determine what should be seen as equal nodes. This is potentially an O(n^2) operation! Definition at line 106 of file documenthelper.h. References iDocumentNode::GetNodes().