Remove more QStringRef overloads that aren't required

The QStringView versions will do the job just fine :)

Task-number: QTBUG-84319
Change-Id: I376b310deb27683fd98bbcc55e0f56014cacecc3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This commit is contained in:
Lars Knoll 2020-05-22 14:24:01 +02:00
parent 8ea11e0cf7
commit 39e229fe13
8 changed files with 0 additions and 273 deletions

View File

@ -633,20 +633,6 @@ QDebug &QDebug::resetFormat()
\snippet code/src_corelib_io_qdebug.cpp 0
*/
/*!
\fn QDebug &QDebug::operator<<(const QStringRef &t)
Writes the string, \a t, to the stream and returns a reference to the
stream. Normally, QDebug prints the string inside quotes and transforms
non-printable characters to their Unicode values (\\u1234).
To print non-printable characters without transformation, enable the
noquote() functionality. Note that some QDebug backends might not be 8-bit
clean.
See the QString overload for examples.
*/
/*!
\since 5.10
\fn QDebug &QDebug::operator<<(QStringView s)

View File

@ -158,7 +158,6 @@ public:
inline QDebug &operator<<(const char* t) { stream->ts << QString::fromUtf8(t); return maybeSpace(); }
#if QT_STRINGVIEW_LEVEL < 2
inline QDebug &operator<<(const QString & t) { putString(t.constData(), uint(t.length())); return maybeSpace(); }
inline QDebug &operator<<(const QStringRef & t) { putString(t.constData(), uint(t.length())); return maybeSpace(); }
#endif
inline QDebug &operator<<(QStringView s) { putString(s.data(), size_t(s.size())); return maybeSpace(); }
inline QDebug &operator<<(QLatin1String t) { putByteArray(t.latin1(), t.size(), ContainsLatin1); return maybeSpace(); }

View File

@ -2541,21 +2541,6 @@ QTextStream &QTextStream::operator<<(QLatin1String string)
return *this;
}
/*!
\since 5.6
\overload
Writes \a string to the stream, and returns a reference to the
QTextStream.
*/
QTextStream &QTextStream::operator<<(const QStringRef &string)
{
Q_D(QTextStream);
CHECK_VALID_STREAM(*this);
d->putString(string.data(), string.size());
return *this;
}
/*!
\overload

View File

@ -180,7 +180,6 @@ public:
QTextStream &operator<<(const QString &s);
QTextStream &operator<<(QStringView s);
QTextStream &operator<<(QLatin1String s);
QTextStream &operator<<(const QStringRef &s);
QTextStream &operator<<(const QByteArray &array);
QTextStream &operator<<(const char *c);
QTextStream &operator<<(const void *ptr);

View File

@ -326,19 +326,6 @@ int QCollator::compare(const QString &s1, const QString &s2) const
return compare(QStringView(s1), QStringView(s2));
}
/*!
\overload
Compares \a s1 with \a s2.
Returns an integer less than, equal to, or greater than zero depending on
whether \a s1 sorts before, with or after \a s2.
*/
int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
{
return compare(QStringView(s1), QStringView(s2));
}
/*!
\overload

View File

@ -108,7 +108,6 @@ public:
#if QT_STRINGVIEW_LEVEL < 2
int compare(const QString &s1, const QString &s2) const;
int compare(const QStringRef &s1, const QStringRef &s2) const;
int compare(const QChar *s1, int len1, const QChar *s2, int len2) const;
bool operator()(const QString &s1, const QString &s2) const

View File

@ -1582,223 +1582,6 @@ double QLocale::toDouble(const QString &s, bool *ok) const
{
return d->m_data->stringToDouble(s, ok, d->m_numberOptions);
}
/*!
Returns the short int represented by the localized string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toUShort(), toString()
\since 5.1
*/
short QLocale::toShort(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<short>(d, s, ok);
}
/*!
Returns the unsigned short int represented by the localized string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toShort(), toString()
\since 5.1
*/
ushort QLocale::toUShort(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<ushort>(d, s, ok);
}
/*!
Returns the int represented by the localized string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toUInt(), toString()
\since 5.1
*/
int QLocale::toInt(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<int>(d, s, ok);
}
/*!
Returns the unsigned int represented by the localized string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toInt(), toString()
\since 5.1
*/
uint QLocale::toUInt(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<uint>(d, s, ok);
}
/*!
Returns the long int represented by the localized string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toInt(), toULong(), toDouble(), toString()
\since 5.13
*/
long QLocale::toLong(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<long>(d, s, ok);
}
/*!
Returns the unsigned long int represented by the localized
string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toLong(), toInt(), toDouble(), toString()
\since 5.13
*/
ulong QLocale::toULong(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<ulong>(d, s, ok);
}
/*!
Returns the long long int represented by the localized string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toInt(), toULongLong(), toDouble(), toString()
\since 5.1
*/
qlonglong QLocale::toLongLong(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<qlonglong>(d, s, ok);
}
/*!
Returns the unsigned long long int represented by the localized
string \a s.
If the conversion fails the function returns 0.
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function ignores leading and trailing whitespace.
\sa toLongLong(), toInt(), toDouble(), toString()
\since 5.1
*/
qulonglong QLocale::toULongLong(const QStringRef &s, bool *ok) const
{
return toIntegral_helper<qulonglong>(d, s, ok);
}
/*!
Returns the float represented by the localized string \a s.
Returns an infinity if the conversion overflows or 0.0 if the
conversion fails for any other reason (e.g. underflow).
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function does not fall back to the 'C' locale if the string
cannot be interpreted in this locale.
This function ignores leading and trailing whitespace.
\sa toDouble(), toInt(), toString()
\since 5.1
*/
float QLocale::toFloat(const QStringRef &s, bool *ok) const
{
return QLocaleData::convertDoubleToFloat(toDouble(s, ok), ok);
}
/*!
Returns the double represented by the localized string \a s.
Returns an infinity if the conversion overflows or 0.0 if the
conversion fails for any other reason (e.g. underflow).
If \a ok is not \nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
This function does not fall back to the 'C' locale if the string
cannot be interpreted in this locale.
\snippet code/src_corelib_text_qlocale.cpp 3
Notice that the last conversion returns 1234.0, because '.' is the
thousands group separator in the German locale.
This function ignores leading and trailing whitespace.
\sa toFloat(), toInt(), toString()
\since 5.1
*/
double QLocale::toDouble(const QStringRef &s, bool *ok) const
{
return d->m_data->stringToDouble(s, ok, d->m_numberOptions);
}
#endif // QT_STRINGVIEW_LEVEL < 2
/*!

View File

@ -971,17 +971,6 @@ public:
qulonglong toULongLong(const QString &s, bool *ok = nullptr) const;
float toFloat(const QString &s, bool *ok = nullptr) const;
double toDouble(const QString &s, bool *ok = nullptr) const;
short toShort(const QStringRef &s, bool *ok = nullptr) const;
ushort toUShort(const QStringRef &s, bool *ok = nullptr) const;
int toInt(const QStringRef &s, bool *ok = nullptr) const;
uint toUInt(const QStringRef &s, bool *ok = nullptr) const;
long toLong(const QStringRef &s, bool *ok = nullptr) const;
ulong toULong(const QStringRef &s, bool *ok = nullptr) const;
qlonglong toLongLong(const QStringRef &s, bool *ok = nullptr) const;
qulonglong toULongLong(const QStringRef &s, bool *ok = nullptr) const;
float toFloat(const QStringRef &s, bool *ok = nullptr) const;
double toDouble(const QStringRef &s, bool *ok = nullptr) const;
#endif
short toShort(QStringView s, bool *ok = nullptr) const;