QUtf8StringView: fix missing inline keywords

This probably wasn't triggering anything, because the class happens to
be a template, but don't let the poor guy that will de-templatize this
come Qt 7 run into this.

Also add the customary "defined in qstring.h" comment.

Found in API-review.

Amends 3d0eaf863edeed9095b35026974a54cc7d418962,
9b945b381a78b56b14d46ec314f0f69264ac0602,
4c931155043af6bbd9c36475fa8d3cb14e65f644 and
b977ae371a753a82e1d0bb32c5b62099da663721.

Change-Id: I45b2a808dca5ea335a1771df9cfeb4e67bd185f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit 183a775f80a029136416c75a66f74e4c099e0d32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-09-04 15:32:26 +02:00 committed by Qt Cherry-pick Bot
parent a87db277ce
commit a5752f4cb4

View File

@ -298,19 +298,21 @@ public:
return QtPrivate::compareStrings(*this, other, cs);
}
[[nodiscard]] int compare(QChar other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
[[nodiscard]] int compare(QStringView other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
[[nodiscard]] int compare(QLatin1StringView other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
[[nodiscard]] int compare(const QByteArray &other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
// all defined in qstring.h
[[nodiscard]] inline int compare(QChar other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
[[nodiscard]] inline int compare(QStringView other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
[[nodiscard]] inline int compare(QLatin1StringView other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
[[nodiscard]] inline int compare(const QByteArray &other,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
[[nodiscard]] bool equal(QChar other) const noexcept;
[[nodiscard]] bool equal(QStringView other) const noexcept;
[[nodiscard]] bool equal(QLatin1StringView other) const noexcept;
[[nodiscard]] bool equal(const QByteArray &other) const noexcept;
[[nodiscard]] inline bool equal(QChar other) const noexcept;
[[nodiscard]] inline bool equal(QStringView other) const noexcept;
[[nodiscard]] inline bool equal(QLatin1StringView other) const noexcept;
[[nodiscard]] inline bool equal(const QByteArray &other) const noexcept;
// end defined in qstring.h
[[nodiscard]] static constexpr qsizetype maxSize() noexcept
{