QCollatorSortKey Class
QCollatorSortKey クラスを使用すると、文字列の照合を高速化できます。詳細...
ヘッダー | #include <QCollatorSortKey> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
- 継承メンバを含む全メンバのリスト
- QCollatorSortKey は、文字列データ用クラスおよび暗黙的に共有されるクラスの一部です。
注釈このクラスの関数はすべてリエントラントです。
パブリック関数
QCollatorSortKey(const QCollatorSortKey &other) | |
(since 6.8) | QCollatorSortKey(QCollatorSortKey &&other) |
~QCollatorSortKey() | |
int | compare(const QCollatorSortKey &otherKey) const |
void | swap(QCollatorSortKey &other) |
QCollatorSortKey & | operator=(QCollatorSortKey &&other) |
QCollatorSortKey & | operator=(const QCollatorSortKey &other) |
関連する非メンバ
bool | operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs) |
詳細説明
QCollatorSortKey クラスは、常にQCollator::sortKey() によって作成され、多数の文字列を照合する場合など、高速な文字列照合に使用されます。
QCollator 、QCollator::sortKey()、compare()も参照してください 。
メンバ関数のドキュメント
QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)
other コレーターキーのコピーを作成する。
[noexcept, since 6.8]
QCollatorSortKey::QCollatorSortKey(QCollatorSortKey &&other)
移動 -other から新しい QCollatorSortKey を構築します。
注意: 移動元のオブジェクトother は部分的に形成された状態に置かれます。この状態では、有効な操作は破棄と新しい値の割り当てのみです。
この関数は Qt 6.8 で導入されました。
[noexcept]
QCollatorSortKey::~QCollatorSortKey()
コレーターキーを破壊する。
int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
このキーと同じQCollator の sortKey() で作成されたotherKey と比較する。比較はQCollator のソート順に従って行われる。
このキーがotherKey より前にソートされている場合は負の値を、 2 つのキーが等しい場合は 0 を、otherKey より後にソートされている場合は正の値を返す。
operator<()も参照のこと 。
[noexcept]
void QCollatorSortKey::swap(QCollatorSortKey &other)
このコレーター・キーをother と交換する。この操作は非常に速く、失敗することはない。
[noexcept]
QCollatorSortKey &QCollatorSortKey::operator=(QCollatorSortKey &&other)
Move-assignother をこのQCollatorSortKey インスタンスに割り当てる。
注: 移動元のオブジェクトother は、部分的に形成された状態に置かれる。この状態では、有効な操作は破壊と新しい値の割り当てのみである。
QCollatorSortKey &QCollatorSortKey::operator=(const QCollatorSortKey &other)
このコレーターキーにother を割り当てる。
関連する非会員
bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
どちらのキーも、同じQCollator の sortKey()によって作成されたものでなければならない。lhs が、それらを作成したQCollator に従ってrhs よりも先にソートされるべきであればtrue
を返し、そうでなければfalse
を返す。
QCollatorSortKey::compare()も参照のこと 。
© 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.