<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qdom.cpp --> <head> <title>Qt 4.6: QDomCharacterData Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QDomCharacterData"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QDomCharacterData Class Reference<br /><span class="small-subtitle">[<a href="qtxml.html">QtXml</a> module]</span> </h1> <p>The QDomCharacterData class represents a generic string in the DOM. <a href="#details">More...</a></p> <pre> #include <QDomCharacterData></pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p> <p>Inherits <a href="qdomnode.html">QDomNode</a>.</p> <p>Inherited by <a href="qdomcomment.html">QDomComment</a> and <a href="qdomtext.html">QDomText</a>.</p> <p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p> <ul> <li><a href="qdomcharacterdata-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#QDomCharacterData">QDomCharacterData</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#QDomCharacterData-2">QDomCharacterData</a></b> ( const QDomCharacterData & <i>x</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#appendData">appendData</a></b> ( const QString & <i>arg</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#data">data</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#deleteData">deleteData</a></b> ( unsigned long <i>offset</i>, unsigned long <i>count</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#insertData">insertData</a></b> ( unsigned long <i>offset</i>, const QString & <i>arg</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">uint </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#length">length</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QDomNode::NodeType </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#nodeType">nodeType</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#replaceData">replaceData</a></b> ( unsigned long <i>offset</i>, unsigned long <i>count</i>, const QString & <i>arg</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#setData">setData</a></b> ( const QString & <i>v</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#substringData">substringData</a></b> ( unsigned long <i>offset</i>, unsigned long <i>count</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QDomCharacterData & </td><td class="memItemRight" valign="bottom"><b><a href="qdomcharacterdata.html#operator-eq">operator=</a></b> ( const QDomCharacterData & <i>x</i> )</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>66 public functions inherited from <a href="qdomnode.html#public-functions">QDomNode</a></li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QDomCharacterData class represents a generic string in the DOM.</p> <p>Character data as used in XML specifies a generic data string. More specialized versions of this class are <a href="qdomtext.html">QDomText</a>, <a href="qdomcomment.html">QDomComment</a> and <a href="qdomcdatasection.html">QDomCDATASection</a>.</p> <p>The data string is set with <a href="qdomcharacterdata.html#setData">setData</a>() and retrieved with <a href="qdomcharacterdata.html#data">data</a>(). You can retrieve a portion of the data string using <a href="qdomcharacterdata.html#substringData">substringData</a>(). Extra data can be appended with <a href="qdomcharacterdata.html#appendData">appendData</a>(), or inserted with <a href="qdomcharacterdata.html#insertData">insertData</a>(). Portions of the data string can be deleted with <a href="qdomcharacterdata.html#deleteData">deleteData</a>() or replaced with <a href="qdomcharacterdata.html#replaceData">replaceData</a>(). The length of the data string is returned by <a href="qdomcharacterdata.html#length">length</a>().</p> <p>The node type of the node containing this character data is returned by <a href="qdomcharacterdata.html#nodeType">nodeType</a>().</p> <p>See also <a href="qdomtext.html">QDomText</a>, <a href="qdomcomment.html">QDomComment</a>, and <a href="qdomcdatasection.html">QDomCDATASection</a>.</p> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QDomCharacterData/QDomCharacterData"></a> <h3 class="fn"><a name="QDomCharacterData"></a>QDomCharacterData::QDomCharacterData ()</h3> <p>Constructs an empty character data object.</p> <h3 class="fn"><a name="QDomCharacterData-2"></a>QDomCharacterData::QDomCharacterData ( const QDomCharacterData & <i>x</i> )</h3> <p>Constructs a copy of <i>x</i>.</p> <p>The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use <a href="qdomnode.html#cloneNode">cloneNode</a>().</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/appendData"></a> <h3 class="fn"><a name="appendData"></a>void QDomCharacterData::appendData ( const <a href="qstring.html">QString</a> & <i>arg</i> )</h3> <p>Appends the string <i>arg</i> to the stored string.</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/data"></a> <h3 class="fn"><a name="data"></a><a href="qstring.html">QString</a> QDomCharacterData::data () const</h3> <p>Returns the string stored in this object.</p> <p>If the node is a <a href="qdomnode.html#isNull">null node</a>, it will return an empty string.</p> <p>See also <a href="qdomcharacterdata.html#setData">setData</a>().</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/deleteData"></a> <h3 class="fn"><a name="deleteData"></a>void QDomCharacterData::deleteData ( unsigned long <i>offset</i>, unsigned long <i>count</i> )</h3> <p>Deletes a substring of length <i>count</i> from position <i>offset</i>.</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/insertData"></a> <h3 class="fn"><a name="insertData"></a>void QDomCharacterData::insertData ( unsigned long <i>offset</i>, const <a href="qstring.html">QString</a> & <i>arg</i> )</h3> <p>Inserts the string <i>arg</i> into the stored string at position <i>offset</i>.</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/length"></a> <h3 class="fn"><a name="length"></a><a href="qtglobal.html#uint-typedef">uint</a> QDomCharacterData::length () const</h3> <p>Returns the length of the stored string.</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/nodeType"></a> <h3 class="fn"><a name="nodeType"></a><a href="qdomnode.html#NodeType-enum">QDomNode::NodeType</a> QDomCharacterData::nodeType () const</h3> <p>Returns the type of node this object refers to (i.e. <tt>TextNode</tt>, <tt>CDATASectionNode</tt>, <tt>CommentNode</tt> or <tt>CharacterDataNode</tt>). For a <a href="qdomnode.html#isNull">null node</a>, returns <tt>CharacterDataNode</tt>.</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/replaceData"></a> <h3 class="fn"><a name="replaceData"></a>void QDomCharacterData::replaceData ( unsigned long <i>offset</i>, unsigned long <i>count</i>, const <a href="qstring.html">QString</a> & <i>arg</i> )</h3> <p>Replaces the substring of length <i>count</i> starting at position <i>offset</i> with the string <i>arg</i>.</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/setData"></a> <h3 class="fn"><a name="setData"></a>void QDomCharacterData::setData ( const <a href="qstring.html">QString</a> & <i>v</i> )</h3> <p>Sets this object's string to <i>v</i>.</p> <p>See also <a href="qdomcharacterdata.html#data">data</a>().</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/substringData"></a> <h3 class="fn"><a name="substringData"></a><a href="qstring.html">QString</a> QDomCharacterData::substringData ( unsigned long <i>offset</i>, unsigned long <i>count</i> )</h3> <p>Returns the substring of length <i>count</i> from position <i>offset</i>.</p> <a name="//apple_ref/cpp/instm/QDomCharacterData/operator="></a> <h3 class="fn"><a name="operator-eq"></a>QDomCharacterData & QDomCharacterData::operator= ( const QDomCharacterData & <i>x</i> )</h3> <p>Assigns <i>x</i> to this character data.</p> <p>The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use <a href="qdomnode.html#cloneNode">cloneNode</a>().</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>