diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2024-02-20 15:06:16 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2024-03-02 00:12:53 +0100 |
commit | 3d0eaf863edeed9095b35026974a54cc7d418962 (patch) | |
tree | 5cd846ac57ff7a139fdb3e6fcf81da1eb0b867ad /src/corelib/text/qstring.h | |
parent | e2e21bcb2d1053e8a6477b99a60c41774b115c23 (diff) |
Add missing QUtf8StringView relational operators
Add QU8SV vs QSV, QU8SV vs QChar, and QU8SV vs char16_t relational
operators.
This allows to get rid of the dummy relational operators in
tst_qstringapisymmetry.
Task-number: QTBUG-117661
Change-Id: If95d7418efd13c505ed0e3bef748b86ff55e623a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r-- | src/corelib/text/qstring.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 6616bf5fe8..e2a6605861 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -1142,11 +1142,28 @@ ushort QStringView::toUShort(bool *ok, int base) const // template <bool UseChar8T> +int QBasicUtf8StringView<UseChar8T>::compare(QChar other, Qt::CaseSensitivity cs) const noexcept +{ + return QtPrivate::compareStrings(*this, QStringView(&other, 1), cs); +} + +template <bool UseChar8T> int QBasicUtf8StringView<UseChar8T>::compare(QStringView other, Qt::CaseSensitivity cs) const noexcept { return QtPrivate::compareStrings(*this, other, cs); } +template <bool UseChar8T> +[[nodiscard]] bool QBasicUtf8StringView<UseChar8T>::equal(QChar other) const noexcept +{ + return QtPrivate::equalStrings(*this, QStringView(&other, 1)); +} + +template <bool UseChar8T> +[[nodiscard]] bool QBasicUtf8StringView<UseChar8T>::equal(QStringView other) const noexcept +{ + return QtPrivate::equalStrings(*this, other); +} // // QUtf8StringView inline members that require QString, QL1SV or QBA: |