#include <DomCharacterData.h>
Inherits xmldom::DomNode.
Inherited by xmldom::DomComment, and xmldom::DomText.
Inheritance diagram for xmldom::DomCharacterData:
DomCharacterData
interface extends DomNode 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 DomCharacterData
, though DomText
and others do inherit the interface from it. All offsets
in this interface start from 0
.
As explained in the DOM spec, text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on DomCharacterData is done in 16-bit units.
Public Member Functions | |
DomCharacterData () | |
ctor | |
DomCharacterData (const DomCharacterData ©) | |
copy ctor | |
virtual | ~DomCharacterData () |
dtor | |
DOM Level 1 | |
DomString | getData () const |
Returns the character data of the node that implements this interface. | |
XmlSize | getLength () const |
Returns the number of characters that are available through data and the substringData() method below. | |
DomString | substringData (XmlSize offset, XmlSize count) const |
Extracts a range of data from the node. | |
void | appendData (const DomString &arg) |
Append the string to the end of the character data of the node. | |
void | insertData (XmlSize offset, const DomString &arg) |
Insert a string at the specified character offset. | |
void | deleteData (XmlSize offset, XmlSize count) |
Remove a range of characters from the node. | |
void | replaceData (XmlSize offset, XmlSize count, const DomString &arg) |
Replace the characters starting at the specified character offset with the specified string. | |
void | setData (const DomString &data) |
Sets the character data of the node that implements this interface. |
xmldom::DomCharacterData::DomCharacterData | ( | ) |
ctor
xmldom::DomCharacterData::DomCharacterData | ( | const DomCharacterData & | copy | ) |
copy ctor
xmldom::DomCharacterData::~DomCharacterData | ( | ) | [virtual] |
dtor
DomString xmldom::DomCharacterData::getData | ( | ) | const |
Returns the character data of the node that implements this interface.
The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a DomCharacterData
node. However, implementation limits may mean that the entirety of a node's data may not fit into a single string. In such cases, the user may call substringData()
to retrieve the data in appropriately sized pieces.
XmlSize xmldom::DomCharacterData::getLength | ( | ) | const |
Returns the number of characters that are available through data and the substringData()
method below.
This may have the value zero, i.e., DomCharacterData
nodes may be empty.
DomString xmldom::DomCharacterData::substringData | ( | XmlSize | offset, | |
XmlSize | count | |||
) | const |
Extracts a range of data from the node.
offset | Start offset of substring to extract. | |
count | The number of characters to extract. |
offset
and count
exceeds the length, then all characters to the end of the data are returned. void xmldom::DomCharacterData::appendData | ( | const DomString & | arg | ) |
Append the string to the end of the character data of the node.
Upon success, data provides access to the concatenation of data and the string specified.
arg | The string to append. |
void xmldom::DomCharacterData::insertData | ( | XmlSize | offset, | |
const DomString & | arg | |||
) |
Insert a string at the specified character offset.
offset | The character offset at which to insert. | |
arg | The string to insert. |
void xmldom::DomCharacterData::deleteData | ( | XmlSize | offset, | |
XmlSize | count | |||
) |
Remove a range of characters from the node.
Upon success, data and length reflect the change.
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. |
void xmldom::DomCharacterData::replaceData | ( | XmlSize | offset, | |
XmlSize | count, | |||
const DomString & | arg | |||
) |
Replace the characters starting at the specified character offset with the specified string.
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 string with which the range must be replaced. |
void xmldom::DomCharacterData::setData | ( | const DomString & | data | ) |
Sets the character data of the node that implements this interface.
data | The string to set. |