summaryrefslogtreecommitdiffstats
path: root/src/core5/text
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-07-18 10:18:52 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-07-18 19:37:47 +0200
commit5291c70cd45bdaf013ac3c02032a55afe7210fe2 (patch)
tree1e2cba15472ab3eeefc6bc1bc301aa30dc632d39 /src/core5/text
parent23563e42e6247ce9c45a804085f181dcf0b5ddc3 (diff)
Eradicate QT_STRINGVIEW_LEVEL uses
It's not used and not useful. Task-number: QTBUG-100861 Pick-to: 6.4 6.3 6.2 Change-Id: Ibbb609af4bcaf504d1cbc799328d01f7c3821101 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/core5/text')
-rw-r--r--src/core5/text/qstringref.cpp8
-rw-r--r--src/core5/text/qstringref.h14
2 files changed, 0 insertions, 22 deletions
diff --git a/src/core5/text/qstringref.cpp b/src/core5/text/qstringref.cpp
index c4a6121..288372a 100644
--- a/src/core5/text/qstringref.cpp
+++ b/src/core5/text/qstringref.cpp
@@ -1164,7 +1164,6 @@ QStringRef QStringRef::mid(int pos, int n) const
\sa QString::chop(), truncate()
*/
-#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
@@ -1185,7 +1184,6 @@ int QStringRef::indexOf(const QString &str, int from, Qt::CaseSensitivity cs) co
// ### Qt6: qsizetype
return int(QtPrivate::findString(QStringView(unicode(), length()), from, QStringView(str.unicode(), str.length()), cs));
}
-#endif // QT_STRINGVIEW_LEVEL < 2
/*!
\fn int QStringRef::indexOf(QStringView str, int from, Qt::CaseSensitivity cs) const
@@ -1242,7 +1240,6 @@ int QStringRef::indexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) con
return int(QtPrivate::findString(QStringView(unicode(), size()), from, str, cs));
}
-#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
@@ -1262,7 +1259,6 @@ int QStringRef::indexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs)
// ### Qt6: qsizetype
return int(QtPrivate::findString(QStringView(unicode(), size()), from, QStringView(str.unicode(), str.size()), cs));
}
-#endif // QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
@@ -1541,7 +1537,6 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
return qt_ends_with(*this, str, cs);
}
-#if QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\since 4.8
@@ -1553,7 +1548,6 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
\sa indexOf(), count()
*/
-#endif // QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
@@ -1568,7 +1562,6 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
*/
-#if QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\overload contains()
\since 4.8
@@ -1581,7 +1574,6 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
\sa indexOf(), count()
*/
-#endif // QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(QLatin1String str, Qt::CaseSensitivity cs) const
\since 4.8
diff --git a/src/core5/text/qstringref.h b/src/core5/text/qstringref.h
index d6d5194..de85b97 100644
--- a/src/core5/text/qstringref.h
+++ b/src/core5/text/qstringref.h
@@ -55,27 +55,21 @@ public:
inline int count() const { return m_size; }
inline int length() const { return m_size; }
-#if QT_STRINGVIEW_LEVEL < 2
int indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(const QStringRef &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#endif
Q_REQUIRED_RESULT int indexOf(QStringView s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return int(QtPrivate::findString(*this, from, s, cs)); } // ### Qt6: qsizetype
int indexOf(QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#if QT_STRINGVIEW_LEVEL < 2
int lastIndexOf(const QStringRef &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QString &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#endif
int lastIndexOf(QChar ch, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(QLatin1String str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
Q_REQUIRED_RESULT int lastIndexOf(QStringView s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return int(QtPrivate::lastIndexOf(*this, from, s, cs)); } // ### Qt6: qsizetype
-#if QT_STRINGVIEW_LEVEL < 2
inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline bool contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#endif
inline bool contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
@@ -112,19 +106,15 @@ public:
{ return QtPrivate::startsWith(*this, s, cs); }
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#if QT_STRINGVIEW_LEVEL < 2
bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#endif
Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#if QT_STRINGVIEW_LEVEL < 2
bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
-#endif
inline operator QStringView() const {
if (!m_string)
@@ -247,12 +237,10 @@ namespace Tok {
} // namespace Tok
} // namespace QtPrivate
-#if QT_STRINGVIEW_LEVEL < 2
inline Q_DECL_PURE_FUNCTION size_t qHash(const QStringRef &key, size_t seed = 0) noexcept
{
return qHash(QStringView { key }, seed);
}
-#endif
QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(QStringRef)
inline QStringRef &QStringRef::operator=(const QString *aString)
@@ -391,12 +379,10 @@ inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QString &s
inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef &s2)
{ return QString::localeAwareCompare(QStringView{ s1 }, QStringView{ s2 }); }
-#if QT_STRINGVIEW_LEVEL < 2
inline bool QStringRef::contains(const QString &s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
inline bool QStringRef::contains(const QStringRef &s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
-#endif
inline bool QStringRef::contains(QLatin1String s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
inline bool QStringRef::contains(QChar c, Qt::CaseSensitivity cs) const