KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Private Attributes | List of all members
QRingBuffer Class Reference

#include <qringbuffer_p.h>

Public Member Functions

void append (const QByteArray &qba)
 
bool canReadLine () const
 
void chop (int bytes)
 
void clear ()
 
void free (int bytes)
 
int getChar ()
 
int indexOf (char c) const
 
int indexOf (char c, int maxLength) const
 
bool isEmpty () const
 
int nextDataBlockSize () const
 
QByteArray peek (int maxLength) const
 
void putChar (char c)
 
 QRingBuffer (int growth=4096)
 
int read (char *data, int maxLength)
 
QByteArray read (int maxLength)
 
QByteArray read ()
 
QByteArray readAll ()
 
int readLine (char *data, int maxLength)
 
const char * readPointer () const
 
const char * readPointerAtPosition (qint64 pos, qint64 &length) const
 
char * reserve (int bytes)
 
int size () const
 
int skip (int length)
 
void truncate (int pos)
 
void ungetChar (char c)
 

Private Attributes

int basicBlockSize
 
QList< QByteArray > buffers
 
int bufferSize
 
int head
 
int tail
 
int tailBuffer
 

Constructor & Destructor Documentation

QRingBuffer::QRingBuffer ( int  growth = 4096)
inline

References buffers, and clear().

Member Function Documentation

void QRingBuffer::append ( const QByteArray &  qba)
inline

References buffers, bufferSize, tail, and tailBuffer.

bool QRingBuffer::canReadLine ( ) const
inline

References indexOf().

void QRingBuffer::chop ( int  bytes)
inline

References buffers, bufferSize, clear(), head, isEmpty(), tail, and tailBuffer.

Referenced by truncate().

void QRingBuffer::clear ( )
inline

References buffers, bufferSize, head, tail, and tailBuffer.

Referenced by chop(), free(), and QRingBuffer().

void QRingBuffer::free ( int  bytes)
inline
int QRingBuffer::getChar ( )
inline

References c, free(), isEmpty(), and readPointer().

int QRingBuffer::indexOf ( char  c) const
inline

References buffers, head, i, j, tail, and tailBuffer.

Referenced by canReadLine(), and readLine().

int QRingBuffer::indexOf ( char  c,
int  maxLength 
) const
inline

References buffers, head, i, j, size(), tail, and tailBuffer.

bool QRingBuffer::isEmpty ( ) const
inline

References tail, and tailBuffer.

Referenced by chop(), free(), and getChar().

int QRingBuffer::nextDataBlockSize ( ) const
inline

References buffers, head, tail, and tailBuffer.

Referenced by free(), read(), readLine(), and readPointerAtPosition().

QByteArray QRingBuffer::peek ( int  maxLength) const
inline

References buffers, head, i, size(), tail, and tailBuffer.

void QRingBuffer::putChar ( char  c)
inline

References c, and reserve().

int QRingBuffer::read ( char *  data,
int  maxLength 
)
inline
QByteArray QRingBuffer::read ( int  maxLength)
inline

References read(), and size().

QByteArray QRingBuffer::read ( )
inline
QByteArray QRingBuffer::readAll ( )
inline

References read(), and size().

int QRingBuffer::readLine ( char *  data,
int  maxLength 
)
inline
const char* QRingBuffer::readPointer ( ) const
inline

References buffers, and head.

Referenced by getChar(), read(), and readLine().

const char* QRingBuffer::readPointerAtPosition ( qint64  pos,
qint64 &  length 
) const
inline
char* QRingBuffer::reserve ( int  bytes)
inline
int QRingBuffer::size ( ) const
inline
int QRingBuffer::skip ( int  length)
inline

References read().

void QRingBuffer::truncate ( int  pos)
inline

References chop(), and size().

void QRingBuffer::ungetChar ( char  c)
inline

Member Data Documentation

int QRingBuffer::basicBlockSize
private

Referenced by free(), reserve(), and ungetChar().

QList<QByteArray> QRingBuffer::buffers
private
int QRingBuffer::bufferSize
private
int QRingBuffer::head
private
int QRingBuffer::tail
private
int QRingBuffer::tailBuffer
private

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