CrystalSpace

Public API Reference

CS::DocSystem Namespace Reference

Document system / XML helper classes. 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

void CloneAttributes (iDocumentNode *from, iDocumentNode *to)
 Copy the attributes of a node to another node.
void CloneNode (iDocumentNode *from, iDocumentNode *to)
 Recursively clone a node with all its attributes and child-nodes.
template<class T>
csPtr
< iDocumentNodeIterator
FilterDocumentNodeIterator (csRef< iDocumentNodeIterator > parent, T filter)
 Get a filtering iDocumentNodeIterator.
csString FlattenNode (iDocumentNode *node)
 "Flatten" a document node structure into a string, suitable for e.g.
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

Document system / XML helper classes.

Function Documentation

void CS::DocSystem::CloneAttributes ( iDocumentNode from,
iDocumentNode to 
) [inline]

Copy the attributes of a node to another node.

Parameters:
from Source node
to Destination node

Definition at line 181 of file documenthelper.h.

References iDocumentNode::GetAttributes(), and iDocumentNode::SetAttribute().

Referenced by CS::DocumentHelper::CloneAttributes(), and CloneNode().

void CS::DocSystem::CloneNode ( iDocumentNode from,
iDocumentNode to 
) [inline]

Recursively clone a node with all its attributes and child-nodes.

Parameters:
from Source root node
to Destination root node

Definition at line 196 of file documenthelper.h.

References CloneAttributes(), iDocumentNode::CreateNodeBefore(), iDocumentNode::GetNodes(), iDocumentNode::GetValue(), and iDocumentNode::SetValue().

Referenced by CS::DocumentHelper::CloneNode().

template<class T>
csPtr<iDocumentNodeIterator> CS::DocSystem::FilterDocumentNodeIterator ( csRef< iDocumentNodeIterator parent,
filter 
) [inline]

Get a filtering iDocumentNodeIterator.

Only nodes matching the filter are returned. Example usage:

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

Definition at line 347 of file documenthelper.h.

Referenced by CS::DocumentHelper::FilterDocumentNodeIterator().

csString CS::DocSystem::FlattenNode ( iDocumentNode node  )  [inline]

"Flatten" a document node structure into a string, suitable for e.g.

hashing.

Deprecated:
Use CS::DocSystem::FlattenNode

Definition at line 430 of file documenthelper.h.

Referenced by CS::DocumentHelper::FlattenNode().

template<class T>
void CS::DocSystem::RemoveDuplicateChildren ( iDocumentNode rootNode,
csRef< iDocumentNodeIterator childIt,
eq 
) [inline]

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 128 of file documenthelper.h.

References iDocumentNode::RemoveNode().

template<class T>
void CS::DocSystem::RemoveDuplicateChildren ( iDocumentNode rootNode,
eq 
) [inline]

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 115 of file documenthelper.h.

References iDocumentNode::GetNodes().

Referenced by CS::DocumentHelper::RemoveDuplicateChildren().


Generated for Crystal Space 1.2.1 by doxygen 1.5.3