diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-24 08:53:55 +0000 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-25 11:59:02 +0000 |
commit | 1f118a54f8c5518328d7492c86ed1fc9b2a6ebcd (patch) | |
tree | c37660b49ffeb5467802c28db051ed1e9874c67c /src | |
parent | c532a576708254e725bf87e3b4f74d29749e709a (diff) |
Revert "QLatin1String: Add overloads taking QLatin1Char"
This reverts commit 1c164ec7f21a78025475c561a70b94d1e3dd6bb6,
except for the test additions.
Reason for revert: We need to optimize the implementation, not
complicate the API.
Found during the 6.3 API review.
Pick-to: 6.3
Change-Id: I91c3f65ed6d1fc438deb0e028d578a07c0005362
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/text/qstring.cpp | 31 | ||||
-rw-r--r-- | src/corelib/text/qstring.h | 14 |
2 files changed, 0 insertions, 45 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 437b31089d..8fd9dc96cf 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -9301,12 +9301,6 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) \sa operator==(), operator<(), operator>() */ -/*! - \fn int QLatin1String::compare(QLatin1Char ch, Qt::CaseSensitivity cs) const - \since 6.3 - \overload -*/ - /*! \fn bool QLatin1String::startsWith(QStringView str, Qt::CaseSensitivity cs) const @@ -9329,12 +9323,6 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) */ /*! - \fn bool QLatin1String::startsWith(QLatin1Char ch, Qt::CaseSensitivity cs) const - \since 6.3 - \overload -*/ - -/*! \fn bool QLatin1String::endsWith(QStringView str, Qt::CaseSensitivity cs) const \since 5.10 \fn bool QLatin1String::endsWith(QLatin1String l1, Qt::CaseSensitivity cs) const @@ -9355,12 +9343,6 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) */ /*! - \fn bool QLatin1String::endsWith(QLatin1Char ch, Qt::CaseSensitivity cs) const - \since 6.3 - \overload -*/ - -/*! \fn qsizetype QLatin1String::indexOf(QStringView str, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const \fn qsizetype QLatin1String::indexOf(QLatin1String l1, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const \fn qsizetype QLatin1String::indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const @@ -9381,12 +9363,6 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) */ /*! - \fn qsizetype QLatin1String::indexOf(QLatin1Char ch, qsizetype from, Qt::CaseSensitivity cs) const - \since 6.3 - \overload -*/ - -/*! \fn bool QLatin1String::contains(QStringView str, Qt::CaseSensitivity cs) const \fn bool QLatin1String::contains(QLatin1String l1, Qt::CaseSensitivity cs) const \fn bool QLatin1String::contains(QChar c, Qt::CaseSensitivity cs) const @@ -9404,12 +9380,6 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) */ /*! - \fn bool QLatin1String::contains(QLatin1Char ch, Qt::CaseSensitivity cs) const - \since 6.3 - \overload -*/ - -/*! \fn qsizetype QLatin1String::lastIndexOf(QStringView str, qsizetype from, Qt::CaseSensitivity cs) const \fn qsizetype QLatin1String::lastIndexOf(QLatin1String l1, qsizetype from, Qt::CaseSensitivity cs) const \fn qsizetype QLatin1String::lastIndexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs) const @@ -9454,7 +9424,6 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size) /*! \fn qsizetype QLatin1String::lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const - \fn qsizetype QLatin1String::lastIndexOf(QLatin1Char ch, qsizetype from, Qt::CaseSensitivity cs) const \since 6.3 \overload */ diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index e886f1182b..8eb0dd630f 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -118,8 +118,6 @@ 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); } - [[nodiscard]] int compare(QLatin1Char c, Qt::CaseSensitivity cs) const noexcept - { char ch = c.toLatin1(); return QtPrivate::compareStrings(*this, QLatin1String(&ch, 1), cs); } [[nodiscard]] bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return QtPrivate::startsWith(*this, s, cs); } @@ -129,8 +127,6 @@ public: { return !isEmpty() && front() == c; } [[nodiscard]] inline bool startsWith(QChar c, Qt::CaseSensitivity cs) const noexcept { return QtPrivate::startsWith(*this, QStringView(&c, 1), cs); } - [[nodiscard]] inline bool startsWith(QLatin1Char c, Qt::CaseSensitivity cs) const noexcept - { char ch = c.toLatin1(); return QtPrivate::startsWith(*this, QLatin1String(&ch, 1), cs); } [[nodiscard]] bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return QtPrivate::endsWith(*this, s, cs); } @@ -140,8 +136,6 @@ public: { return !isEmpty() && back() == c; } [[nodiscard]] inline bool endsWith(QChar c, Qt::CaseSensitivity cs) const noexcept { return QtPrivate::endsWith(*this, QStringView(&c, 1), cs); } - [[nodiscard]] inline bool endsWith(QLatin1Char c, Qt::CaseSensitivity cs) const noexcept - { char ch = c.toLatin1(); return QtPrivate::endsWith(*this, QLatin1String(&ch, 1), cs); } [[nodiscard]] qsizetype indexOf(QStringView s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return QtPrivate::findString(*this, from, s, cs); } @@ -149,8 +143,6 @@ public: { return QtPrivate::findString(*this, from, s, cs); } [[nodiscard]] qsizetype indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return QtPrivate::findString(*this, from, QStringView(&c, 1), cs); } - [[nodiscard]] qsizetype indexOf(QLatin1Char c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept - { char ch = c.toLatin1(); return QtPrivate::findString(*this, from, QLatin1String(&ch, 1), cs); } [[nodiscard]] bool contains(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return indexOf(s, 0, cs) != -1; } @@ -158,8 +150,6 @@ public: { return indexOf(s, 0, cs) != -1; } [[nodiscard]] inline bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return indexOf(QStringView(&c, 1), 0, cs) != -1; } - [[nodiscard]] inline bool contains(QLatin1Char c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept - { char ch = c.toLatin1(); return indexOf(QLatin1String(&ch, 1), 0, cs) != -1; } [[nodiscard]] qsizetype lastIndexOf(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return lastIndexOf(s, size(), cs); } @@ -173,10 +163,6 @@ public: { return lastIndexOf(c, -1, cs); } [[nodiscard]] qsizetype lastIndexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return QtPrivate::lastIndexOf(*this, from, QStringView(&c, 1), cs); } - [[nodiscard]] qsizetype lastIndexOf(QLatin1Char c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept - { return lastIndexOf(c, -1, cs); } - [[nodiscard]] qsizetype lastIndexOf(QLatin1Char c, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept - { char ch = c.toLatin1(); return QtPrivate::lastIndexOf(*this, from, QLatin1String(&ch, 1), cs); } using value_type = const char; using reference = value_type&; |