18#include <QtCore/private/qglobal_p.h>
20#include <QtCore/qlist.h>
32 qint64 bufferCompleteSize = 0;
42 if (!
buffers.isEmpty() && firstPos > 0) {
54 bufferCompleteSize +=
other.byteAmount();
56 if (
other.firstPos > 0)
65 auto otherBufferCount =
other.bufferCount();
66 auto otherByteAmount =
other.byteAmount();
68 bufferCompleteSize += otherByteAmount;
70 if (
other.firstPos > 0)
84 bufferCompleteSize += bd.size();
100 bufferCompleteSize += bd.size();
101 buffers.prepend(std::move(bd));
110 bufferCompleteSize -=
buffers.first().size();
126 if constexpr (
sizeof(
qsizetype) ==
sizeof(
int)) {
130 if (amount > INT_MAX)
144 qint64 originalAmount = amount;
145 char *writeDst =
dst;
150 if (amount >= firstSize) {
152 bufferCompleteSize -= firstSize;
154 memcpy(writeDst,
first.constData() + firstPos, firstSize);
155 writeDst += firstSize;
160 bufferCompleteSize -= amount;
161 memcpy(writeDst,
first.constData() + firstPos, amount);
167 return originalAmount;
201 while (newPos >=
size) {
202 bufferCompleteSize -= (
size - firstPos);
212 bufferCompleteSize -= newPos;
214 bufferCompleteSize -= newPos - firstPos;
222 "Cannot read a char from an empty buffer!");
231 bufferCompleteSize = 0;
238 return bufferCompleteSize;
257 return buffers.first().size() - firstPos;
271 if (
buffers.at(
i).indexOf(
'\n', firstPos) != -1)
constexpr QByteArrayView first(qsizetype n) const
constexpr const_pointer constData() const noexcept
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.
QByteArray first(qsizetype n) const
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
void append(const QByteDataBuffer &other)
void advanceReadPointer(qint64 distance)
QByteArray read(qint64 amount)
static void popFront(QByteArray &ba, qint64 n)
void append(QByteArray &&bd)
qint64 sizeNextBlock() const
QByteArray & operator[](qsizetype i)
qint64 read(char *dst, qint64 amount)
void append(const QByteArray &bd)
QByteArrayView readPointer() const
qsizetype bufferCount() const
void append(QByteDataBuffer &&other)
void prepend(const QByteArray &bd)
void prepend(QByteArray &&bd)
qint64 byteAmount() const
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
GLuint const GLuint * buffers
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLsizei GLfloat distance
#define Q_ASSERT_X(cond, x, msg)