diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-11-13 18:59:09 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-12-08 21:51:27 +0100 |
commit | 8e34d49201b46b1e16cd3a8c99236f03a8250ff9 (patch) | |
tree | 8dd1761408f0f2fc6663d8d45d2df50b7efa1891 /src/corelib/text/qbytearray.h | |
parent | 8da5d35ae8ef0342adddf11705cad8ed60f871ad (diff) |
Use the QByteArray::DataPointer typedef instead of QByteArrayData
The goal here is to move things over to QArrayDataPointer. This prepares
for it.
Change-Id: I32f54a47594274799600c618f7341c200ceaa306
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/text/qbytearray.h')
-rw-r--r-- | src/corelib/text/qbytearray.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index e4291eae4e..19bf4fa1e5 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -136,10 +136,14 @@ struct QByteArrayData class Q_CORE_EXPORT QByteArray { +public: + using DataPointer = QByteArrayData; private: typedef QTypedArrayData<char> Data; + DataPointer d; public: + enum Base64Option { Base64Encoding = 0, Base64UrlEncoding = 1, @@ -417,14 +421,14 @@ public: int length() const { return int(d.size); } bool isNull() const; - explicit inline QByteArray(const QByteArrayData &dd) + inline DataPointer &data_ptr() { return d; } + explicit inline QByteArray(const DataPointer &dd) : d(dd) { } private: operator QNoImplicitBoolCast() const; - QByteArrayData d; void reallocData(uint alloc, Data::ArrayOptions options); void expand(int i); QByteArray nulTerminated() const; @@ -440,9 +444,6 @@ private: friend class QString; friend Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, int nbytes); -public: - typedef QByteArrayData DataPtr; - inline DataPtr &data_ptr() { return d; } }; Q_DECLARE_OPERATORS_FOR_FLAGS(QByteArray::Base64Options) |