summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r--src/corelib/text/qstring.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h
index d8d8cd3425..32847e30f6 100644
--- a/src/corelib/text/qstring.h
+++ b/src/corelib/text/qstring.h
@@ -119,6 +119,12 @@ public:
{ return isEmpty() ? -1 : front() == c ? int(size() > 1) : uchar(m_data[0]) - c.unicode(); }
[[nodiscard]] int compare(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::compareStrings(*this, QStringView(&c, 1), cs); }
+ template<bool UseChar8T>
+ [[nodiscard]] int compare(QBasicUtf8StringView<UseChar8T> other,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ {
+ return QtPrivate::compareStrings(*this, other, cs);
+ }
[[nodiscard]] bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
@@ -1230,6 +1236,13 @@ QString QBasicUtf8StringView<UseChar8T>::toString() const
return QString::fromUtf8(data(), size());
}
+template<bool UseChar8T>
+[[nodiscard]] int QBasicUtf8StringView<UseChar8T>::compare(QLatin1StringView other,
+ Qt::CaseSensitivity cs) const noexcept
+{
+ return QtPrivate::compareStrings(*this, other, cs);
+}
+
//
// QAnyStringView inline members that require QString:
//