diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-07-27 12:30:08 +0300 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-07-29 21:07:17 +0300 |
commit | 353a6946b19c5e4ee54cc37e4b34685cacd77a3c (patch) | |
tree | 5eed1498f56aacd7f59298f1289edad5f43bc55c /src/corelib/text | |
parent | 4628351c3f53e3239e304b906a0f6f9a6daab985 (diff) |
qstringalgorithms.h: add pure, noexcept, constexpr
... where they were missing.
Change-Id: I58c32e57675b5d5ee500722933ef4a356a679e46
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r-- | src/corelib/text/qstring.cpp | 2 | ||||
-rw-r--r-- | src/corelib/text/qstring.h | 2 | ||||
-rw-r--r-- | src/corelib/text/qstringalgorithms.h | 11 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 44c6582d63..375843e36e 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -11438,7 +11438,7 @@ bool QStringRef::isRightToLeft() const \sa QString::isRightToLeft() */ -bool QtPrivate::isRightToLeft(QStringView string) +bool QtPrivate::isRightToLeft(QStringView string) noexcept { const ushort *p = reinterpret_cast<const ushort*>(string.data()); const ushort * const end = p + string.size(); diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 06ebb05fc7..88286b902a 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -235,7 +235,7 @@ QT_DEPRECATED_X("Use QLatin1String") typedef QLatin1String QLatin1Literal; // // QLatin1String inline implementations // -inline bool QtPrivate::isLatin1(QLatin1String) noexcept +Q_DECL_CONSTEXPR bool QtPrivate::isLatin1(QLatin1String) noexcept { return true; } // diff --git a/src/corelib/text/qstringalgorithms.h b/src/corelib/text/qstringalgorithms.h index 2b480b1e4c..d54e376aa9 100644 --- a/src/corelib/text/qstringalgorithms.h +++ b/src/corelib/text/qstringalgorithms.h @@ -92,12 +92,13 @@ Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLatin1(QStringView str); Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToUtf8(QStringView str); Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLocal8Bit(QStringView str); Q_REQUIRED_RESULT Q_CORE_EXPORT QVector<uint> convertToUcs4(QStringView str); -Q_REQUIRED_RESULT Q_CORE_EXPORT bool isRightToLeft(QStringView string); -Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QLatin1String s) noexcept; -Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QStringView s) noexcept; -Q_REQUIRED_RESULT bool isLatin1(QLatin1String s) noexcept; // in qstring.h -Q_REQUIRED_RESULT Q_CORE_EXPORT bool isLatin1(QStringView s) noexcept; +Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isRightToLeft(QStringView string) noexcept; + +Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QLatin1String s) noexcept; +Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QStringView s) noexcept; +Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline bool isLatin1(QLatin1String s) noexcept; +Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isLatin1(QStringView s) noexcept; } // namespace QtPRivate |