diff options
Diffstat (limited to 'src/corelib/text/qbytearrayview.qdoc')
-rw-r--r-- | src/corelib/text/qbytearrayview.qdoc | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/corelib/text/qbytearrayview.qdoc b/src/corelib/text/qbytearrayview.qdoc index 6afcba1eef..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. @@ -278,7 +287,7 @@ The container's data must remain valid for the lifetime of this byte array view object. This constructor participates in overload resolution if \a c is any contiguous - container container with elements of a compatible byte type. + container with elements of a compatible byte type. \sa {Compatible Byte Types} */ @@ -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. +*/ |