From 39e229fe13a2112dcc5d033f4535fd019aab800b Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 22 May 2020 14:24:01 +0200 Subject: 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 --- src/corelib/text/qlocale.cpp | 217 ------------------------------------------- 1 file changed, 217 deletions(-) (limited to 'src/corelib/text/qlocale.cpp') diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index a2cf2caec0..8217641aa3 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -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(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(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(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(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(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(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(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(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 /*! -- cgit v1.2.3