Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QBasicUtf8StringView< UseChar8T > Class Template Reference

#include <qutf8stringview.h>

+ Collaboration diagram for QBasicUtf8StringView< UseChar8T >:

Public Types

using storage_type = typename std::conditional< UseChar8T, QtPrivate::hide_char8_t, QtPrivate::wrap_char >::type::type
 
typedef const storage_type value_type
 
typedef qptrdiff difference_type
 
typedef qsizetype size_type
 
typedef value_typereference
 
typedef value_typeconst_reference
 
typedef value_typepointer
 
typedef value_typeconst_pointer
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

constexpr QBasicUtf8StringView () noexcept
 
constexpr QBasicUtf8StringView (std::nullptr_t) noexcept
 
template<typename Char , if_compatible_char< Char > = true>
constexpr QBasicUtf8StringView (const Char *str, qsizetype len)
 
template<typename Char , if_compatible_char< Char > = true>
constexpr QBasicUtf8StringView (const Char *f, const Char *l)
 
template<typename Pointer , if_compatible_pointer< Pointer > = true>
constexpr QBasicUtf8StringView (const Pointer &str) noexcept
 
template<typename String , if_compatible_qstring_like< String > = true>
 QBasicUtf8StringView (const String &str) noexcept
 
template<typename Container , if_compatible_container< Container > = true>
constexpr QBasicUtf8StringView (const Container &c) noexcept
 
QString toString () const
 
constexpr qsizetype size () const noexcept
 
const_pointer data () const noexcept
 
constexpr storage_type operator[] (qsizetype n) const
 
constexpr storage_type at (qsizetype n) const
 
constexpr QBasicUtf8StringView mid (qsizetype pos, qsizetype n=-1) const
 
constexpr QBasicUtf8StringView left (qsizetype n) const
 
constexpr QBasicUtf8StringView right (qsizetype n) const
 
constexpr QBasicUtf8StringView sliced (qsizetype pos) const
 
constexpr QBasicUtf8StringView sliced (qsizetype pos, qsizetype n) const
 
constexpr QBasicUtf8StringView first (qsizetype n) const
 
constexpr QBasicUtf8StringView last (qsizetype n) const
 
constexpr QBasicUtf8StringView chopped (qsizetype n) const
 
constexpr void truncate (qsizetype n)
 
constexpr void chop (qsizetype n)
 
bool isValidUtf8 () const noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr storage_type front () const
 
constexpr storage_type back () const
 
constexpr bool isNull () const noexcept
 
constexpr bool isEmpty () const noexcept
 
constexpr qsizetype length () const noexcept
 
int compare (QBasicUtf8StringView other, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
 
int compare (QStringView other, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
 
int compare (QLatin1StringView other, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
 

Static Public Member Functions

template<typename Char , size_t Size, if_compatible_char< Char > = true>
static constexpr QBasicUtf8StringView fromArray (const Char(&string)[Size]) noexcept
 

Friends

bool operator== (QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
 
bool operator!= (QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
 
bool operator<= (QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
 
bool operator>= (QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
 
bool operator< (QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
 
bool operator> (QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
 

Detailed Description

template<bool UseChar8T>
class QBasicUtf8StringView< UseChar8T >

Definition at line 92 of file qutf8stringview.h.

Member Typedef Documentation

◆ const_iterator

template<bool UseChar8T>
typedef const_pointer QBasicUtf8StringView< UseChar8T >::const_iterator

Definition at line 112 of file qutf8stringview.h.

◆ const_pointer

template<bool UseChar8T>
typedef value_type* QBasicUtf8StringView< UseChar8T >::const_pointer

Definition at line 109 of file qutf8stringview.h.

◆ const_reference

template<bool UseChar8T>
typedef value_type& QBasicUtf8StringView< UseChar8T >::const_reference

Definition at line 107 of file qutf8stringview.h.

◆ const_reverse_iterator

template<bool UseChar8T>
typedef std::reverse_iterator<const_iterator> QBasicUtf8StringView< UseChar8T >::const_reverse_iterator

Definition at line 114 of file qutf8stringview.h.

◆ difference_type

template<bool UseChar8T>
typedef qptrdiff QBasicUtf8StringView< UseChar8T >::difference_type

Definition at line 104 of file qutf8stringview.h.

◆ iterator

template<bool UseChar8T>
typedef pointer QBasicUtf8StringView< UseChar8T >::iterator

Definition at line 111 of file qutf8stringview.h.

◆ pointer

template<bool UseChar8T>
typedef value_type* QBasicUtf8StringView< UseChar8T >::pointer

Definition at line 108 of file qutf8stringview.h.

◆ reference

template<bool UseChar8T>
typedef value_type& QBasicUtf8StringView< UseChar8T >::reference

Definition at line 106 of file qutf8stringview.h.

◆ reverse_iterator

template<bool UseChar8T>
typedef std::reverse_iterator<iterator> QBasicUtf8StringView< UseChar8T >::reverse_iterator

Definition at line 113 of file qutf8stringview.h.

◆ size_type

template<bool UseChar8T>
typedef qsizetype QBasicUtf8StringView< UseChar8T >::size_type

Definition at line 105 of file qutf8stringview.h.

◆ storage_type

template<bool UseChar8T>
using QBasicUtf8StringView< UseChar8T >::storage_type = typename std::conditional<UseChar8T, QtPrivate::hide_char8_t, QtPrivate::wrap_char >::type::type

Definition at line 96 of file qutf8stringview.h.

◆ value_type

template<bool UseChar8T>
typedef const storage_type QBasicUtf8StringView< UseChar8T >::value_type

Definition at line 103 of file qutf8stringview.h.

Constructor & Destructor Documentation

◆ QBasicUtf8StringView() [1/7]

template<bool UseChar8T>
constexpr QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView ( )
inlineconstexprnoexcept

◆ QBasicUtf8StringView() [2/7]

template<bool UseChar8T>
constexpr QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView ( std::nullptr_t  )
inlineconstexprnoexcept

Definition at line 154 of file qutf8stringview.h.

◆ QBasicUtf8StringView() [3/7]

template<bool UseChar8T>
template<typename Char , if_compatible_char< Char > = true>
constexpr QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView ( const Char str,
qsizetype  len 
)
inlineconstexpr

Definition at line 158 of file qutf8stringview.h.

◆ QBasicUtf8StringView() [4/7]

template<bool UseChar8T>
template<typename Char , if_compatible_char< Char > = true>
constexpr QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView ( const Char f,
const Char l 
)
inlineconstexpr

Definition at line 163 of file qutf8stringview.h.

◆ QBasicUtf8StringView() [5/7]

template<bool UseChar8T>
template<typename Pointer , if_compatible_pointer< Pointer > = true>
constexpr QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView ( const Pointer &  str)
inlineconstexprnoexcept

Definition at line 174 of file qutf8stringview.h.

◆ QBasicUtf8StringView() [6/7]

template<bool UseChar8T>
template<typename String , if_compatible_qstring_like< String > = true>
QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView ( const String &  str)
inlinenoexcept

Definition at line 184 of file qutf8stringview.h.

◆ QBasicUtf8StringView() [7/7]

template<bool UseChar8T>
template<typename Container , if_compatible_container< Container > = true>
constexpr QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView ( const Container &  c)
inlineconstexprnoexcept

Definition at line 189 of file qutf8stringview.h.

Member Function Documentation

◆ at()

template<bool UseChar8T>
constexpr storage_type QBasicUtf8StringView< UseChar8T >::at ( qsizetype  n) const
inlineconstexpr

Definition at line 216 of file qutf8stringview.h.

◆ back()

template<bool UseChar8T>
constexpr storage_type QBasicUtf8StringView< UseChar8T >::back ( ) const
inlineconstexpr

Definition at line 275 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::empty(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ begin()

template<bool UseChar8T>
const_iterator QBasicUtf8StringView< UseChar8T >::begin ( ) const
inlinenoexcept

Definition at line 264 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::data().

Referenced by QBasicUtf8StringView< UseChar8T >::cbegin(), and QBasicUtf8StringView< UseChar8T >::rend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cbegin()

template<bool UseChar8T>
const_iterator QBasicUtf8StringView< UseChar8T >::cbegin ( ) const
inlinenoexcept

Definition at line 266 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::begin().

+ Here is the call graph for this function:

◆ cend()

template<bool UseChar8T>
const_iterator QBasicUtf8StringView< UseChar8T >::cend ( ) const
inlinenoexcept

Definition at line 267 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::end().

+ Here is the call graph for this function:

◆ chop()

template<bool UseChar8T>
constexpr void QBasicUtf8StringView< UseChar8T >::chop ( qsizetype  n)
inlineconstexpr

Definition at line 253 of file qutf8stringview.h.

◆ chopped()

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::chopped ( qsizetype  n) const
inlineconstexpr

Definition at line 248 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView().

+ Here is the call graph for this function:

◆ compare() [1/3]

template<bool UseChar8T>
int QBasicUtf8StringView< UseChar8T >::compare ( QBasicUtf8StringView< UseChar8T >  other,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const
inlinenoexcept

Definition at line 285 of file qutf8stringview.h.

References QtPrivate::compareStrings(), and other().

+ Here is the call graph for this function:

◆ compare() [2/3]

template<bool UseChar8T>
int QBasicUtf8StringView< UseChar8T >::compare ( QLatin1StringView  other,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const
noexcept

Definition at line 1056 of file qstring.h.

References QtPrivate::compareStrings(), and other().

+ Here is the call graph for this function:

◆ compare() [3/3]

template<bool UseChar8T>
int QBasicUtf8StringView< UseChar8T >::compare ( QStringView  other,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const
noexcept

Definition at line 1039 of file qstring.h.

References QtPrivate::compareStrings(), and other().

+ Here is the call graph for this function:

◆ crbegin()

template<bool UseChar8T>
const_reverse_iterator QBasicUtf8StringView< UseChar8T >::crbegin ( ) const
inlinenoexcept

Definition at line 270 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::rbegin().

+ Here is the call graph for this function:

◆ crend()

template<bool UseChar8T>
const_reverse_iterator QBasicUtf8StringView< UseChar8T >::crend ( ) const
inlinenoexcept

Definition at line 271 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::rend().

+ Here is the call graph for this function:

◆ data()

template<bool UseChar8T>
const_pointer QBasicUtf8StringView< UseChar8T >::data ( ) const
inlinenoexcept

Definition at line 204 of file qutf8stringview.h.

Referenced by QBasicUtf8StringView< UseChar8T >::begin(), QAnyStringViewUtils::doesContain(), QBasicUtf8StringView< UseChar8T >::end(), and QBasicUtf8StringView< UseChar8T >::isValidUtf8().

+ Here is the caller graph for this function:

◆ empty()

template<bool UseChar8T>
constexpr bool QBasicUtf8StringView< UseChar8T >::empty ( ) const
inlineconstexprnoexcept

Definition at line 273 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::size().

Referenced by QBasicUtf8StringView< UseChar8T >::back(), QBasicUtf8StringView< UseChar8T >::front(), and QBasicUtf8StringView< UseChar8T >::isEmpty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end()

template<bool UseChar8T>
const_iterator QBasicUtf8StringView< UseChar8T >::end ( ) const
inlinenoexcept

Definition at line 265 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::data(), and QBasicUtf8StringView< UseChar8T >::size().

Referenced by QBasicUtf8StringView< UseChar8T >::cend(), and QBasicUtf8StringView< UseChar8T >::rbegin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ first()

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::first ( qsizetype  n) const
inlineconstexpr

Definition at line 244 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView().

+ Here is the call graph for this function:

◆ fromArray()

template<bool UseChar8T>
template<typename Char , size_t Size, if_compatible_char< Char > = true>
static constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::fromArray ( const Char(&)  string[Size])
inlinestaticconstexprnoexcept

Definition at line 198 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView(), and Size.

+ Here is the call graph for this function:

◆ front()

template<bool UseChar8T>
constexpr storage_type QBasicUtf8StringView< UseChar8T >::front ( ) const
inlineconstexpr

Definition at line 274 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::empty(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ isEmpty()

template<bool UseChar8T>
constexpr bool QBasicUtf8StringView< UseChar8T >::isEmpty ( ) const
inlineconstexprnoexcept

Definition at line 281 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::empty().

+ Here is the call graph for this function:

◆ isNull()

template<bool UseChar8T>
constexpr bool QBasicUtf8StringView< UseChar8T >::isNull ( ) const
inlineconstexprnoexcept

Definition at line 280 of file qutf8stringview.h.

◆ isValidUtf8()

template<bool UseChar8T>
bool QBasicUtf8StringView< UseChar8T >::isValidUtf8 ( ) const
inlinenoexcept

Definition at line 256 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::data(), QByteArrayView::isValidUtf8(), and QBasicUtf8StringView< UseChar8T >::size().

+ Here is the call graph for this function:

◆ last()

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::last ( qsizetype  n) const
inlineconstexpr

Definition at line 246 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView().

+ Here is the call graph for this function:

◆ left()

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::left ( qsizetype  n) const
inlineconstexpr

Definition at line 226 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView(), and QBasicUtf8StringView< UseChar8T >::size().

+ Here is the call graph for this function:

◆ length()

template<bool UseChar8T>
constexpr qsizetype QBasicUtf8StringView< UseChar8T >::length ( ) const
inlineconstexprnoexcept

Definition at line 282 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::size().

+ Here is the call graph for this function:

◆ mid()

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::mid ( qsizetype  pos,
qsizetype  n = -1 
) const
inlineconstexpr

Definition at line 219 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView(), pos, and QBasicUtf8StringView< UseChar8T >::size().

+ Here is the call graph for this function:

◆ operator[]()

template<bool UseChar8T>
constexpr storage_type QBasicUtf8StringView< UseChar8T >::operator[] ( qsizetype  n) const
inlineconstexpr

Definition at line 209 of file qutf8stringview.h.

References Q_ASSERT, and QBasicUtf8StringView< UseChar8T >::size().

+ Here is the call graph for this function:

◆ rbegin()

template<bool UseChar8T>
const_reverse_iterator QBasicUtf8StringView< UseChar8T >::rbegin ( ) const
inlinenoexcept

Definition at line 268 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::end().

Referenced by QBasicUtf8StringView< UseChar8T >::crbegin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rend()

template<bool UseChar8T>
const_reverse_iterator QBasicUtf8StringView< UseChar8T >::rend ( ) const
inlinenoexcept

Definition at line 269 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::begin().

Referenced by QBasicUtf8StringView< UseChar8T >::crend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ right()

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::right ( qsizetype  n) const
inlineconstexpr

Definition at line 233 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView(), and QBasicUtf8StringView< UseChar8T >::size().

+ Here is the call graph for this function:

◆ size()

template<bool UseChar8T>
constexpr qsizetype QBasicUtf8StringView< UseChar8T >::size ( ) const
inlineconstexprnoexcept

◆ sliced() [1/2]

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::sliced ( qsizetype  pos) const
inlineconstexpr

Definition at line 240 of file qutf8stringview.h.

References pos.

◆ sliced() [2/2]

template<bool UseChar8T>
constexpr QBasicUtf8StringView QBasicUtf8StringView< UseChar8T >::sliced ( qsizetype  pos,
qsizetype  n 
) const
inlineconstexpr

Definition at line 242 of file qutf8stringview.h.

References QBasicUtf8StringView< UseChar8T >::QBasicUtf8StringView(), and pos.

+ Here is the call graph for this function:

◆ toString()

template<bool UseChar8T>
QString QBasicUtf8StringView< UseChar8T >::toString
inline

Definition at line 1050 of file qstring.h.

References QString::fromUtf8().

+ Here is the call graph for this function:

◆ truncate()

template<bool UseChar8T>
constexpr void QBasicUtf8StringView< UseChar8T >::truncate ( qsizetype  n)
inlineconstexpr

Definition at line 251 of file qutf8stringview.h.

Friends And Related Symbol Documentation

◆ operator!=

template<bool UseChar8T>
bool operator!= ( QBasicUtf8StringView< UseChar8T >  lhs,
QBasicUtf8StringView< UseChar8T >  rhs 
)
friend

Definition at line 309 of file qutf8stringview.h.

◆ operator<

template<bool UseChar8T>
bool operator< ( QBasicUtf8StringView< UseChar8T >  lhs,
QBasicUtf8StringView< UseChar8T >  rhs 
)
friend

Definition at line 320 of file qutf8stringview.h.

◆ operator<=

template<bool UseChar8T>
bool operator<= ( QBasicUtf8StringView< UseChar8T >  lhs,
QBasicUtf8StringView< UseChar8T >  rhs 
)
friend

Definition at line 316 of file qutf8stringview.h.

◆ operator==

template<bool UseChar8T>
bool operator== ( QBasicUtf8StringView< UseChar8T >  lhs,
QBasicUtf8StringView< UseChar8T >  rhs 
)
friend

Definition at line 303 of file qutf8stringview.h.

◆ operator>

template<bool UseChar8T>
bool operator> ( QBasicUtf8StringView< UseChar8T >  lhs,
QBasicUtf8StringView< UseChar8T >  rhs 
)
friend

Definition at line 322 of file qutf8stringview.h.

◆ operator>=

template<bool UseChar8T>
bool operator>= ( QBasicUtf8StringView< UseChar8T >  lhs,
QBasicUtf8StringView< UseChar8T >  rhs 
)
friend

Definition at line 318 of file qutf8stringview.h.


The documentation for this class was generated from the following files: