QXmlAttributes Class
QXmlAttributes クラスは、XML 属性を提供します。詳細...
ヘッダ | #include <QXmlAttributes> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core5Compat) target_link_libraries(mytarget PRIVATE Qt6::Core5Compat) |
qmake: | QT += core5compat |
注意:このクラスの関数はすべてリエントラントです。
パブリック関数
QXmlAttributes() | |
virtual | ~QXmlAttributes() |
void | append(const QString &qName, const QString &uri, const QString &localPart, const QString &value) |
void | clear() |
int | count() const |
int | index(const QString &qName) const |
int | index(QLatin1String qName) const |
int | index(const QString &uri, const QString &localPart) const |
int | length() const |
QString | localName(int index) const |
QString | qName(int index) const |
void | swap(QXmlAttributes &other) |
QString | type(int index) const |
QString | type(const QString &qName) const |
QString | type(const QString &uri, const QString &localName) const |
QString | uri(int index) const |
QString | value(int index) const |
QString | value(QLatin1String qName) const |
QString | value(const QString &qName) const |
QString | value(const QString &uri, const QString &localName) const |
詳細説明
属性がQXmlContentHandler::startElement() によって報告される場合、このクラスは属性値を渡すために使用されます。
リスト内の属性の位置を特定するにはindex() を使用し、属性の数を取得するにはcount() を使用し、属性を削除するにはclear() を使用します。新しい属性を追加するにはappend() を使用する。属性のタイプを取得するにはtype() を、値を取得するにはvalue() を使用する。属性の名前はlocalName() またはqName() から、名前空間 URI はuri() から取得できます。
メンバ関数のドキュメント
QXmlAttributes::QXmlAttributes()
空の属性リストを作成します。
[virtual noexcept]
QXmlAttributes::~QXmlAttributes()
属性オブジェクトを破棄します。
void QXmlAttributes::append(const QString &qName, const QString &uri, const QString &localPart, const QString &value)
属性のリストに新しい属性エントリを追加する。属性の修飾名はqName で、名前空間URIはuri で、ローカル名はlocalPart です。属性の値はvalue です。
qName()、uri()、localName()、value()も参照 。
void QXmlAttributes::clear()
属性のリストをクリアします。
append()も参照 。
int QXmlAttributes::count() const
リストに含まれる属性の数を返す。この関数はlength() と同じです。
int QXmlAttributes::index(const QString &qName) const
qName という修飾名で属性のインデックスを検索します。
属性のインデックスを返すか、見つからなかった場合は -1 を返します。
int QXmlAttributes::index(QLatin1String qName) const
これはオーバーロードされた関数である。
int QXmlAttributes::index(const QString &uri, const QString &localPart) const
これはオーバーロードされた関数である。
名前空間名で属性のインデックスを検索します。
uri は名前空間 URI を指定し、名前空間 URI がない場合は空文字列を指定します。 は属性のローカル名を指定します。localPart
属性のインデックスを返し、見つからなかった場合は -1 を返します。
int QXmlAttributes::length() const
リスト内の属性の数を返します。
count()も参照 。
QString QXmlAttributes::localName(int index) const
位置index にある属性のローカル名を検索します。名前空間処理が行われない場合、ローカル名は空文字列になります。
QString QXmlAttributes::qName(int index) const
位置index にある属性の XML 1.0 修飾名を検索します。
[noexcept]
void QXmlAttributes::swap(QXmlAttributes &other)
this
をother と交換する。
QString QXmlAttributes::type(int index) const
位置index にある属性のタイプを検索します。
現在のところ、"CDATA "だけが返されます。
QString QXmlAttributes::type(const QString &qName) const
これはオーバーロードされた関数です。
修飾名qName に対して属性の型を検索します。
現在のところ、"CDATA "だけが返されます。
QString QXmlAttributes::type(const QString &uri, const QString &localName) const
これはオーバーロードされた関数です。
名前空間名によって属性の型を検索します。
uri は名前空間 URI を指定し、 はローカル名を指定します。名前空間 URI がない場合は、 に空の文字列を使用します。localName uri
現在は "CDATA" だけが返されます。
QString QXmlAttributes::uri(int index) const
位置index にある属性の名前空間 URI を検索します。名前空間処理が行われないか、属性に名前空間がない場合、名前空間URIは空文字列になります。
QString QXmlAttributes::value(int index) const
位置index にある属性の値を返す。インデックスは有効な位置でなければならない(すなわち、0 <=index <count())。
QString QXmlAttributes::value(QLatin1String qName) const
これはオーバーロードされた関数です。
qName指定された名前に対応する属性が存在しない場合は空文字列を返します。
QString QXmlAttributes::value(const QString &qName) const
これはオーバーロードされた関数です。
qName指定された名前に対応する属性が存在しない場合は空文字列を返します。
QString QXmlAttributes::value(const QString &uri, const QString &localName) const
これはオーバーロードされた関数です。
名前空間名によって属性の値を返します。
uri localName は属性のローカル名を指定します。
© 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.