diff options
Diffstat (limited to 'src/corelib/io/qnoncontiguousbytedevice_p.h')
-rw-r--r-- | src/corelib/io/qnoncontiguousbytedevice_p.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h index c570480d85..94d8e5ef9c 100644 --- a/src/corelib/io/qnoncontiguousbytedevice_p.h +++ b/src/corelib/io/qnoncontiguousbytedevice_p.h @@ -55,9 +55,10 @@ #include <QtCore/qbytearray.h> #include <QtCore/qbuffer.h> #include <QtCore/qiodevice.h> -#include <QtCore/QSharedPointer> #include "private/qringbuffer_p.h" +#include <memory> + QT_BEGIN_NAMESPACE class Q_CORE_EXPORT QNonContiguousByteDevice : public QObject @@ -85,13 +86,13 @@ class Q_CORE_EXPORT QNonContiguousByteDeviceFactory { public: static QNonContiguousByteDevice *create(QIODevice *device); - static QSharedPointer<QNonContiguousByteDevice> createShared(QIODevice *device); + static std::shared_ptr<QNonContiguousByteDevice> createShared(QIODevice *device); static QNonContiguousByteDevice *create(QByteArray *byteArray); - static QSharedPointer<QNonContiguousByteDevice> createShared(QByteArray *byteArray); + static std::shared_ptr<QNonContiguousByteDevice> createShared(QByteArray *byteArray); - static QNonContiguousByteDevice *create(QSharedPointer<QRingBuffer> ringBuffer); - static QSharedPointer<QNonContiguousByteDevice> createShared(QSharedPointer<QRingBuffer> ringBuffer); + static QNonContiguousByteDevice *create(std::shared_ptr<QRingBuffer> ringBuffer); + static std::shared_ptr<QNonContiguousByteDevice> createShared(std::shared_ptr<QRingBuffer> ringBuffer); static QIODevice *wrap(QNonContiguousByteDevice *byteDevice); }; @@ -119,7 +120,7 @@ protected: class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice { public: - explicit QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb); + explicit QNonContiguousByteDeviceRingBufferImpl(std::shared_ptr<QRingBuffer> rb); ~QNonContiguousByteDeviceRingBufferImpl(); const char *readPointer(qint64 maximumLength, qint64 &len) override; bool advanceReadPointer(qint64 amount) override; @@ -129,8 +130,8 @@ public: qint64 pos() const override; protected: - QSharedPointer<QRingBuffer> ringBuffer; - qint64 currentPosition; + std::shared_ptr<QRingBuffer> ringBuffer; + qint64 currentPosition = 0; }; class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice |