From b6cd3bca280bd81e932ff51a3ec2b9fc70231646 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 20 Oct 2020 09:30:00 +0200 Subject: Whitespace cleanup in corelib/io MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Selective application of clang-format to follow our coding style where it is significantly off. Change-Id: I0ff4ed146fe53922691d5473d0c236f31d478a04 Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø --- src/corelib/io/qnoncontiguousbytedevice_p.h | 41 ++++++++++++++++------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'src/corelib/io/qnoncontiguousbytedevice_p.h') 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 createShared(QIODevice *device); - static QNonContiguousByteDevice* create(QByteArray *byteArray); + static QNonContiguousByteDevice *create(QByteArray *byteArray); static QSharedPointer createShared(QByteArray *byteArray); - static QNonContiguousByteDevice* create(QSharedPointer ringBuffer); + static QNonContiguousByteDevice *create(QSharedPointer ringBuffer); static QSharedPointer createShared(QSharedPointer 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 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 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 -- cgit v1.2.3