From 615a9cf99150cfee34c14cfed0aa9583f5993934 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 9 Jun 2020 12:02:57 +0200 Subject: QUuid: port to QAnyStringView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the QString/QStringView/QLatin1String/const char* overloads from the API, but not the ABI. As a drive-by, replace a use of QStringView::left() by truncate(), as suggested by a comment. [ChangeLog][QtCore][QUuid] The from-string constructor and the fromString() function now take QAnyStringView (was: overload set with a subset of QString, QByteArray, const char*, QLatin1String, QStringView each). Change-Id: If7fa26cfbef9280480c78b669d9f5f14118995ed Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- src/corelib/compat/removed_api.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/corelib/compat') diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index d5d71ce75a..b2e758d2ca 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -59,6 +59,31 @@ QByteArray QCryptographicHash::hash(const QByteArray &data, Algorithm method) #include "quuid.h" +QUuid::QUuid(const QString &text) + : QUuid{qToAnyStringViewIgnoringNull(text)} +{ +} + +QUuid::QUuid(const char *text) + : QUuid{QAnyStringView(text)} +{ +} + +QUuid::QUuid(const QByteArray &text) + : QUuid{qToAnyStringViewIgnoringNull(text)} +{ +} + +QUuid QUuid::fromString(QStringView string) noexcept +{ + return fromString(QAnyStringView{string}); +} + +QUuid QUuid::fromString(QLatin1String string) noexcept +{ + return fromString(QAnyStringView{string}); +} + QUuid QUuid::fromRfc4122(const QByteArray &bytes) { return fromRfc4122(qToByteArrayViewIgnoringNull(bytes)); -- cgit v1.2.3