Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skNode Class Reference

This class describes a node within an XML document hierarchy. More...

#include <skNode.h>

Inheritance diagram for skNode:

skElement skTextNode skCDataNode List of all members.

Public Types

enum  NodeType {
  ELEMENT_NODE,
  CDATA_SECTION_NODE,
  TEXT_NODE
}
 This enumeration is used to distinguish between different types of node in a document.


Public Methods

virtual skString getNodeValue () const
 This method returns the "value" of a node. More...

virtual void setNodeValue (const skString& s)
 This method sets the "value" of the node. More...

virtual NodeType getNodeType () const = 0
 This abstract virtual function returns the type of this node. More...

virtual skNode* clone () = 0
 This abstract virtual function requests that the node create a copy of itself. More...

virtual void write (ostream& out) const = 0
 This abstract virtual function writes a textual representation of this node and its children to the given stream. More...


Protected Methods

 skNode ()
 Prevent nodes from being copied by the default C++ behaviour.

 skNode (const skNode&)
skNode& operator= (const skNode& other)

Detailed Description

This class describes a node within an XML document hierarchy.

It is part of the classes used in the Simkin XML DOM (Document Object Model)


Member Function Documentation

skNode * skNode::clone ( ) [pure virtual]
 

This abstract virtual function requests that the node create a copy of itself.

How this is done depends on the actual class of the node.

Returns:
a new node which is a clone of this one. A "deep" copy is performed.

Reimplemented in skElement, skTextNode, and skCDataNode.

NodeType skNode::getNodeType ( ) const [pure virtual]
 

This abstract virtual function returns the type of this node.

It will be one of the NodeType values

Returns:
a NodeType value indicating the class to which this node belongs

Reimplemented in skElement, and skTextNode.

skString skNode::getNodeValue ( ) const [virtual]
 

This method returns the "value" of a node.

Typically this would be the text for a text or cdata node.

Returns:
returns a string. By default this is an empty string.

Reimplemented in skTextNode.

void skNode::setNodeValue ( const skString & s ) [virtual]
 

This method sets the "value" of the node.

Typically this would be the text for a text or cdata node. For other nodes, this does nothing.

Parameters:
s   - the new value

Reimplemented in skTextNode.

void skNode::write ( ostream & out ) const [pure virtual]
 

This abstract virtual function writes a textual representation of this node and its children to the given stream.

Parameters:
out   - the stream to write to

Reimplemented in skElement, and skTextNode.


The documentation for this class was generated from the following files:
Generated at Mon Nov 5 19:22:26 2001 for Simkin by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000