diff options
Diffstat (limited to 'src/corelib/text/qutf8stringview.qdoc')
-rw-r--r-- | src/corelib/text/qutf8stringview.qdoc | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/corelib/text/qutf8stringview.qdoc b/src/corelib/text/qutf8stringview.qdoc index e7c1daaca7..b433e5b995 100644 --- a/src/corelib/text/qutf8stringview.qdoc +++ b/src/corelib/text/qutf8stringview.qdoc @@ -11,6 +11,14 @@ \ingroup tools \ingroup string-processing + \compares strong + \compareswith strong char16_t QChar {const char16_t *} QString QStringView \ + QLatin1StringView + \endcompareswith + \compareswith strong {const char *} QByteArray QByteArrayView + The contents of byte arrays is interpreted as utf-8. + \endcompareswith + A QUtf8StringView references a contiguous portion of a UTF-8 string it does not own. It acts as an interface type to all kinds of UTF-8 string, without the need to construct a QString or @@ -217,7 +225,7 @@ */ /*! - \fn template <typename Char> QUtf8StringView::QUtf8StringView(const Char *str, qsizetype len) + \fn template <typename Char, QUtf8StringView::if_compatible_char<Char> = true> QUtf8StringView::QUtf8StringView(const Char *str, qsizetype len) Constructs a string view on \a str with length \a len. @@ -233,7 +241,7 @@ */ /*! - \fn template <typename Char> QUtf8StringView::QUtf8StringView(const Char *first, const Char *last) + \fn template <typename Char, QUtf8StringView::if_compatible_char<Char> = true> QUtf8StringView::QUtf8StringView(const Char *first, const Char *last) Constructs a string view on \a first with length (\a last - \a first). @@ -287,7 +295,7 @@ */ /*! - \fn template <typename Container, if_compatible_container<Container>> QUtf8StringView::QUtf8StringView(const Container &str) + \fn template <typename Container, QUtf8StringView::if_compatible_container<Container>> QUtf8StringView::QUtf8StringView(const Container &str) Constructs a string view on \a str. The length is taken from \c{std::size(str)}. @@ -306,7 +314,7 @@ */ /*! - \fn template <typename Char, size_t Size, if_compatible_char<Char>> QUtf8StringView::fromArray(const Char (&string)[Size]) + \fn template <typename Char, size_t Size, QUtf8StringView::if_compatible_char<Char>> QUtf8StringView::fromArray(const Char (&string)[Size]) Constructs a string view on the full character string literal \a string, including any trailing \c{Char(0)}. If you don't want the @@ -605,8 +613,10 @@ Returns a string view containing \a n code points of this string 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() */ @@ -617,7 +627,9 @@ Returns a string 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() */ @@ -665,8 +677,9 @@ \fn int QUtf8StringView::compare(QStringView str, Qt::CaseSensitivity cs) const \since 6.5 - Returns an integer that compares to zero as this string view compares to the - string view \a str. + Compares this string view with \a str and returns a negative integer if + this string view is less than \a str, a positive integer if it is greater than + \a str, and zero if they are equal. \include qstring.qdocinc {search-comparison-case-sensitivity} {comparison} */ @@ -695,3 +708,13 @@ \sa QByteArray::isNull(), QUtf8StringView */ + + +/*! \fn QUtf8StringView::operator std::basic_string_view<storage_type>() const + \since 6.7 + + Converts this QUtf8StringView object to a + \c{std::basic_string_view} object. The returned view will have the + same data pointer and length of this view. The character type of + the returned view will be \c{storage_type}. +*/ |