QRingBuffer: purge unused part of the api

Remove unused and untested class functions.

Change-Id: I8eb963db0ae4be9b5cdde91f6747c4a1db4ea649
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Alex Trotsenko 2014-07-18 17:12:12 +03:00
parent ec190b0da7
commit 0078013693

View File

@ -328,17 +328,6 @@ public:
return readSoFar;
}
inline QByteArray read(int maxLength) {
QByteArray tmp;
tmp.resize(qMin(maxLength, size()));
read(tmp.data(), tmp.size());
return tmp;
}
inline QByteArray readAll() {
return read(size());
}
// read an unspecified amount (will read the first buffer)
inline QByteArray read() {
if (bufferSize == 0)
@ -387,28 +376,6 @@ public:
bufferSize += qba.length();
}
inline QByteArray peek(int maxLength) const {
int bytesToRead = qMin(size(), maxLength);
if(maxLength <= 0)
return QByteArray();
QByteArray ret;
ret.resize(bytesToRead);
int readSoFar = 0;
for (int i = 0; readSoFar < bytesToRead && i < buffers.size(); ++i) {
int start = 0;
int end = buffers.at(i).size();
if (i == 0)
start = head;
if (i == tailBuffer)
end = tail;
const int len = qMin(ret.size()-readSoFar, end-start);
memcpy(ret.data()+readSoFar, buffers.at(i).constData()+start, len);
readSoFar += len;
}
Q_ASSERT(readSoFar == ret.size());
return ret;
}
inline int skip(int length) {
return read(0, length);
}