158 if (maximumLength != -1)
212 if (maximumLength != -1)
248 currentReadBuffer(
nullptr), currentReadBufferSize(16*1024),
249 currentReadBufferAmount(0), currentReadBufferPosition(0), totalAdvancements(0),
273 if (maximumLength == -1)
413 memcpy(
data, readPointer,
len);
470 return std::make_shared<QNonContiguousByteDeviceBufferImpl>(
buffer);
476 return std::make_shared<QNonContiguousByteDeviceIoDeviceImpl>(
device);
498 return std::make_shared<QNonContiguousByteDeviceRingBufferImpl>(std::move(ringBuffer));
520 return std::make_shared<QNonContiguousByteDeviceByteArrayImpl>(byteArray);
542#include "moc_qnoncontiguousbytedevice_p.cpp"
IOBluetoothDevice * device
\inmodule QtCore \reentrant
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.
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
~QByteDeviceWrappingIoDevice()
QNonContiguousByteDevice * byteDevice
qint64 readData(char *data, qint64 maxSize) override
Reads up to maxSize bytes from the device into data, and returns the number of bytes read or -1 if an...
qint64 size() const override
For open random-access devices, this function returns the size of the device.
QByteDeviceWrappingIoDevice(QNonContiguousByteDevice *bd)
bool isSequential() const override
Returns true if this device is sequential; otherwise returns false.
bool atEnd() const override
Returns true if the current read and write position is at the end of the device (i....
bool reset() override
Seeks to the start of input for random-access devices.
qint64 writeData(const char *data, qint64 maxSize) override
Writes up to maxSize bytes from data to the device.
\inmodule QtCore \reentrant
virtual bool open(QIODeviceBase::OpenMode mode)
Opens the device and sets its OpenMode to mode.
void readyRead()
This signal is emitted once every time new data is available for reading from the device's current re...
virtual qint64 size() const
For open random-access devices, this function returns the size of the device.
virtual qint64 pos() const
For random-access devices, this function returns the position that data is written to or read from.
virtual bool isSequential() const
Returns true if this device is sequential; otherwise returns false.
bool getChar(char *c)
Reads one character from the device and stores it in c.
virtual bool seek(qint64 pos)
For random-access devices, this function sets the current position to pos, returning true on success,...
virtual bool reset()
Seeks to the start of input for random-access devices.
virtual bool atEnd() const
Returns true if the current read and write position is at the end of the device (i....
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read.
QNonContiguousByteDeviceByteArrayImpl * arrayImpl
bool advanceReadPointer(qint64 amount) override
will advance the internal read pointer by amount bytes.
bool reset() override
Moves the internal read pointer back to the beginning.
const char * readPointer(qint64 maximumLength, qint64 &len) override
Return a byte pointer for at most maximumLength bytes of that device.
~QNonContiguousByteDeviceBufferImpl()
bool atEnd() const override
Returns true if everything has been read and the read pointer cannot be advanced anymore.
QNonContiguousByteDeviceBufferImpl(QBuffer *b)
qint64 size() const override
Returns the size of the complete device or -1 if unknown.
~QNonContiguousByteDeviceByteArrayImpl()
bool reset() override
Moves the internal read pointer back to the beginning.
qint64 size() const override
Returns the size of the complete device or -1 if unknown.
qint64 pos() const override
bool advanceReadPointer(qint64 amount) override
will advance the internal read pointer by amount bytes.
QNonContiguousByteDeviceByteArrayImpl(QByteArray *ba)
const char * readPointer(qint64 maximumLength, qint64 &len) override
Return a byte pointer for at most maximumLength bytes of that device.
bool atEnd() const override
Returns true if everything has been read and the read pointer cannot be advanced anymore.
static QNonContiguousByteDevice * create(QIODevice *device)
Create a QNonContiguousByteDevice out of a QIODevice.
static std::shared_ptr< QNonContiguousByteDevice > createShared(QIODevice *device)
Create a QNonContiguousByteDevice out of a QIODevice, return it in a std::shared_ptr.
static QIODevice * wrap(QNonContiguousByteDevice *byteDevice)
Wrap the byteDevice (possibly again) into a QIODevice.
QByteArray * currentReadBuffer
qint64 currentReadBufferAmount
~QNonContiguousByteDeviceIoDeviceImpl()
qint64 pos() const override
bool atEnd() const override
Returns true if everything has been read and the read pointer cannot be advanced anymore.
qint64 size() const override
Returns the size of the complete device or -1 if unknown.
bool advanceReadPointer(qint64 amount) override
will advance the internal read pointer by amount bytes.
bool reset() override
Moves the internal read pointer back to the beginning.
qint64 currentReadBufferPosition
const char * readPointer(qint64 maximumLength, qint64 &len) override
Return a byte pointer for at most maximumLength bytes of that device.
qint64 currentReadBufferSize
QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d)
qint64 size() const override
Returns the size of the complete device or -1 if unknown.
qint64 pos() const override
bool atEnd() const override
Returns true if everything has been read and the read pointer cannot be advanced anymore.
bool advanceReadPointer(qint64 amount) override
will advance the internal read pointer by amount bytes.
bool reset() override
Moves the internal read pointer back to the beginning.
const char * readPointer(qint64 maximumLength, qint64 &len) override
Return a byte pointer for at most maximumLength bytes of that device.
QNonContiguousByteDeviceRingBufferImpl(std::shared_ptr< QRingBuffer > rb)
std::shared_ptr< QRingBuffer > ringBuffer
~QNonContiguousByteDeviceRingBufferImpl()
virtual const char * readPointer(qint64 maximumLength, qint64 &len)=0
Return a byte pointer for at most maximumLength bytes of that device.
virtual ~QNonContiguousByteDevice()
virtual qint64 size() const =0
Returns the size of the complete device or -1 if unknown.
QNonContiguousByteDevice()
virtual bool advanceReadPointer(qint64 amount)=0
will advance the internal read pointer by amount bytes.
virtual bool reset()=0
Moves the internal read pointer back to the beginning.
void readyRead()
Emitted when there is data available.
void readProgress(qint64 current, qint64 total)
Emitted when data has been "read" by advancing the read pointer.
virtual bool atEnd() const =0
Returns true if everything has been read and the read pointer cannot be advanced anymore.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void setParent(QObject *parent)
Makes the object a child of parent.
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data