Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QCborStreamReaderPrivate Class Reference
+ Collaboration diagram for QCborStreamReaderPrivate:

Classes

struct  ReadStringChunk
 

Public Types

enum  { MaxCborIndividualSize = 9 , IdealIoBufferSize = 256 }
 

Public Member Functions

 QCborStreamReaderPrivate (const QByteArray &data)
 
 QCborStreamReaderPrivate (QIODevice *device)
 
 ~QCborStreamReaderPrivate ()
 
void setDevice (QIODevice *dev)
 
void initDecoder ()
 
char * bufferPtr ()
 
void preread ()
 
void handleError (CborError err) noexcept
 
bool readFullString (ReadStringChunk params)
 
QCborStreamReader::StringResult< qsizetypereadStringChunk (ReadStringChunk params)
 
qsizetype readStringChunk_byte (ReadStringChunk params, qsizetype len)
 
qsizetype readStringChunk_unicode (ReadStringChunk params, qsizetype utf8len)
 
qsizetype readStringChunk_utf8 (ReadStringChunk params, qsizetype utf8len)
 
bool ensureStringIteration ()
 

Static Public Member Functions

static QCborStreamReader::StringResultCode appendStringChunk (QCborStreamReader &reader, QByteArray *data)
 

Public Attributes

QIODevicedevice
 
QByteArray buffer
 
QStack< CborValue > containerStack
 
CborParser parser
 
CborValue currentElement
 
QCborError lastError = {}
 
QByteArray::size_type bufferStart = 0
 
bool corrupt = false
 

Detailed Description

Definition at line 515 of file qcborstreamreader.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxCborIndividualSize 
IdealIoBufferSize 

Definition at line 518 of file qcborstreamreader.cpp.

Constructor & Destructor Documentation

◆ QCborStreamReaderPrivate() [1/2]

QCborStreamReaderPrivate::QCborStreamReaderPrivate ( const QByteArray & data)
inline

Definition at line 536 of file qcborstreamreader.cpp.

References initDecoder().

+ Here is the call graph for this function:

◆ QCborStreamReaderPrivate() [2/2]

QCborStreamReaderPrivate::QCborStreamReaderPrivate ( QIODevice * device)
inline

Definition at line 542 of file qcborstreamreader.cpp.

References device, and setDevice().

+ Here is the call graph for this function:

◆ ~QCborStreamReaderPrivate()

QCborStreamReaderPrivate::~QCborStreamReaderPrivate ( )
inline

Definition at line 547 of file qcborstreamreader.cpp.

Member Function Documentation

◆ appendStringChunk()

QCborStreamReader::StringResultCode QCborStreamReaderPrivate::appendStringChunk ( QCborStreamReader & reader,
QByteArray * data )
inlinestatic

Definition at line 1613 of file qcborstreamreader.cpp.

References QCborStreamReader::EndOfString, and QCborError::NoError.

Referenced by qt_cbor_append_string_chunk().

+ Here is the caller graph for this function:

◆ bufferPtr()

char * QCborStreamReaderPrivate::bufferPtr ( )
inline

Definition at line 574 of file qcborstreamreader.cpp.

References bufferStart, and Q_ASSERT.

Referenced by preread().

+ Here is the caller graph for this function:

◆ ensureStringIteration()

bool QCborStreamReaderPrivate::ensureStringIteration ( )

Definition at line 699 of file qcborstreamreader.cpp.

References currentElement, and handleError().

Referenced by readStringChunk().

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

◆ handleError()

void QCborStreamReaderPrivate::handleError ( CborError err)
inlinenoexcept

Definition at line 604 of file qcborstreamreader.cpp.

References corrupt, lastError, and Q_ASSERT.

Referenced by ensureStringIteration(), initDecoder(), QCborStreamReader::leaveContainer(), QCborStreamReader::length(), QCborStreamReader::next(), readStringChunk(), readStringChunk_byte(), readStringChunk_unicode(), readStringChunk_utf8(), and QCborStreamReader::reparse().

+ Here is the caller graph for this function:

◆ initDecoder()

void QCborStreamReaderPrivate::initDecoder ( )
inline

Definition at line 558 of file qcborstreamreader.cpp.

References bufferStart, QList< T >::clear(), containerStack, currentElement, device, handleError(), IdealIoBufferSize, lastError, QCborError::NoError, parser, and preread().

Referenced by QCborStreamReaderPrivate(), QCborStreamReader::reset(), and setDevice().

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

◆ preread()

void QCborStreamReaderPrivate::preread ( )
inline

Definition at line 580 of file qcborstreamreader.cpp.

References bufferPtr(), bufferStart, QIODevice::bytesAvailable(), device, IdealIoBufferSize, MaxCborIndividualSize, QIODevice::peek(), Q_ASSERT, read(), QIODevice::size(), and QIODevice::skip().

Referenced by initDecoder(), readStringChunk(), and QCborStreamReader::reparse().

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

◆ readFullString()

bool QCborStreamReaderPrivate::readFullString ( ReadStringChunk params)

Definition at line 1428 of file qcborstreamreader.cpp.

References QCborStreamReader::EndOfString, lastError, ok, QCborStreamReader::Ok, Q_ASSERT, and readStringChunk().

+ Here is the call graph for this function:

◆ readStringChunk()

Q_NEVER_INLINE QCborStreamReader::StringResult< qsizetype > QCborStreamReaderPrivate::readStringChunk ( ReadStringChunk params)

Definition at line 1622 of file qcborstreamreader.cpp.

References bufferStart, currentElement, QCborStreamReader::StringResult< Container >::data, device, QCborStreamReader::EndOfString, ensureStringIteration(), QCborStreamReader::Error, handleError(), lastError, QCborStreamReader::Ok, preread(), ptr(), readStringChunk_byte(), readStringChunk_unicode(), readStringChunk_utf8(), and QIODevice::skip().

Referenced by readFullString(), and QCborStreamReader::readStringChunk().

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

◆ readStringChunk_byte()

qsizetype QCborStreamReaderPrivate::readStringChunk_byte ( ReadStringChunk params,
qsizetype len )
inline

Definition at line 1723 of file qcborstreamreader.cpp.

References bufferStart, device, handleError(), QByteArray::max_size(), ptr(), qAddOverflow(), QT_CATCH, QT_TRY, QIODevice::read(), and QIODevice::skip().

Referenced by readStringChunk(), and readStringChunk_utf8().

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

◆ readStringChunk_unicode()

qsizetype QCborStreamReaderPrivate::readStringChunk_unicode ( ReadStringChunk params,
qsizetype utf8len )
inline

Definition at line 1782 of file qcborstreamreader.cpp.

References begin(), bufferStart, QStringConverterBase::ConvertInitialBom, QUtf8::convertToUnicode(), device, handleError(), QStringConverterBase::State::invalidChars, QString::max_size(), ptr(), Q_ASSERT, qMin(), QT_CATCH, QT_TRY, QIODevice::read(), QStringConverterBase::State::remainingChars, and QStringConverterBase::Stateless.

Referenced by readStringChunk().

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

◆ readStringChunk_utf8()

qsizetype QCborStreamReaderPrivate::readStringChunk_utf8 ( ReadStringChunk params,
qsizetype utf8len )
inline

Definition at line 1839 of file qcborstreamreader.cpp.

References handleError(), QtPrivate::isValidUtf8(), QByteArrayView::last(), and readStringChunk_byte().

Referenced by readStringChunk().

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

◆ setDevice()

void QCborStreamReaderPrivate::setDevice ( QIODevice * dev)
inline

Definition at line 551 of file qcborstreamreader.cpp.

References device, and initDecoder().

Referenced by QCborStreamReaderPrivate(), and QCborStreamReader::setDevice().

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

Member Data Documentation

◆ buffer

QByteArray QCborStreamReaderPrivate::buffer

Definition at line 526 of file qcborstreamreader.cpp.

Referenced by QCborStreamReader::addData().

◆ bufferStart

◆ containerStack

QStack<CborValue> QCborStreamReaderPrivate::containerStack

◆ corrupt

bool QCborStreamReaderPrivate::corrupt = false

Definition at line 534 of file qcborstreamreader.cpp.

Referenced by handleError(), and QCborStreamReader::leaveContainer().

◆ currentElement

◆ device

◆ lastError

◆ parser

CborParser QCborStreamReaderPrivate::parser

Definition at line 529 of file qcborstreamreader.cpp.

Referenced by initDecoder().


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