Qt 6.x
The Qt SDK
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
 
QCborStreamReader::StringResult< qsizetypereadStringChunk (ReadStringChunk params)
 
qsizetype readStringChunk_byte (ReadStringChunk params, qsizetype len)
 
qsizetype readStringChunk_unicode (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 1427 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 696 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(), 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:

◆ readStringChunk()

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

Definition at line 1436 of file qcborstreamreader.cpp.

References bufferStart, currentElement, device, QCborStreamReader::EndOfString, ensureStringIteration(), QCborStreamReader::Error, handleError(), lastError, QCborStreamReader::Ok, preread(), ptr(), readStringChunk_byte(), readStringChunk_unicode(), and QIODevice::skip().

Referenced by 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 1529 of file qcborstreamreader.cpp.

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

Referenced by readStringChunk().

+ 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 1588 of file qcborstreamreader.cpp.

References begin(), bufferStart, QStringConverterBase::ConvertInitialBom, QUtf8::convertToUnicode(), QVarLengthArray< T, Prealloc >::data(), device, handleError(), QStringConverterBase::State::invalidChars, MaxStringSize, ptr(), 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:

◆ 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: