clan::DomCharacterData Class Reference - ClanLib SDK
Description: clan::DomCharacterData Class Reference

Public Member Functions | Protected Member Functions | List of all members
clan::DomCharacterData Class Reference
clanXML XML

DOM Character Data class. More...

`#include <dom_character_data.h>`

Inheritance diagram for clan::DomCharacterData:

## Public Member Functions
| DomCharacterData ()
| Constructs a DOM CharacterData handle.
| DomCharacterData (const std::shared_ptr< DomNode_Impl > &impl)
| Constructs a DomCharacterData.
| ~DomCharacterData ()
void | append_data (const DomString &arg)
| Append the string to the end of the character data of the node.
void | delete_data (unsigned long offset, unsigned long count)
| Remove a range of characters from the node.
unsigned long | get_length ()
| The number of characters that are available through data and the substringData method below.
void | insert_data (unsigned long offset, const DomString &arg)
| Insert a string at the specified character offset.
void | replace_data (unsigned long offset, unsigned long count, const DomString &arg)
| Replace the characters starting at the specified character offset with the specified string.
DomString | substring_data (unsigned long offset, unsigned long count)
| Extracts a range of data from the node.
Public Member Functions inherited from clan::DomNode
| DomNode ()
| DomNode (const DomNode &copy)
| Constructs a DomNode.
| ~DomNode ()
DomNode | append_child (DomNode new_child)
| Adds the node new_child to the end of the list of children of this node.
DomNode | clone_node (bool deep) const
| Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
DomString | find_namespace_uri (const DomString &qualified_name) const
| Searches the node tree upwards for the namespace URI of the given qualified name.
DomString | find_prefix (const DomString &namespace_uri) const
| Searches the node tree upwards for the prefix name for the namespace URI.
DomNamedNodeMap | get_attributes () const
| A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
DomNodeList | get_child_nodes () const
| Returns a NodeList that contains all children of this node.
DomNode | get_first_child () const
| The first child of this node.
DomNode | get_last_child () const
| The last child of this node.
DomString | get_local_name () const
| Returns local part of the qualified name of this node.
DomString | get_namespace_uri () const
| Returns the namespace URI of this node.
DomNode | get_next_sibling () const
| The node immediately following this node.
DomString | get_node_name () const
| Returns the node name.
unsigned short | get_node_type () const
| Returns the node type (one of those in the NodeType enum).
DomString | get_node_value () const
| Returns the node value.
DomDocument | get_owner_document () const
| The Document object associated with this node.
DomNode | get_parent_node () const
| Returns the parent of this node.
DomString | get_prefix () const
| Returns the namespace prefix of the node.
DomNode | get_previous_sibling () const
| The node immediately preceding this node.
bool | has_attributes () const
| Returns true if this node (if its an element) has any attributes.
bool | has_child_nodes () const
| Returns true if this node has any children.
DomNode | insert_before (DomNode &new_child, DomNode &ref_child)
| Inserts the node new_child before the existing child node ref_child.
bool | is_attr () const
| Returns true if this is an attribute node.
bool | is_cdata_section () const
| Returns true if this is a CDATA section node.
bool | is_comment () const
| Returns true if this is a comment node.
bool | is_document () const
| Returns true if this is a document node.
bool | is_document_fragment () const
| Returns true if this is a document fragment node.
bool | is_document_type () const
| Returns true if this is a document type node.
bool | is_element () const
| Returns true if this is an element node.
bool | is_entity () const
| Returns true if this is an entity node.
bool | is_entity_reference () const
| Returns true if this is an entity reference node.
bool | is_notation () const
| Returns true if this is a notation node.
bool | is_null () const
| Returns true if this is a null node.
bool | is_processing_instruction () const
| Returns true if this is a processing instruction node.
bool | is_supported (const DomString &feature, const DomString &version) const
| Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
bool | is_text () const
| Returns true if this is a text node.
DomNode | named_item (const DomString &name) const
| Returns the first child node with the specified node name.
DomNode | named_item_ns (const DomString &namespace_uri, const DomString &local_name) const
| Retrieves the first child node with the specified namespace URI and local name.
void | normalize ()
| Merges any adjacent Text nodes.
bool | operator!= (const DomNode &other) const
| Compare operator.
DomNode & | operator= (const DomNode &copy)
| Copy assignment operator.
bool | operator== (const DomNode &other) const
| Compare operator.
DomNode | remove_child (DomNode &old_child)
| Removes the child node indicated by old_child from the list of children, and returns it.
DomNode | replace_child (DomNode &new_child, DomNode &old_child)
| Replaces the child node old_child with new_child in the list of children.
bool | select_bool (const DomString &xpath_expression) const
| Returns the first node value (as boolean) matching the specified xpath expression using this node as the context node.
float | select_float (const DomString &xpath_expression) const
| Returns the first node value (as float) matching the specified xpath expression using this node as the context node.
int | select_int (const DomString &xpath_expression) const
| Returns the first node value (as integer) matching the specified xpath expression using this node as the context node.
DomNode | select_node (const DomString &xpath_expression) const
| Returns the first node matching the specified xpath expression using this node as the context node.
std::vector< DomNode > | select_nodes (const DomString &xpath_expression) const
| Returns all the nodes matching the specified xpath expression using this node as the context node.
std::string | select_string (const DomString &xpath_expression) const
| Returns the first node value matching the specified xpath expression using this node as the context node.
void | set_node_value (const DomString &value)
| Sets the node value.
void | set_prefix (const DomString &prefix)
| Sets the namespace prefix of the node.
DomAttr | to_attr () const
| Returns the Attribute interface to this node.
DomCDATASection | to_cdata_section () const
| Returns the CDATA Section interface to this node.
DomComment | to_comment () const
| Returns the Comment interface to this node.
DomDocument | to_document () const
| Returns the Document interface to this node.
DomDocumentFragment | to_document_fragment () const
| Returns the Document Fragment interface to this node.
DomDocumentType | to_document_type () const
| Returns the Document Type interface to this node.
DomElement | to_element () const
| Returns the Element interface to this node.
DomEntity | to_entity () const
| Returns the Entity interface to this node.
DomEntityReference | to_entity_reference () const
| Returns the Entity Reference interface to this node.
DomNotation | to_notation () const
| Returns the Notation interface to this node.
DomProcessingInstruction | to_processing_instruction () const
| Returns the Processing Instruction interface to this node.
DomText | to_text () const
| Returns the Text interface to this node.

## Protected Member Functions
| DomCharacterData (DomDocument &doc, unsigned short node_type)
Protected Member Functions inherited from clan::DomNode
| DomNode (const std::shared_ptr< DomNode_Impl > &impl)
| DomNode (DomDocument doc, unsigned short node_type)

## Additional Inherited Members
Public Types inherited from clan::DomNode
enum | NodeType { NULL_NODE = 0 , ELEMENT_NODE = 1 , ATTRIBUTE_NODE = 2 , TEXT_NODE = 3 , CDATA_SECTION_NODE = 4 , ENTITY_REFERENCE_NODE = 5 , ENTITY_NODE = 6 , PROCESSING_INSTRUCTION_NODE = 7 , COMMENT_NODE = 8 , DOCUMENT_NODE = 9 , DOCUMENT_TYPE_NODE = 10 , DOCUMENT_FRAGMENT_NODE = 11 , NOTATION_NODE = 12 }
| An integer indicating which type of node this is. More...
Protected Attributes inherited from clan::DomNode
std::shared_ptr< DomNode_Impl > | impl

## Detailed Description

DOM Character Data class.

p>The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to CharacterData, though Text and others do inherit the interface from it.

## Constructor & Destructor Documentation

## ◆ DomCharacterData() [1/3]

clan::DomCharacterData::DomCharacterData | ( |  | ) |

Constructs a DOM CharacterData handle.

## ◆ DomCharacterData() [2/3]

clan::DomCharacterData::DomCharacterData | ( | const std::shared_ptr< DomNode_Impl > & | impl | ) |

Constructs a DomCharacterData.

Parameters

  impl | = Shared Ptr

References clan::DomNode::impl.

## ◆ ~DomCharacterData()

clan::DomCharacterData::~DomCharacterData | ( |  | ) |

## ◆ DomCharacterData() [3/3]

clan::DomCharacterData::DomCharacterData | ( | DomDocument & | doc,
|  | unsigned short | node_type )
| protected

References clan::DomNode::DomDocument.

## Member Function Documentation

## ◆ append_data()

void clan::DomCharacterData::append_data | ( | const DomString & | arg | ) |

Append the string to the end of the character data of the node.

## ◆ delete_data()

void clan::DomCharacterData::delete_data | ( | unsigned long | offset,
|  | unsigned long | count )

Remove a range of characters from the node.

Parameters

  offset | The offset from which to remove characters.
  count | The number of characters to delete. If the sum of offset and count exceeds length then all characters from offset to the end of the data are deleted.

## ◆ get_length()

unsigned long clan::DomCharacterData::get_length | ( |  | ) |

The number of characters that are available through data and the substringData method below.

This may have the value zero, i.e., CharacterData nodes may be empty.

## ◆ insert_data()

void clan::DomCharacterData::insert_data | ( | unsigned long | offset,
|  | const DomString & | arg )

Insert a string at the specified character offset.

Parameters

  offset | The character offset at which to insert.
  arg | The DOMString to insert.

## ◆ replace_data()

void clan::DomCharacterData::replace_data | ( | unsigned long | offset,
|  | unsigned long | count,
|  | const DomString & | arg )

Replace the characters starting at the specified character offset with the specified string.

Parameters

  offset | The offset from which to start replacing.
  count | The number of characters to replace. If the sum of offset and count exceeds length, then all characters to the end of the data are replaced (i.e., the effect is the same as a remove method call with the same range, followed by an append method invocation).
  arg | The DOMString with which the range must be replaced.

## ◆ substring_data()

DomString clan::DomCharacterData::substring_data | ( | unsigned long | offset,
|  | unsigned long | count )

Extracts a range of data from the node.

Parameters

  offset | Start offset of substring to extract.
  count | The number of characters to extract. retval: The specified substring. If the sum of offset and count exceeds the length, then all characters to the end of the data are returned.

The documentation for this class was generated from the following file:

- dom_character_data.h