summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qbytearrayalgorithms.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-08-09 15:19:02 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-08-11 22:32:42 +0200
commit6f833eff92fe703a13214a0c1a593d94e51847d1 (patch)
treec90f1862030c850cfe6b22e47a458c055a16e833 /src/corelib/text/qbytearrayalgorithms.h
parent761f32ae2ad98e8fb12a4f05b45b4aa277e47a1b (diff)
Add QByteArrayView::trimmed()
Unlike simplified(), it just moves the end-points, without needing to modify contents, so it makes sense (as for QStringView and QLatin1String) to provide it. Moved QByteArray's trimmed() tests to tst_QByteArrayApiSymmetry so that QBAV can now share them. [ChangeLog][QtCore][QByteArrayView] Added trimmed(). Change-Id: Ifd7a752adb5f3d3e2ad0aa8220efa7e7d2d39baa Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/text/qbytearrayalgorithms.h')
-rw-r--r--src/corelib/text/qbytearrayalgorithms.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/text/qbytearrayalgorithms.h b/src/corelib/text/qbytearrayalgorithms.h
index be1e6cc953..638af2948b 100644
--- a/src/corelib/text/qbytearrayalgorithms.h
+++ b/src/corelib/text/qbytearrayalgorithms.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -72,6 +72,8 @@ qsizetype count(QByteArrayView haystack, QByteArrayView needle) noexcept;
[[nodiscard]] Q_CORE_EXPORT int compareMemory(QByteArrayView lhs, QByteArrayView rhs);
+[[nodiscard]] Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QByteArrayView trimmed(QByteArrayView s) noexcept;
+
} // namespace QtPrivate
/*****************************************************************************