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
QRingBuffer Class Reference

#include <qringbuffer_p.h>

+ Collaboration diagram for QRingBuffer:

Public Member Functions

 QRingBuffer (int growth=QRINGBUFFER_CHUNKSIZE)
 
 QRingBuffer (QRingBuffer &&) noexcept=default
 
QRingBufferoperator= (QRingBuffer &&) noexcept=default
 
void setChunkSize (int size)
 
int chunkSize () const
 
qint64 nextDataBlockSize () const
 
const char * readPointer () const
 
Q_CORE_EXPORT const char * readPointerAtPosition (qint64 pos, qint64 &length) const
 
Q_CORE_EXPORT void free (qint64 bytes)
 
Q_CORE_EXPORT char * reserve (qint64 bytes)
 
Q_CORE_EXPORT char * reserveFront (qint64 bytes)
 
void truncate (qint64 pos)
 
Q_CORE_EXPORT void chop (qint64 bytes)
 
bool isEmpty () const
 
int getChar ()
 
void putChar (char c)
 
void ungetChar (char c)
 
qint64 size () const
 
Q_CORE_EXPORT void clear ()
 
qint64 indexOf (char c) const
 
Q_CORE_EXPORT qint64 indexOf (char c, qint64 maxLength, qint64 pos=0) const
 
Q_CORE_EXPORT qint64 read (char *data, qint64 maxLength)
 
Q_CORE_EXPORT QByteArray read ()
 
Q_CORE_EXPORT qint64 peek (char *data, qint64 maxLength, qint64 pos=0) const
 
Q_CORE_EXPORT void append (const char *data, qint64 size)
 
Q_CORE_EXPORT void append (const QByteArray &qba)
 
Q_CORE_EXPORT void append (QByteArray &&qba)
 
qint64 skip (qint64 length)
 
Q_CORE_EXPORT qint64 readLine (char *data, qint64 maxLength)
 
bool canReadLine () const
 

Detailed Description

Definition at line 133 of file qringbuffer_p.h.

Constructor & Destructor Documentation

◆ QRingBuffer() [1/2]

QRingBuffer::QRingBuffer ( int growth = QRINGBUFFER_CHUNKSIZE)
inlineexplicit

Definition at line 137 of file qringbuffer_p.h.

◆ QRingBuffer() [2/2]

QRingBuffer::QRingBuffer ( QRingBuffer && )
defaultnoexcept

Member Function Documentation

◆ append() [1/3]

void QRingBuffer::append ( const char * data,
qint64 size )

Append bytes from data to the end

Definition at line 300 of file qringbuffer.cpp.

◆ append() [2/3]

void QRingBuffer::append ( const QByteArray & qba)

Append a new buffer to the end

Definition at line 319 of file qringbuffer.cpp.

◆ append() [3/3]

void QRingBuffer::append ( QByteArray && qba)

Append a new buffer to the end

Definition at line 333 of file qringbuffer.cpp.

◆ canReadLine()

bool QRingBuffer::canReadLine ( ) const
inline

Definition at line 219 of file qringbuffer_p.h.

◆ chop()

void QRingBuffer::chop ( qint64 bytes)

Definition at line 164 of file qringbuffer.cpp.

◆ chunkSize()

int QRingBuffer::chunkSize ( ) const
inline

Definition at line 147 of file qringbuffer_p.h.

◆ clear()

void QRingBuffer::clear ( )

Definition at line 197 of file qringbuffer.cpp.

◆ free()

void QRingBuffer::free ( qint64 bytes)

Definition at line 73 of file qringbuffer.cpp.

◆ getChar()

int QRingBuffer::getChar ( )
inline

Definition at line 176 of file qringbuffer_p.h.

References isEmpty(), and readPointer().

+ Here is the call graph for this function:

◆ indexOf() [1/2]

qint64 QRingBuffer::indexOf ( char c) const
inline

Definition at line 201 of file qringbuffer_p.h.

◆ indexOf() [2/2]

qint64 QRingBuffer::indexOf ( char c,
qint64 maxLength,
qint64 pos = 0 ) const

Definition at line 207 of file qringbuffer.cpp.

◆ isEmpty()

bool QRingBuffer::isEmpty ( ) const
inline

Definition at line 172 of file qringbuffer_p.h.

Referenced by getChar().

+ Here is the caller graph for this function:

◆ nextDataBlockSize()

qint64 QRingBuffer::nextDataBlockSize ( ) const
inline

Definition at line 151 of file qringbuffer_p.h.

◆ operator=()

QRingBuffer & QRingBuffer::operator= ( QRingBuffer && )
defaultnoexcept

◆ peek()

qint64 QRingBuffer::peek ( char * data,
qint64 maxLength,
qint64 pos = 0 ) const

Peek the bytes from a specified position

Definition at line 272 of file qringbuffer.cpp.

◆ putChar()

void QRingBuffer::putChar ( char c)
inline

Definition at line 184 of file qringbuffer_p.h.

◆ read() [1/2]

QByteArray QRingBuffer::read ( )

Read an unspecified amount (will read the first buffer)

Definition at line 258 of file qringbuffer.cpp.

◆ read() [2/2]

qint64 QRingBuffer::read ( char * data,
qint64 maxLength )

Definition at line 238 of file qringbuffer.cpp.

◆ readLine()

qint64 QRingBuffer::readLine ( char * data,
qint64 maxLength )

Definition at line 343 of file qringbuffer.cpp.

◆ readPointer()

const char * QRingBuffer::readPointer ( ) const
inline

Definition at line 155 of file qringbuffer_p.h.

Referenced by getChar().

+ Here is the caller graph for this function:

◆ readPointerAtPosition()

const char * QRingBuffer::readPointerAtPosition ( qint64 pos,
qint64 & length ) const

Access the bytes at a specified position the out-variable length will contain the amount of bytes readable from there, e.g. the amount still the same QByteArray

Definition at line 56 of file qringbuffer.cpp.

◆ reserve()

char * QRingBuffer::reserve ( qint64 bytes)

Definition at line 106 of file qringbuffer.cpp.

◆ reserveFront()

char * QRingBuffer::reserveFront ( qint64 bytes)

Allocate data at buffer head

Definition at line 136 of file qringbuffer.cpp.

◆ setChunkSize()

void QRingBuffer::setChunkSize ( int size)
inline

Definition at line 143 of file qringbuffer_p.h.

◆ size()

qint64 QRingBuffer::size ( ) const
inline

Definition at line 196 of file qringbuffer_p.h.

◆ skip()

qint64 QRingBuffer::skip ( qint64 length)
inline

Definition at line 210 of file qringbuffer_p.h.

◆ truncate()

void QRingBuffer::truncate ( qint64 pos)
inline

Definition at line 164 of file qringbuffer_p.h.

◆ ungetChar()

void QRingBuffer::ungetChar ( char c)
inline

Definition at line 189 of file qringbuffer_p.h.


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