diff options
Diffstat (limited to 'src/corelib/tools/qringbuffer.cpp')
-rw-r--r-- | src/corelib/tools/qringbuffer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/tools/qringbuffer.cpp b/src/corelib/tools/qringbuffer.cpp index c3cb60a6f0..7e2d909dcd 100644 --- a/src/corelib/tools/qringbuffer.cpp +++ b/src/corelib/tools/qringbuffer.cpp @@ -317,6 +317,20 @@ qint64 QRingBuffer::peek(char *data, qint64 maxLength, qint64 pos) const /*! \internal + Append bytes from data to the end +*/ +void QRingBuffer::append(const char *data, qint64 size) +{ + char *writePointer = reserve(size); + if (size == 1) + *writePointer = *data; + else if (size) + ::memcpy(writePointer, data, size); +} + +/*! + \internal + Append a new buffer to the end */ void QRingBuffer::append(const QByteArray &qba) |