返回介绍

QDomCharacterData Class

发布于 2019-10-04 14:59:45 字数 4711 浏览 996 评论 0 收藏 0

The QDomCharacterData class represents a generic string in the DOM. More...

#include <qdom.h>

Inherits QDomNode.

Inherited by QDomText and QDomComment.

List of all member functions.

Public Members

  • QDomCharacterData ()
  • QDomCharacterData ( constQDomCharacterData&x )
  • QDomCharacterData & operator= ( constQDomCharacterData&x )
  • ~QDomCharacterData ()
  • virtual QString substringData ( unsignedlongoffset, unsignedlongcount )
  • virtual void appendData ( constQString&arg )
  • virtual void insertData ( unsignedlongoffset, constQString&arg )
  • virtual void deleteData ( unsignedlongoffset, unsignedlongcount )
  • virtual void replaceData ( unsignedlongoffset, unsignedlongcount, constQString&arg )
  • virtual uint length () const
  • virtual QString data () const
  • virtual void setData ( constQString&v )
  • virtual QDomNode::NodeType nodeType () const
  • virtual bool isCharacterData () const

Detailed Description

The QDomCharacterData class represents a generic string in the DOM.

Character data as used in XML specifies a generic data string. More specialized versions of this class are QDomText, QDomComment and QDomCDATASection.

The data string is set with setData() and retrieved with data(). You can retrieve a portion of the data string using substringData(). Extra data can be appended with appendData(), or inserted with insertData(). Portions of the data string can be deleted with deleteData() or replaced with replaceData(). The length of the data string is returned by length().

The node type of the node containing this character data is returned by nodeType().

See also QDomText, QDomComment, QDomCDATASection and XML.


Member Function Documentation

QDomCharacterData::QDomCharacterData ()

Constructs an empty character data object.

QDomCharacterData::QDomCharacterData ( constQDomCharacterData&x )

Constructs a copy of x.

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 cloneNode().

QDomCharacterData::~QDomCharacterData ()

Destroys the object and frees its resources.

void QDomCharacterData::appendData ( constQString&arg ) [virtual]

Appends the string arg, to the stored string.

QString QDomCharacterData::data () const [virtual]

Returns the string stored in this object.

If the node is a null node, it will return a null string.

void QDomCharacterData::deleteData ( unsignedlongoffset, unsignedlongcount ) [virtual]

Deletes a substring of length count from position offset.

void QDomCharacterData::insertData ( unsignedlongoffset, constQString&arg ) [virtual]

Inserts the string arg into the stored string at position offset.

bool QDomCharacterData::isCharacterData () const [virtual]

Returns TRUE.

Reimplemented from QDomNode.

uint QDomCharacterData::length () const [virtual]

Returns the length of the stored string.

QDomNode::NodeType QDomCharacterData::nodeType () const [virtual]

Returns the type of node this object refers to (i.e. TextNode, CDATASectionNode, CommentNode or CharacterDataNode). For a null node CharacterDataNode is returned.

Reimplemented from QDomNode.

Reimplemented in QDomText and QDomComment.

QDomCharacterData& QDomCharacterData::operator= ( constQDomCharacterData&x )

Assigns x to this character data.

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 cloneNode().

void QDomCharacterData::replaceData ( unsignedlongoffset, unsignedlongcount, constQString&arg ) [virtual]

Replaces the substring of length count starting at position offset with the string arg.

void QDomCharacterData::setData ( constQString&v ) [virtual]

Sets the string of this object to v.

QString QDomCharacterData::substringData ( unsignedlongoffset, unsignedlongcount ) [virtual]

Returns the substring of length count from position offset.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文