Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QByteArrayView Class Reference

#include <qbytearrayview.h>

Collaboration diagram for QByteArrayView:

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
template<typename Byte, if_compatible_byte< Byte > = true>
constexpr QByteArrayView (const Byte(&data)[]) 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 QByteArrayViewslice (qsizetype pos)
constexpr QByteArrayViewslice (qsizetype pos, qsizetype n)
constexpr QByteArrayView chopped (qsizetype len) const
constexpr QByteArrayView left (qsizetype n) const
constexpr QByteArrayView right (qsizetype n) const
constexpr QByteArrayView mid (qsizetype pos, qsizetype n=-1) 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
constexpr bool startsWith (char c) const noexcept
bool endsWith (QByteArrayView other) const noexcept
constexpr 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 Q_IMPLICIT operator std::string_view () const noexcept
constexpr qsizetype max_size () const noexcept
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>
static constexpr QByteArrayView fromArray (const Byte(&data)[Size]) noexcept
static constexpr qsizetype maxSize () noexcept

Friends

bool comparesEqual (const QByteArrayView &lhs, const QByteArrayView &rhs) noexcept
Qt::strong_ordering compareThreeWay (const QByteArrayView &lhs, const QByteArrayView &rhs) noexcept
Q_CORE_EXPORT bool comparesEqual (const QByteArrayView &lhs, const QChar &rhs)
Q_CORE_EXPORT Qt::strong_ordering compareThreeWay (const QByteArrayView &lhs, const QChar &rhs)
Q_CORE_EXPORT bool comparesEqual (const QByteArrayView &lhs, char16_t rhs)
Q_CORE_EXPORT Qt::strong_ordering compareThreeWay (const QByteArrayView &lhs, char16_t rhs)

Detailed Description

Definition at line 86 of file qbytearrayview.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 99 of file qbytearrayview.h.

◆ const_pointer

Definition at line 96 of file qbytearrayview.h.

◆ const_reference

Definition at line 94 of file qbytearrayview.h.

◆ const_reverse_iterator

Definition at line 101 of file qbytearrayview.h.

◆ difference_type

Definition at line 91 of file qbytearrayview.h.

◆ iterator

Definition at line 98 of file qbytearrayview.h.

◆ pointer

Definition at line 95 of file qbytearrayview.h.

◆ reference

Definition at line 93 of file qbytearrayview.h.

◆ reverse_iterator

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

Definition at line 100 of file qbytearrayview.h.

◆ size_type

Definition at line 92 of file qbytearrayview.h.

◆ storage_type

Definition at line 89 of file qbytearrayview.h.

◆ value_type

typedef const char QByteArrayView::value_type

Definition at line 90 of file qbytearrayview.h.

Constructor & Destructor Documentation

◆ QByteArrayView() [1/9]

QByteArrayView::QByteArrayView ( )
inlineconstexprnoexcept

Definition at line 142 of file qbytearrayview.h.

◆ QByteArrayView() [2/9]

QByteArrayView::QByteArrayView ( std::nullptr_t )
inlineconstexprnoexcept

Definition at line 144 of file qbytearrayview.h.

◆ QByteArrayView() [3/9]

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

Definition at line 148 of file qbytearrayview.h.

◆ QByteArrayView() [4/9]

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

Definition at line 153 of file qbytearrayview.h.

◆ QByteArrayView() [5/9]

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

Definition at line 161 of file qbytearrayview.h.

◆ QByteArrayView() [6/9]

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

Definition at line 170 of file qbytearrayview.h.

◆ QByteArrayView() [7/9]

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

Definition at line 175 of file qbytearrayview.h.

◆ QByteArrayView() [8/9]

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

Definition at line 178 of file qbytearrayview.h.

◆ QByteArrayView() [9/9]

template<typename Byte, if_compatible_byte< Byte > = true>
QByteArrayView::QByteArrayView ( const Byte(&) data[])
inlineconstexprnoexcept

Definition at line 182 of file qbytearrayview.h.

Member Function Documentation

◆ at()

char QByteArrayView::at ( qsizetype n) const
inlinenodiscardconstexpr

Definition at line 204 of file qbytearrayview.h.

◆ back()

char QByteArrayView::back ( ) const
inlinenodiscardconstexpr

Definition at line 324 of file qbytearrayview.h.

◆ begin()

const_iterator QByteArrayView::begin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 313 of file qbytearrayview.h.

◆ cbegin()

const_iterator QByteArrayView::cbegin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 315 of file qbytearrayview.h.

◆ cend()

const_iterator QByteArrayView::cend ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 316 of file qbytearrayview.h.

◆ chop()

void QByteArrayView::chop ( qsizetype n)
inlineconstexpr

Definition at line 237 of file qbytearrayview.h.

◆ chopped()

QByteArrayView QByteArrayView::chopped ( qsizetype len) const
inlinenodiscardconstexpr

Definition at line 220 of file qbytearrayview.h.

◆ compare()

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

Definition at line 395 of file qbytearrayview.h.

◆ constData()

const_pointer QByteArrayView::constData ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 196 of file qbytearrayview.h.

◆ contains() [1/2]

bool QByteArrayView::contains ( char c) const
inlinenodiscardnoexcept

Definition at line 291 of file qbytearrayview.h.

◆ contains() [2/2]

bool QByteArrayView::contains ( QByteArrayView a) const
inlinenodiscardnoexcept

Definition at line 289 of file qbytearrayview.h.

◆ count() [1/2]

qsizetype QByteArrayView::count ( char ch) const
inlinenodiscardnoexcept

Definition at line 303 of file qbytearrayview.h.

◆ count() [2/2]

qsizetype QByteArrayView::count ( QByteArrayView a) const
inlinenodiscardnoexcept

Definition at line 301 of file qbytearrayview.h.

◆ crbegin()

const_reverse_iterator QByteArrayView::crbegin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 319 of file qbytearrayview.h.

◆ crend()

const_reverse_iterator QByteArrayView::crend ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 320 of file qbytearrayview.h.

◆ data()

const_pointer QByteArrayView::data ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 195 of file qbytearrayview.h.

◆ empty()

bool QByteArrayView::empty ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 322 of file qbytearrayview.h.

◆ end()

const_iterator QByteArrayView::end ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 314 of file qbytearrayview.h.

◆ endsWith() [1/2]

bool QByteArrayView::endsWith ( char c) const
inlinenodiscardconstexprnoexcept

Definition at line 281 of file qbytearrayview.h.

◆ endsWith() [2/2]

bool QByteArrayView::endsWith ( QByteArrayView other) const
inlinenodiscardnoexcept

Definition at line 279 of file qbytearrayview.h.

◆ first() [1/2]

char QByteArrayView::first ( ) const
inlinenodiscardconstexpr

Definition at line 338 of file qbytearrayview.h.

◆ first() [2/2]

QByteArrayView QByteArrayView::first ( qsizetype n) const
inlinenodiscardconstexpr

Definition at line 206 of file qbytearrayview.h.

◆ fromArray()

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

Definition at line 190 of file qbytearrayview.h.

◆ front()

char QByteArrayView::front ( ) const
inlinenodiscardconstexpr

Definition at line 323 of file qbytearrayview.h.

◆ indexOf() [1/2]

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

Definition at line 286 of file qbytearrayview.h.

◆ indexOf() [2/2]

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

Definition at line 284 of file qbytearrayview.h.

◆ isEmpty()

bool QByteArrayView::isEmpty ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 335 of file qbytearrayview.h.

◆ isNull()

bool QByteArrayView::isNull ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 334 of file qbytearrayview.h.

◆ isValidUtf8()

bool QByteArrayView::isValidUtf8 ( ) const
inlinenodiscardnoexcept

Definition at line 308 of file qbytearrayview.h.

◆ last() [1/2]

char QByteArrayView::last ( ) const
inlinenodiscardconstexpr

Definition at line 339 of file qbytearrayview.h.

◆ last() [2/2]

QByteArrayView QByteArrayView::last ( qsizetype n) const
inlinenodiscardconstexpr

Definition at line 208 of file qbytearrayview.h.

◆ lastIndexOf() [1/3]

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

Definition at line 298 of file qbytearrayview.h.

◆ lastIndexOf() [2/3]

qsizetype QByteArrayView::lastIndexOf ( QByteArrayView a) const
inlinenodiscardnoexcept

Definition at line 294 of file qbytearrayview.h.

◆ lastIndexOf() [3/3]

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

Definition at line 296 of file qbytearrayview.h.

◆ left()

QByteArrayView QByteArrayView::left ( qsizetype n) const
inlinenodiscardconstexpr

Definition at line 223 of file qbytearrayview.h.

◆ length()

qsizetype QByteArrayView::length ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 336 of file qbytearrayview.h.

◆ max_size()

qsizetype QByteArrayView::max_size ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 329 of file qbytearrayview.h.

◆ maxSize()

constexpr qsizetype QByteArrayView::maxSize ( )
inlinestaticnodiscardconstexprnoexcept

Definition at line 341 of file qbytearrayview.h.

◆ mid()

QByteArrayView QByteArrayView::mid ( qsizetype pos,
qsizetype n = -1 ) const
inlinenodiscardconstexpr

Definition at line 227 of file qbytearrayview.h.

◆ operator std::string_view()

Q_IMPLICIT QByteArrayView::operator std::string_view ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 326 of file qbytearrayview.h.

◆ operator[]()

char QByteArrayView::operator[] ( qsizetype n) const
inlinenodiscardconstexpr

Definition at line 198 of file qbytearrayview.h.

◆ rbegin()

const_reverse_iterator QByteArrayView::rbegin ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 317 of file qbytearrayview.h.

◆ rend()

const_reverse_iterator QByteArrayView::rend ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 318 of file qbytearrayview.h.

◆ right()

QByteArrayView QByteArrayView::right ( qsizetype n) const
inlinenodiscardconstexpr

Definition at line 225 of file qbytearrayview.h.

◆ size()

qsizetype QByteArrayView::size ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 194 of file qbytearrayview.h.

◆ slice() [1/2]

QByteArrayView & QByteArrayView::slice ( qsizetype pos)
inlineconstexpr

Definition at line 215 of file qbytearrayview.h.

◆ slice() [2/2]

QByteArrayView & QByteArrayView::slice ( qsizetype pos,
qsizetype n )
inlineconstexpr

Definition at line 217 of file qbytearrayview.h.

◆ sliced() [1/2]

QByteArrayView QByteArrayView::sliced ( qsizetype pos) const
inlinenodiscardconstexpr

Definition at line 210 of file qbytearrayview.h.

◆ sliced() [2/2]

QByteArrayView QByteArrayView::sliced ( qsizetype pos,
qsizetype n ) const
inlinenodiscardconstexpr

Definition at line 212 of file qbytearrayview.h.

◆ startsWith() [1/2]

bool QByteArrayView::startsWith ( char c) const
inlinenodiscardconstexprnoexcept

Definition at line 276 of file qbytearrayview.h.

◆ startsWith() [2/2]

bool QByteArrayView::startsWith ( QByteArrayView other) const
inlinenodiscardnoexcept

Definition at line 274 of file qbytearrayview.h.

◆ toByteArray()

QByteArray QByteArrayView::toByteArray ( ) const
inlinenodiscard

Definition at line 844 of file qbytearray.h.

◆ toDouble()

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

Definition at line 266 of file qbytearrayview.h.

◆ toFloat()

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

Definition at line 259 of file qbytearrayview.h.

◆ toInt()

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

Definition at line 247 of file qbytearrayview.h.

◆ toLong()

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

Definition at line 251 of file qbytearrayview.h.

◆ toLongLong()

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

Definition at line 255 of file qbytearrayview.h.

◆ toShort()

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

Definition at line 243 of file qbytearrayview.h.

◆ toUInt()

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

Definition at line 249 of file qbytearrayview.h.

◆ toULong()

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

Definition at line 253 of file qbytearrayview.h.

◆ toULongLong()

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

Definition at line 257 of file qbytearrayview.h.

◆ toUShort()

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

Definition at line 245 of file qbytearrayview.h.

◆ trimmed()

QByteArrayView QByteArrayView::trimmed ( ) const
inlinenodiscardnoexcept

Definition at line 241 of file qbytearrayview.h.

◆ truncate()

void QByteArrayView::truncate ( qsizetype n)
inlineconstexpr

Definition at line 235 of file qbytearrayview.h.

◆ comparesEqual [1/3]

Q_CORE_EXPORT bool comparesEqual ( const QByteArrayView & lhs,
char16_t rhs )
friend

Definition at line 6735 of file qstring.cpp.

◆ comparesEqual [2/3]

bool comparesEqual ( const QByteArrayView & lhs,
const QByteArrayView & rhs )
friend

Definition at line 358 of file qbytearrayview.h.

◆ comparesEqual [3/3]

Q_CORE_EXPORT bool comparesEqual ( const QByteArrayView & lhs,
const QChar & rhs )
friend

Definition at line 6724 of file qstring.cpp.

◆ compareThreeWay [1/3]

Q_CORE_EXPORT Qt::strong_ordering compareThreeWay ( const QByteArrayView & lhs,
char16_t rhs )
friend

Definition at line 6740 of file qstring.cpp.

◆ compareThreeWay [2/3]

Qt::strong_ordering compareThreeWay ( const QByteArrayView & lhs,
const QByteArrayView & rhs )
friend

Definition at line 364 of file qbytearrayview.h.

◆ compareThreeWay [3/3]

Q_CORE_EXPORT Qt::strong_ordering compareThreeWay ( const QByteArrayView & lhs,
const QChar & rhs )
friend

Definition at line 6729 of file qstring.cpp.


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