QDomCharacterData Class
QDomCharacterData クラスは、DOM 内の一般的な文字列を表します。詳細...
ヘッダー | #include <QDomCharacterData> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Xml) target_link_libraries(mytarget PRIVATE Qt6::Xml) |
qmake: | QT += xml |
を継承する: | QDomNode |
によって継承される: |
- 継承メンバを含むすべてのメンバの一覧
- QDomCharacterDataはXMLクラスの一部です。
注意:このクラスのすべての関数はリエントラントです。
パブリック関数
QDomCharacterData() | |
QDomCharacterData(const QDomCharacterData &characterData) | |
void | appendData(const QString &arg) |
QString | data() const |
void | deleteData(unsigned long offset, unsigned long count) |
void | insertData(unsigned long offset, const QString &arg) |
int | length() const |
QDomNode::NodeType | nodeType() const |
void | replaceData(unsigned long offset, unsigned long count, const QString &arg) |
void | setData(const QString &data) |
QString | substringData(unsigned long offset, unsigned long count) |
QDomCharacterData & | operator=(const QDomCharacterData &other) |
詳細説明
XMLで使用される文字データは、一般的なデータ文字列を指定します。このクラスのより特殊なバージョンはQDomText 、QDomComment 、QDomCDATASection です。
データ文字列はsetData() で設定し、data() で取得します。データ文字列の一部を取得するには、substringData() を使用します。追加データは、appendData ( )で追加でき、insertData ( )で挿入できる。データ文字列の一部を削除するにはdeleteData() を、置換するにはreplaceData() を使用する。データ文字列の長さは、length() で返される。
この文字データを含むノードのノード・タイプは、nodeType() で返されます。
QDomText 、QDomComment 、およびQDomCDATASectionも参照のこと 。
メンバ関数ドキュメント
QDomCharacterData::QDomCharacterData()
空の文字データ・オブジェクトを構築します。
QDomCharacterData::QDomCharacterData(const QDomCharacterData &characterData)
characterData のコピーを構築する。
コピーのデータは共有されます(シャローコピー):一方のノードを変更すると、もう一方のノードも変更されます。深いコピーを作成したい場合は、cloneNode() を使用します。
void QDomCharacterData::appendData(const QString &arg)
格納されている文字列に文字列arg を追加する。
QString QDomCharacterData::data() const
このオブジェクトに格納されている文字列を返す。
ノードがnull node の場合、空の文字列を返します。
setData()も参照してください 。
void QDomCharacterData::deleteData(unsigned long offset, unsigned long count)
位置offset から長さcount の部分文字列を削除する。
void QDomCharacterData::insertData(unsigned long offset, const QString &arg)
文字列arg を、格納されている文字列の位置offset に挿入する。
int QDomCharacterData::length() const
格納されている文字列の長さを返します。
QDomNode::NodeType QDomCharacterData::nodeType() const
このオブジェクトが参照するノードのタイプを返す(すなわちTextNode
,CDATASectionNode
,CommentNode
またはCharacterDataNode
)。null node の場合、CharacterDataNode
を返します。
void QDomCharacterData::replaceData(unsigned long offset, unsigned long count, const QString &arg)
位置offset から始まる長さcount の部分文字列を、文字列arg で置き換える。
void QDomCharacterData::setData(const QString &data)
このオブジェクトの文字列をdata に設定する。
data()も参照 。
QString QDomCharacterData::substringData(unsigned long offset, unsigned long count)
位置offset から長さcount の部分文字列を返す。
QDomCharacterData &QDomCharacterData::operator=(const QDomCharacterData &other)
この文字データにother を割り当てる。
コピーのデータは共有される(浅いコピー):一方のノードを変更すると、もう一方のノードも変更される。ディープ・コピーを作成したい場合は、cloneNode ()を使用する。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.