18#include <QtCore/private/qglobal_p.h>
19#include <QtCore/qbytearray.h>
20#include <QtCore/qlist.h>
24#ifndef QRINGBUFFER_CHUNKSIZE
25#define QRINGBUFFER_CHUNKSIZE 4096
38 chunk(qba), tailOffset(qba.size())
42 chunk(std::move(qba)), tailOffset(chunk.size())
59 Q_CORE_EXPORT
void detach();
69 return tailOffset - headOffset;
77 return chunk.
size() - tailOffset;
79 inline const char *
data()
const
87 return chunk.
data() + headOffset;
109 tailOffset = qba.
size();
113 chunk = std::move(qba);
115 tailOffset = chunk.
size();
119 headOffset = tailOffset = 0;
138 bufferSize(0), basicBlockSize(growth) { }
143 inline
void setChunkSize(
int size) {
144 basicBlockSize =
size;
148 return basicBlockSize;
160 Q_CORE_EXPORT
void free(
qint64 bytes);
162 Q_CORE_EXPORT
char *reserveFront(
qint64 bytes);
170 Q_CORE_EXPORT
void chop(
qint64 bytes);
173 return bufferSize == 0;
179 char c = *readPointer();
191 char *
ptr = reserveFront(1);
200 Q_CORE_EXPORT
void clear();
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
void swap(QByteArray &other) noexcept
QRingBuffer(QRingBuffer &&) noexcept=default
const char * readPointer() const
qint64 skip(qint64 length)
void truncate(qint64 pos)
qint64 indexOf(char c) const
QRingBuffer(int growth=QRINGBUFFER_CHUNKSIZE)
qint64 nextDataBlockSize() const
void advance(qsizetype offset)
void allocate(qsizetype alloc)
void grow(qsizetype offset)
QRingChunk() noexcept=default
qsizetype available() const
const char * data() const
qsizetype capacity() const
void assign(const QByteArray &qba)
Q_CORE_EXPORT void detach()
QRingChunk(const QByteArray &qba) noexcept
QByteArray toByteArray() &&
QRingChunk(QByteArray &&qba) noexcept
void swap(QRingChunk &other) noexcept
void assign(QByteArray &&qba)
list append(new Employee("Blackpool", "Stephen"))
Combined button and popup list for selecting options.
static ControlElement< T > * ptr(QWidget *widget)
constexpr const T & qMin(const T &a, const T &b)
GLuint const GLuint * buffers
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
#define QRINGBUFFER_CHUNKSIZE
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
ReturnedValue read(const char *data)