summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qnoncontiguousbytedevice_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-20 09:30:00 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-20 21:09:00 +0200
commitb6cd3bca280bd81e932ff51a3ec2b9fc70231646 (patch)
treef77332d26736b7b112dfc0737555d08ffac40975 /src/corelib/io/qnoncontiguousbytedevice_p.h
parent80a2878e201f294697d69b7606571a036c36a19d (diff)
Whitespace cleanup in corelib/iov6.0.0-beta2
Selective application of clang-format to follow our coding style where it is significantly off. Change-Id: I0ff4ed146fe53922691d5473d0c236f31d478a04 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/io/qnoncontiguousbytedevice_p.h')
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice_p.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h
index bbc4ea5ae2..aa762766af 100644
--- a/src/corelib/io/qnoncontiguousbytedevice_p.h
+++ b/src/corelib/io/qnoncontiguousbytedevice_p.h
@@ -64,7 +64,7 @@ class Q_CORE_EXPORT QNonContiguousByteDevice : public QObject
{
Q_OBJECT
public:
- virtual const char* readPointer(qint64 maximumLength, qint64 &len) = 0;
+ virtual const char *readPointer(qint64 maximumLength, qint64 &len) = 0;
virtual bool advanceReadPointer(qint64 amount) = 0;
virtual bool atEnd() const = 0;
virtual qint64 pos() const { return -1; }
@@ -76,7 +76,6 @@ public:
protected:
QNonContiguousByteDevice();
-
Q_SIGNALS:
void readyRead();
void readProgress(qint64 current, qint64 total);
@@ -85,16 +84,16 @@ Q_SIGNALS:
class Q_CORE_EXPORT QNonContiguousByteDeviceFactory
{
public:
- static QNonContiguousByteDevice* create(QIODevice *device);
+ static QNonContiguousByteDevice *create(QIODevice *device);
static QSharedPointer<QNonContiguousByteDevice> createShared(QIODevice *device);
- static QNonContiguousByteDevice* create(QByteArray *byteArray);
+ static QNonContiguousByteDevice *create(QByteArray *byteArray);
static QSharedPointer<QNonContiguousByteDevice> createShared(QByteArray *byteArray);
- static QNonContiguousByteDevice* create(QSharedPointer<QRingBuffer> ringBuffer);
+ static QNonContiguousByteDevice *create(QSharedPointer<QRingBuffer> ringBuffer);
static QSharedPointer<QNonContiguousByteDevice> createShared(QSharedPointer<QRingBuffer> ringBuffer);
- static QIODevice* wrap(QNonContiguousByteDevice* byteDevice);
+ static QIODevice *wrap(QNonContiguousByteDevice *byteDevice);
};
// the actual implementations
@@ -105,14 +104,15 @@ class QNonContiguousByteDeviceByteArrayImpl : public QNonContiguousByteDevice
public:
QNonContiguousByteDeviceByteArrayImpl(QByteArray *ba);
~QNonContiguousByteDeviceByteArrayImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
qint64 pos() const override;
+
protected:
- QByteArray* byteArray;
+ QByteArray *byteArray;
qint64 currentPosition;
};
@@ -121,33 +121,34 @@ class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice
public:
QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb);
~QNonContiguousByteDeviceRingBufferImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
qint64 pos() const override;
+
protected:
QSharedPointer<QRingBuffer> ringBuffer;
qint64 currentPosition;
};
-
class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice
{
Q_OBJECT
public:
QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d);
~QNonContiguousByteDeviceIoDeviceImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
qint64 pos() const override;
+
protected:
- QIODevice* device;
- QByteArray* currentReadBuffer;
+ QIODevice *device;
+ QByteArray *currentReadBuffer;
qint64 currentReadBufferSize;
qint64 currentReadBufferAmount;
qint64 currentReadBufferPosition;
@@ -162,32 +163,34 @@ class QNonContiguousByteDeviceBufferImpl : public QNonContiguousByteDevice
public:
QNonContiguousByteDeviceBufferImpl(QBuffer *b);
~QNonContiguousByteDeviceBufferImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ const char *readPointer(qint64 maximumLength, qint64 &len) override;
bool advanceReadPointer(qint64 amount) override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
+
protected:
- QBuffer* buffer;
+ QBuffer *buffer;
QByteArray byteArray;
- QNonContiguousByteDeviceByteArrayImpl* arrayImpl;
+ QNonContiguousByteDeviceByteArrayImpl *arrayImpl;
};
// ... and the reverse thing
class QByteDeviceWrappingIoDevice : public QIODevice
{
public:
- QByteDeviceWrappingIoDevice (QNonContiguousByteDevice *bd);
- ~QByteDeviceWrappingIoDevice ();
+ QByteDeviceWrappingIoDevice(QNonContiguousByteDevice *bd);
+ ~QByteDeviceWrappingIoDevice();
bool isSequential() const override;
bool atEnd() const override;
bool reset() override;
qint64 size() const override;
+
protected:
qint64 readData(char *data, qint64 maxSize) override;
qint64 writeData(const char *data, qint64 maxSize) override;
- QNonContiguousByteDevice *byteDevice;
+ QNonContiguousByteDevice *byteDevice;
};
QT_END_NAMESPACE