QtBase  v6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
QByteArrayView Class Reference

#include <qbytearrayview.h>

Public Types

typedef char storage_type
 
typedef const char 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 QByteArrayView () noexcept
 
constexpr QByteArrayView (std::nullptr_t) noexcept
 
template<typename Byte , if_compatible_byte< Byte > = true>
constexpr QByteArrayView (const Byte *data, qsizetype len)
 
template<typename Byte , if_compatible_byte< Byte > = true>
constexpr QByteArrayView (const Byte *first, const Byte *last)
 
template<typename Pointer , if_compatible_pointer< Pointer > = true>
constexpr QByteArrayView (const Pointer &data) noexcept
 
template<typename ByteArray , if_compatible_qbytearray_like< ByteArray > = true>
 QByteArrayView (const ByteArray &ba) noexcept
 
template<typename Container , if_compatible_container< Container > = true>
constexpr QByteArrayView (const Container &c) noexcept
 
template<size_t Size>
constexpr QByteArrayView (const char(&data)[Size]) noexcept
 
QByteArray toByteArray () const
 
constexpr qsizetype size () const noexcept
 
constexpr const_pointer data () const noexcept
 
constexpr const_pointer constData () const noexcept
 
constexpr char operator[] (qsizetype n) const
 
constexpr char at (qsizetype n) const
 
constexpr QByteArrayView first (qsizetype n) const
 
constexpr QByteArrayView last (qsizetype n) const
 
constexpr QByteArrayView sliced (qsizetype pos) const
 
constexpr QByteArrayView sliced (qsizetype pos, qsizetype n) const
 
constexpr QByteArrayView chopped (qsizetype len) const
 
constexpr void truncate (qsizetype n)
 
constexpr void chop (qsizetype n)
 
QByteArrayView trimmed () const noexcept
 
short toShort (bool *ok=nullptr, int base=10) const
 
ushort toUShort (bool *ok=nullptr, int base=10) const
 
int toInt (bool *ok=nullptr, int base=10) const
 
uint toUInt (bool *ok=nullptr, int base=10) const
 
long toLong (bool *ok=nullptr, int base=10) const
 
ulong toULong (bool *ok=nullptr, int base=10) const
 
qlonglong toLongLong (bool *ok=nullptr, int base=10) const
 
qulonglong toULongLong (bool *ok=nullptr, int base=10) const
 
float toFloat (bool *ok=nullptr) const
 
double toDouble (bool *ok=nullptr) const
 
bool startsWith (QByteArrayView other) const noexcept
 
bool startsWith (char c) const noexcept
 
bool endsWith (QByteArrayView other) const noexcept
 
bool endsWith (char c) const noexcept
 
qsizetype indexOf (QByteArrayView a, qsizetype from=0) const noexcept
 
qsizetype indexOf (char ch, qsizetype from=0) const noexcept
 
bool contains (QByteArrayView a) const noexcept
 
bool contains (char c) const noexcept
 
qsizetype lastIndexOf (QByteArrayView a) const noexcept
 
qsizetype lastIndexOf (QByteArrayView a, qsizetype from) const noexcept
 
qsizetype lastIndexOf (char ch, qsizetype from=-1) const noexcept
 
qsizetype count (QByteArrayView a) const noexcept
 
qsizetype count (char ch) const noexcept
 
int compare (QByteArrayView a, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
 
bool isValidUtf8 () const noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr char front () const
 
constexpr char back () const
 
constexpr bool isNull () const noexcept
 
constexpr bool isEmpty () const noexcept
 
constexpr qsizetype length () const noexcept
 
constexpr char first () const
 
constexpr char last () const
 

Static Public Member Functions

template<typename Byte , size_t Size, if_compatible_byte< Byte > = true>
constexpr static QByteArrayView fromArray (const Byte(&data)[Size]) noexcept
 

Friends

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

Detailed Description

Definition at line 105 of file qbytearrayview.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 118 of file qbytearrayview.h.

◆ const_pointer

Definition at line 115 of file qbytearrayview.h.

◆ const_reference

Definition at line 113 of file qbytearrayview.h.

◆ const_reverse_iterator

Definition at line 120 of file qbytearrayview.h.

◆ difference_type

Definition at line 110 of file qbytearrayview.h.

◆ iterator

Definition at line 117 of file qbytearrayview.h.

◆ pointer

Definition at line 114 of file qbytearrayview.h.

◆ reference

Definition at line 112 of file qbytearrayview.h.

◆ reverse_iterator

typedef std::reverse_iterator<iterator> QByteArrayView::reverse_iterator

Definition at line 119 of file qbytearrayview.h.

◆ size_type

Definition at line 111 of file qbytearrayview.h.

◆ storage_type

Definition at line 108 of file qbytearrayview.h.

◆ value_type

Definition at line 109 of file qbytearrayview.h.

Constructor & Destructor Documentation

◆ QByteArrayView() [1/8]

constexpr QByteArrayView::QByteArrayView ( )
inlineconstexprnoexcept

Definition at line 167 of file qbytearrayview.h.

◆ QByteArrayView() [2/8]

constexpr QByteArrayView::QByteArrayView ( std::nullptr_t  )
inlineconstexprnoexcept

Definition at line 169 of file qbytearrayview.h.

◆ QByteArrayView() [3/8]

template<typename Byte , if_compatible_byte< Byte > = true>
constexpr QByteArrayView::QByteArrayView ( const Byte data,
qsizetype  len 
)
inlineconstexpr

Definition at line 173 of file qbytearrayview.h.

◆ QByteArrayView() [4/8]

template<typename Byte , if_compatible_byte< Byte > = true>
constexpr QByteArrayView::QByteArrayView ( const Byte first,
const Byte last 
)
inlineconstexpr

Definition at line 178 of file qbytearrayview.h.

◆ QByteArrayView() [5/8]

template<typename Pointer , if_compatible_pointer< Pointer > = true>
constexpr QByteArrayView::QByteArrayView ( const Pointer data)
inlineconstexprnoexcept

Definition at line 186 of file qbytearrayview.h.

◆ QByteArrayView() [6/8]

template<typename ByteArray , if_compatible_qbytearray_like< ByteArray > = true>
QByteArrayView::QByteArrayView ( const ByteArray &  ba)
inlinenoexcept

Definition at line 195 of file qbytearrayview.h.

◆ QByteArrayView() [7/8]

template<typename Container , if_compatible_container< Container > = true>
constexpr QByteArrayView::QByteArrayView ( const Container c)
inlineconstexprnoexcept

Definition at line 200 of file qbytearrayview.h.

◆ QByteArrayView() [8/8]

template<size_t Size>
constexpr QByteArrayView::QByteArrayView ( const char(&)  data[Size])
inlineconstexprnoexcept

Definition at line 203 of file qbytearrayview.h.

Member Function Documentation

◆ at()

constexpr char QByteArrayView::at ( qsizetype  n) const
inlineconstexpr

Definition at line 225 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ back()

constexpr char QByteArrayView::back ( ) const
inlineconstexpr

Definition at line 327 of file qbytearrayview.h.

◆ begin()

constexpr const_iterator QByteArrayView::begin ( ) const
inlineconstexprnoexcept

Definition at line 316 of file qbytearrayview.h.

◆ cbegin()

constexpr const_iterator QByteArrayView::cbegin ( ) const
inlineconstexprnoexcept

Definition at line 318 of file qbytearrayview.h.

Here is the call graph for this function:

◆ cend()

constexpr const_iterator QByteArrayView::cend ( ) const
inlineconstexprnoexcept

Definition at line 319 of file qbytearrayview.h.

◆ chop()

constexpr void QByteArrayView::chop ( qsizetype  n)
inlineconstexpr

Definition at line 240 of file qbytearrayview.h.

◆ chopped()

constexpr QByteArrayView QByteArrayView::chopped ( qsizetype  len) const
inlineconstexpr

Definition at line 235 of file qbytearrayview.h.

◆ compare()

int QByteArrayView::compare ( QByteArrayView  a,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const
inlinenoexcept

Definition at line 363 of file qbytearrayview.h.

Here is the call graph for this function:

◆ constData()

constexpr const_pointer QByteArrayView::constData ( ) const
inlineconstexprnoexcept

Definition at line 217 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ contains() [1/2]

bool QByteArrayView::contains ( char  c) const
inlinenoexcept

Definition at line 294 of file qbytearrayview.h.

◆ contains() [2/2]

bool QByteArrayView::contains ( QByteArrayView  a) const
inlinenoexcept

Definition at line 292 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ count() [1/2]

qsizetype QByteArrayView::count ( char  ch) const
inlinenoexcept

Definition at line 306 of file qbytearrayview.h.

Here is the call graph for this function:

◆ count() [2/2]

qsizetype QByteArrayView::count ( QByteArrayView  a) const
inlinenoexcept

Definition at line 304 of file qbytearrayview.h.

Here is the call graph for this function:

◆ crbegin()

constexpr const_reverse_iterator QByteArrayView::crbegin ( ) const
inlineconstexprnoexcept

Definition at line 322 of file qbytearrayview.h.

◆ crend()

constexpr const_reverse_iterator QByteArrayView::crend ( ) const
inlineconstexprnoexcept

Definition at line 323 of file qbytearrayview.h.

◆ data()

constexpr const_pointer QByteArrayView::data ( ) const
inlineconstexprnoexcept

Definition at line 216 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ empty()

constexpr bool QByteArrayView::empty ( ) const
inlineconstexprnoexcept

Definition at line 325 of file qbytearrayview.h.

◆ end()

constexpr const_iterator QByteArrayView::end ( ) const
inlineconstexprnoexcept

Definition at line 317 of file qbytearrayview.h.

◆ endsWith() [1/2]

bool QByteArrayView::endsWith ( char  c) const
inlinenoexcept

Definition at line 284 of file qbytearrayview.h.

◆ endsWith() [2/2]

bool QByteArrayView::endsWith ( QByteArrayView  other) const
inlinenoexcept

Definition at line 282 of file qbytearrayview.h.

Here is the call graph for this function:

◆ first() [1/2]

constexpr char QByteArrayView::first ( ) const
inlineconstexpr

Definition at line 336 of file qbytearrayview.h.

◆ first() [2/2]

constexpr QByteArrayView QByteArrayView::first ( qsizetype  n) const
inlineconstexpr

Definition at line 227 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ fromArray()

template<typename Byte , size_t Size, if_compatible_byte< Byte > = true>
constexpr static QByteArrayView QByteArrayView::fromArray ( const Byte(&)  data[Size])
inlinestaticconstexprnoexcept

Definition at line 211 of file qbytearrayview.h.

◆ front()

constexpr char QByteArrayView::front ( ) const
inlineconstexpr

Definition at line 326 of file qbytearrayview.h.

◆ indexOf() [1/2]

qsizetype QByteArrayView::indexOf ( char  ch,
qsizetype  from = 0 
) const
inlinenoexcept

Definition at line 289 of file qbytearrayview.h.

Here is the call graph for this function:

◆ indexOf() [2/2]

qsizetype QByteArrayView::indexOf ( QByteArrayView  a,
qsizetype  from = 0 
) const
inlinenoexcept

Definition at line 287 of file qbytearrayview.h.

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

◆ isEmpty()

constexpr bool QByteArrayView::isEmpty ( ) const
inlineconstexprnoexcept

Definition at line 333 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ isNull()

constexpr bool QByteArrayView::isNull ( ) const
inlineconstexprnoexcept

Definition at line 332 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ isValidUtf8()

bool QByteArrayView::isValidUtf8 ( ) const
inlinenoexcept

Definition at line 311 of file qbytearrayview.h.

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

◆ last() [1/2]

constexpr char QByteArrayView::last ( ) const
inlineconstexpr

Definition at line 337 of file qbytearrayview.h.

◆ last() [2/2]

constexpr QByteArrayView QByteArrayView::last ( qsizetype  n) const
inlineconstexpr

Definition at line 229 of file qbytearrayview.h.

◆ lastIndexOf() [1/3]

qsizetype QByteArrayView::lastIndexOf ( char  ch,
qsizetype  from = -1 
) const
inlinenoexcept

Definition at line 301 of file qbytearrayview.h.

Here is the call graph for this function:

◆ lastIndexOf() [2/3]

qsizetype QByteArrayView::lastIndexOf ( QByteArrayView  a) const
inlinenoexcept

Definition at line 297 of file qbytearrayview.h.

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

◆ lastIndexOf() [3/3]

qsizetype QByteArrayView::lastIndexOf ( QByteArrayView  a,
qsizetype  from 
) const
inlinenoexcept

Definition at line 299 of file qbytearrayview.h.

Here is the call graph for this function:

◆ length()

constexpr qsizetype QByteArrayView::length ( ) const
inlineconstexprnoexcept

Definition at line 334 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ operator[]()

constexpr char QByteArrayView::operator[] ( qsizetype  n) const
inlineconstexpr

Definition at line 219 of file qbytearrayview.h.

◆ rbegin()

constexpr const_reverse_iterator QByteArrayView::rbegin ( ) const
inlineconstexprnoexcept

Definition at line 320 of file qbytearrayview.h.

◆ rend()

constexpr const_reverse_iterator QByteArrayView::rend ( ) const
inlineconstexprnoexcept

Definition at line 321 of file qbytearrayview.h.

Here is the call graph for this function:

◆ size()

constexpr qsizetype QByteArrayView::size ( ) const
inlineconstexprnoexcept

Definition at line 215 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ sliced() [1/2]

constexpr QByteArrayView QByteArrayView::sliced ( qsizetype  pos) const
inlineconstexpr

Definition at line 231 of file qbytearrayview.h.

Here is the caller graph for this function:

◆ sliced() [2/2]

constexpr QByteArrayView QByteArrayView::sliced ( qsizetype  pos,
qsizetype  n 
) const
inlineconstexpr

Definition at line 233 of file qbytearrayview.h.

◆ startsWith() [1/2]

bool QByteArrayView::startsWith ( char  c) const
inlinenoexcept

Definition at line 279 of file qbytearrayview.h.

◆ startsWith() [2/2]

bool QByteArrayView::startsWith ( QByteArrayView  other) const
inlinenoexcept

Definition at line 277 of file qbytearrayview.h.

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

◆ toByteArray()

QByteArray QByteArrayView::toByteArray ( ) const
inline

Definition at line 684 of file qbytearray.h.

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

◆ toDouble()

double QByteArrayView::toDouble ( bool *  ok = nullptr) const
inline

Definition at line 269 of file qbytearrayview.h.

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

◆ toFloat()

float QByteArrayView::toFloat ( bool *  ok = nullptr) const
inline

Definition at line 262 of file qbytearrayview.h.

Here is the call graph for this function:

◆ toInt()

int QByteArrayView::toInt ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 250 of file qbytearrayview.h.

◆ toLong()

long QByteArrayView::toLong ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 254 of file qbytearrayview.h.

◆ toLongLong()

qlonglong QByteArrayView::toLongLong ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 258 of file qbytearrayview.h.

◆ toShort()

short QByteArrayView::toShort ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 246 of file qbytearrayview.h.

◆ toUInt()

uint QByteArrayView::toUInt ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 252 of file qbytearrayview.h.

◆ toULong()

ulong QByteArrayView::toULong ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 256 of file qbytearrayview.h.

◆ toULongLong()

qulonglong QByteArrayView::toULongLong ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 260 of file qbytearrayview.h.

◆ toUShort()

ushort QByteArrayView::toUShort ( bool *  ok = nullptr,
int  base = 10 
) const
inline

Definition at line 248 of file qbytearrayview.h.

◆ trimmed()

QByteArrayView QByteArrayView::trimmed ( ) const
inlinenoexcept

Definition at line 244 of file qbytearrayview.h.

Here is the call graph for this function:

◆ truncate()

constexpr void QByteArrayView::truncate ( qsizetype  n)
inlineconstexpr

Definition at line 238 of file qbytearrayview.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( QByteArrayView  lhs,
QByteArrayView  rhs 
)
friend

Definition at line 341 of file qbytearrayview.h.

◆ operator<

bool operator< ( QByteArrayView  lhs,
QByteArrayView  rhs 
)
friend

Definition at line 343 of file qbytearrayview.h.

◆ operator<=

bool operator<= ( QByteArrayView  lhs,
QByteArrayView  rhs 
)
friend

Definition at line 345 of file qbytearrayview.h.

◆ operator==

bool operator== ( QByteArrayView  lhs,
QByteArrayView  rhs 
)
friend

Definition at line 339 of file qbytearrayview.h.

◆ operator>

bool operator> ( QByteArrayView  lhs,
QByteArrayView  rhs 
)
friend

Definition at line 347 of file qbytearrayview.h.

◆ operator>=

bool operator>= ( QByteArrayView  lhs,
QByteArrayView  rhs 
)
friend

Definition at line 349 of file qbytearrayview.h.


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