summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qbytearrayview.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qbytearrayview.qdoc')
-rw-r--r--src/corelib/text/qbytearrayview.qdoc40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/corelib/text/qbytearrayview.qdoc b/src/corelib/text/qbytearrayview.qdoc
index 48013f8661..eb890917eb 100644
--- a/src/corelib/text/qbytearrayview.qdoc
+++ b/src/corelib/text/qbytearrayview.qdoc
@@ -14,6 +14,15 @@
\reentrant
+ \compares strong
+ \compareswith strong QByteArray {const char *}
+ \endcompareswith
+ \compareswith strong QString QStringView QUtf8StringView QLatin1StringView \
+ QChar char16_t
+ When comparing with string and Unicode character types, the content is
+ interpreted as UTF-8.
+ \endcompareswith
+
A QByteArrayView references a contiguous portion of raw bytes it does
not own. It acts as an interface type to all kinds of byte-array-like data,
without the need to construct a QByteArray first.
@@ -184,7 +193,7 @@
*/
/*!
- \fn template <typename Byte> QByteArrayView::QByteArrayView(const Byte *data, qsizetype len)
+ \fn template <typename Byte, QByteArrayView::if_compatible_byte<Byte> = true> QByteArrayView::QByteArrayView(const Byte *data, qsizetype len)
Constructs a byte array view on \a data with length \a len.
@@ -202,7 +211,7 @@
*/
/*!
- \fn template <typename Byte> QByteArrayView::QByteArrayView(const Byte *first, const Byte *last)
+ \fn template <typename Byte, QByteArrayView::if_compatible_byte<Byte> = true> QByteArrayView::QByteArrayView(const Byte *first, const Byte *last)
Constructs a byte array view on \a first with length (\a last - \a first).
@@ -270,7 +279,7 @@
*/
/*!
- \fn template <typename Container> QByteArrayView::QByteArrayView(const Container &c)
+ \fn template <typename Container, QByteArrayView::if_compatible_container<Container> = true> QByteArrayView::QByteArrayView(const Container &c)
Constructs a byte array view on the array-like container \a c. The length and data
are set via \c{std::size(c)} and \c{std::data(c)} respectively.
@@ -332,12 +341,12 @@
*/
/*! //! friend
- \fn int QByteArrayView::operator==(QByteArrayView lhs, QByteArrayView rhs)
- \fn int QByteArrayView::operator!=(QByteArrayView lhs, QByteArrayView rhs)
- \fn int QByteArrayView::operator< (QByteArrayView lhs, QByteArrayView rhs)
- \fn int QByteArrayView::operator<=(QByteArrayView lhs, QByteArrayView rhs)
- \fn int QByteArrayView::operator> (QByteArrayView lhs, QByteArrayView rhs)
- \fn int QByteArrayView::operator>=(QByteArrayView lhs, QByteArrayView rhs)
+ \fn int QByteArrayView::operator==(const QByteArrayView &lhs, const QByteArrayView &rhs)
+ \fn int QByteArrayView::operator!=(const QByteArrayView &lhs, const QByteArrayView &rhs)
+ \fn int QByteArrayView::operator< (const QByteArrayView &lhs, const QByteArrayView &rhs)
+ \fn int QByteArrayView::operator<=(const QByteArrayView &lhs, const QByteArrayView &rhs)
+ \fn int QByteArrayView::operator> (const QByteArrayView &lhs, const QByteArrayView &rhs)
+ \fn int QByteArrayView::operator>=(const QByteArrayView &lhs, const QByteArrayView &rhs)
Comparison operators for QByteArrayView.
*/
@@ -562,8 +571,10 @@
Returns a byte array view that points to \a n bytes of this byte array
view, starting at position \a pos.
+//! [UB-sliced-index-length]
\note The behavior is undefined when \a pos < 0, \a n < 0,
or \a pos + \a n > size().
+//! [UB-sliced-index-length]
\sa first(), last(), chopped(), chop(), truncate()
*/
@@ -574,7 +585,9 @@
Returns a byte array view starting at position \a pos in this object,
and extending to its end.
+//! [UB-sliced-index-only]
\note The behavior is undefined when \a pos < 0 or \a pos > size().
+//! [UB-sliced-index-only]
\sa first(), last(), chopped(), chop(), truncate()
*/
@@ -1032,3 +1045,12 @@
\sa QByteArray::isNull(), QByteArrayView
*/
+
+/*!
+ \fn QByteArrayView::operator std::string_view() const
+ \since 6.7
+
+ Converts this QByteArrayView object to a \c{std::string_view} object.
+ The returned view will have the same data pointer and length of
+ this view.
+*/