1
/****************************************************************************
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of the QtCore module of the Qt Toolkit.
8
** $QT_BEGIN_LICENSE:LGPL$
9
** Commercial License Usage
10
** Licensees holding valid commercial Qt licenses may use this file in
11
** accordance with the commercial license agreement provided with the
12
** Software or, alternatively, in accordance with the terms contained in
13
** a written agreement between you and Digia. For licensing terms and
14
** conditions see http://qt.digia.com/licensing. For further information
15
** use the contact form at http://qt.digia.com/contact-us.
17
** GNU Lesser General Public License Usage
18
** Alternatively, this file may be used under the terms of the GNU Lesser
19
** General Public License version 2.1 as published by the Free Software
20
** Foundation and appearing in the file LICENSE.LGPL included in the
21
** packaging of this file. Please review the following information to
22
** ensure the GNU Lesser General Public License version 2.1 requirements
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25
** In addition, as a special exception, Digia gives you certain additional
26
** rights. These rights are described in the Digia Qt LGPL Exception
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29
** GNU General Public License Usage
30
** Alternatively, this file may be used under the terms of the GNU
31
** General Public License version 3.0 as published by the Free Software
32
** Foundation and appearing in the file LICENSE.GPL included in the
33
** packaging of this file. Please review the following information to
34
** ensure the GNU General Public License version 3.0 requirements will be
35
** met: http://www.gnu.org/copyleft/gpl.html.
40
****************************************************************************/
45
#include <QtCore/qrefcount.h>
46
#include <QtCore/qnamespace.h>
47
#include <QtCore/qarraydata.h>
54
#error qbytearray.h must be included before any header file that defines truncate
57
#if defined(Q_CC_GNU) && (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
58
//There is a bug in GCC 4.0 that tries to instantiate template of annonymous enum
59
# ifdef QT_USE_FAST_OPERATOR_PLUS
60
# undef QT_USE_FAST_OPERATOR_PLUS
62
# ifdef QT_USE_QSTRINGBUILDER
63
# undef QT_USE_QSTRINGBUILDER
74
/*****************************************************************************
75
Safe and portable C string functions; extensions to standard string.h
76
*****************************************************************************/
78
Q_CORE_EXPORT char *qstrdup(const char *);
80
inline uint qstrlen(const char *str)
81
{ return str ? uint(strlen(str)) : 0; }
83
inline uint qstrnlen(const char *str, uint maxlen)
87
while (length < maxlen && *str++)
93
Q_CORE_EXPORT char *qstrcpy(char *dst, const char *src);
94
Q_CORE_EXPORT char *qstrncpy(char *dst, const char *src, uint len);
96
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2);
97
Q_CORE_EXPORT int qstrcmp(const QByteArray &str1, const QByteArray &str2);
98
Q_CORE_EXPORT int qstrcmp(const QByteArray &str1, const char *str2);
99
static inline int qstrcmp(const char *str1, const QByteArray &str2)
100
{ return -qstrcmp(str2, str1); }
102
inline int qstrncmp(const char *str1, const char *str2, uint len)
104
return (str1 && str2) ? strncmp(str1, str2, len)
105
: (str1 ? 1 : (str2 ? -1 : 0));
107
Q_CORE_EXPORT int qstricmp(const char *, const char *);
108
Q_CORE_EXPORT int qstrnicmp(const char *, const char *, uint len);
110
// implemented in qvsnprintf.cpp
111
Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
112
Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt, ...);
114
// qChecksum: Internet checksum
116
Q_CORE_EXPORT quint16 qChecksum(const char *s, uint len);
121
template <typename T> class QList;
123
typedef QArrayData QByteArrayData;
125
template<int N> struct QStaticByteArrayData
130
QByteArrayData *data_ptr() const
132
Q_ASSERT(ba.ref.isStatic());
133
return const_cast<QByteArrayData *>(&ba);
137
struct QByteArrayDataPtr
142
#define Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, offset) \
143
Q_STATIC_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, offset)
146
#define Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER(size) \
147
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, sizeof(QByteArrayData)) \
150
#if defined(Q_COMPILER_LAMBDA)
152
# define QByteArrayLiteral(str) \
153
([]() -> QByteArray { \
154
enum { Size = sizeof(str) - 1 }; \
155
static const QStaticByteArrayData<Size> qbytearray_literal = { \
156
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER(Size), \
158
QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; \
159
const QByteArray ba(holder); \
166
#ifndef QByteArrayLiteral
167
// no lambdas, not GCC, just return a temporary QByteArray
169
# define QByteArrayLiteral(str) QByteArray(str, sizeof(str) - 1)
172
class Q_CORE_EXPORT QByteArray
175
typedef QTypedArrayData<char> Data;
179
QByteArray(const char *, int size = -1);
180
QByteArray(int size, char c);
181
QByteArray(int size, Qt::Initialization);
182
inline QByteArray(const QByteArray &);
183
inline ~QByteArray();
185
QByteArray &operator=(const QByteArray &);
186
QByteArray &operator=(const char *str);
187
#ifdef Q_COMPILER_RVALUE_REFS
188
inline QByteArray(QByteArray && other) : d(other.d) { other.d = Data::sharedNull(); }
189
inline QByteArray &operator=(QByteArray &&other)
190
{ qSwap(d, other.d); return *this; }
193
inline void swap(QByteArray &other) { qSwap(d, other.d); }
195
inline int size() const;
196
bool isEmpty() const;
197
void resize(int size);
199
QByteArray &fill(char c, int size = -1);
201
int capacity() const;
202
void reserve(int size);
205
#ifndef QT_NO_CAST_FROM_BYTEARRAY
206
operator const char *() const;
207
operator const void *() const;
210
const char *data() const;
211
inline const char *constData() const;
212
inline void detach();
213
bool isDetached() const;
214
inline bool isSharedWith(const QByteArray &other) const { return d == other.d; }
217
char at(int i) const;
218
char operator[](int i) const;
219
char operator[](uint i) const;
220
QByteRef operator[](int i);
221
QByteRef operator[](uint i);
223
int indexOf(char c, int from = 0) const;
224
int indexOf(const char *c, int from = 0) const;
225
int indexOf(const QByteArray &a, int from = 0) const;
226
int lastIndexOf(char c, int from = -1) const;
227
int lastIndexOf(const char *c, int from = -1) const;
228
int lastIndexOf(const QByteArray &a, int from = -1) const;
230
bool contains(char c) const;
231
bool contains(const char *a) const;
232
bool contains(const QByteArray &a) const;
233
int count(char c) const;
234
int count(const char *a) const;
235
int count(const QByteArray &a) const;
237
QByteArray left(int len) const;
238
QByteArray right(int len) const;
239
QByteArray mid(int index, int len = -1) const;
241
bool startsWith(const QByteArray &a) const;
242
bool startsWith(char c) const;
243
bool startsWith(const char *c) const;
245
bool endsWith(const QByteArray &a) const;
246
bool endsWith(char c) const;
247
bool endsWith(const char *c) const;
249
void truncate(int pos);
252
QByteArray toLower() const;
253
QByteArray toUpper() const;
255
QByteArray trimmed() const;
256
QByteArray simplified() const;
257
QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
258
QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
260
QByteArray &prepend(char c);
261
QByteArray &prepend(const char *s);
262
QByteArray &prepend(const char *s, int len);
263
QByteArray &prepend(const QByteArray &a);
264
QByteArray &append(char c);
265
QByteArray &append(const char *s);
266
QByteArray &append(const char *s, int len);
267
QByteArray &append(const QByteArray &a);
268
QByteArray &insert(int i, char c);
269
QByteArray &insert(int i, const char *s);
270
QByteArray &insert(int i, const char *s, int len);
271
QByteArray &insert(int i, const QByteArray &a);
272
QByteArray &remove(int index, int len);
273
QByteArray &replace(int index, int len, const char *s);
274
QByteArray &replace(int index, int len, const char *s, int alen);
275
QByteArray &replace(int index, int len, const QByteArray &s);
276
QByteArray &replace(char before, const char *after);
277
QByteArray &replace(char before, const QByteArray &after);
278
QByteArray &replace(const char *before, const char *after);
279
QByteArray &replace(const char *before, int bsize, const char *after, int asize);
280
QByteArray &replace(const QByteArray &before, const QByteArray &after);
281
QByteArray &replace(const QByteArray &before, const char *after);
282
QByteArray &replace(const char *before, const QByteArray &after);
283
QByteArray &replace(char before, char after);
284
QByteArray &operator+=(char c);
285
QByteArray &operator+=(const char *s);
286
QByteArray &operator+=(const QByteArray &a);
288
QList<QByteArray> split(char sep) const;
290
QByteArray repeated(int times) const;
292
#ifndef QT_NO_CAST_TO_ASCII
293
QT_ASCII_CAST_WARN QByteArray &append(const QString &s);
294
QT_ASCII_CAST_WARN QByteArray &insert(int i, const QString &s);
295
QT_ASCII_CAST_WARN QByteArray &replace(const QString &before, const char *after);
296
QT_ASCII_CAST_WARN QByteArray &replace(char c, const QString &after);
297
QT_ASCII_CAST_WARN QByteArray &replace(const QString &before, const QByteArray &after);
299
QT_ASCII_CAST_WARN QByteArray &operator+=(const QString &s);
300
QT_ASCII_CAST_WARN int indexOf(const QString &s, int from = 0) const;
301
QT_ASCII_CAST_WARN int lastIndexOf(const QString &s, int from = -1) const;
303
#ifndef QT_NO_CAST_FROM_ASCII
304
inline QT_ASCII_CAST_WARN bool operator==(const QString &s2) const;
305
inline QT_ASCII_CAST_WARN bool operator!=(const QString &s2) const;
306
inline QT_ASCII_CAST_WARN bool operator<(const QString &s2) const;
307
inline QT_ASCII_CAST_WARN bool operator>(const QString &s2) const;
308
inline QT_ASCII_CAST_WARN bool operator<=(const QString &s2) const;
309
inline QT_ASCII_CAST_WARN bool operator>=(const QString &s2) const;
312
short toShort(bool *ok = 0, int base = 10) const;
313
ushort toUShort(bool *ok = 0, int base = 10) const;
314
int toInt(bool *ok = 0, int base = 10) const;
315
uint toUInt(bool *ok = 0, int base = 10) const;
316
long toLong(bool *ok = 0, int base = 10) const;
317
ulong toULong(bool *ok = 0, int base = 10) const;
318
qlonglong toLongLong(bool *ok = 0, int base = 10) const;
319
qulonglong toULongLong(bool *ok = 0, int base = 10) const;
320
float toFloat(bool *ok = 0) const;
321
double toDouble(bool *ok = 0) const;
322
QByteArray toBase64() const;
323
QByteArray toHex() const;
324
QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
325
const QByteArray &include = QByteArray(),
326
char percent = '%') const;
328
QByteArray &setNum(short, int base = 10);
329
QByteArray &setNum(ushort, int base = 10);
330
QByteArray &setNum(int, int base = 10);
331
QByteArray &setNum(uint, int base = 10);
332
QByteArray &setNum(qlonglong, int base = 10);
333
QByteArray &setNum(qulonglong, int base = 10);
334
QByteArray &setNum(float, char f = 'g', int prec = 6);
335
QByteArray &setNum(double, char f = 'g', int prec = 6);
336
QByteArray &setRawData(const char *a, uint n); // ### Qt 6: use an int
338
static QByteArray number(int, int base = 10);
339
static QByteArray number(uint, int base = 10);
340
static QByteArray number(qlonglong, int base = 10);
341
static QByteArray number(qulonglong, int base = 10);
342
static QByteArray number(double, char f = 'g', int prec = 6);
343
static QByteArray fromRawData(const char *, int size);
344
static QByteArray fromBase64(const QByteArray &base64);
345
static QByteArray fromHex(const QByteArray &hexEncoded);
346
static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
349
typedef char *iterator;
350
typedef const char *const_iterator;
351
typedef iterator Iterator;
352
typedef const_iterator ConstIterator;
354
const_iterator begin() const;
355
const_iterator cbegin() const;
356
const_iterator constBegin() const;
358
const_iterator end() const;
359
const_iterator cend() const;
360
const_iterator constEnd() const;
363
typedef const char & const_reference;
364
typedef char & reference;
365
typedef char value_type;
366
void push_back(char c);
367
void push_back(const char *c);
368
void push_back(const QByteArray &a);
369
void push_front(char c);
370
void push_front(const char *c);
371
void push_front(const QByteArray &a);
373
inline int count() const { return d->size; }
374
int length() const { return d->size; }
377
inline QByteArray(QByteArrayDataPtr dd)
378
: d(reinterpret_cast<Data *>(dd.ptr))
383
operator QNoImplicitBoolCast() const;
385
void reallocData(uint alloc, Data::AllocationOptions options);
387
QByteArray nulTerminated() const;
389
friend class QByteRef;
390
friend class QString;
391
friend Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, int nbytes);
393
typedef Data * DataPtr;
394
inline DataPtr &data_ptr() { return d; }
397
inline QByteArray::QByteArray(): d(Data::sharedNull()) { }
398
inline QByteArray::~QByteArray() { if (!d->ref.deref()) Data::deallocate(d); }
399
inline int QByteArray::size() const
402
inline char QByteArray::at(int i) const
403
{ Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; }
404
inline char QByteArray::operator[](int i) const
405
{ Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; }
406
inline char QByteArray::operator[](uint i) const
407
{ Q_ASSERT(i < uint(size())); return d->data()[i]; }
409
inline bool QByteArray::isEmpty() const
410
{ return d->size == 0; }
411
#ifndef QT_NO_CAST_FROM_BYTEARRAY
412
inline QByteArray::operator const char *() const
413
{ return d->data(); }
414
inline QByteArray::operator const void *() const
415
{ return d->data(); }
417
inline char *QByteArray::data()
418
{ detach(); return d->data(); }
419
inline const char *QByteArray::data() const
420
{ return d->data(); }
421
inline const char *QByteArray::constData() const
422
{ return d->data(); }
423
inline void QByteArray::detach()
424
{ if (d->ref.isShared() || (d->offset != sizeof(QByteArrayData))) reallocData(uint(d->size) + 1u, d->detachFlags()); }
425
inline bool QByteArray::isDetached() const
426
{ return !d->ref.isShared(); }
427
inline QByteArray::QByteArray(const QByteArray &a) : d(a.d)
430
inline int QByteArray::capacity() const
431
{ return d->alloc ? d->alloc - 1 : 0; }
433
inline void QByteArray::reserve(int asize)
435
if (d->ref.isShared() || uint(asize) + 1u > d->alloc) {
436
reallocData(uint(asize) + 1u, d->detachFlags() | Data::CapacityReserved);
438
// cannot set unconditionally, since d could be the shared_null or
440
d->capacityReserved = true;
444
inline void QByteArray::squeeze()
446
if (d->ref.isShared() || uint(d->size) + 1u < d->alloc) {
447
reallocData(uint(d->size) + 1u, d->detachFlags() & ~Data::CapacityReserved);
449
// cannot set unconditionally, since d could be shared_null or
451
d->capacityReserved = false;
455
class Q_CORE_EXPORT QByteRef {
458
inline QByteRef(QByteArray &array, int idx)
460
friend class QByteArray;
462
inline operator char() const
463
{ return i < a.d->size ? a.d->data()[i] : char(0); }
464
inline QByteRef &operator=(char c)
465
{ if (i >= a.d->size) a.expand(i); else a.detach();
466
a.d->data()[i] = c; return *this; }
467
inline QByteRef &operator=(const QByteRef &c)
468
{ if (i >= a.d->size) a.expand(i); else a.detach();
469
a.d->data()[i] = c.a.d->data()[c.i]; return *this; }
470
inline bool operator==(char c) const
471
{ return a.d->data()[i] == c; }
472
inline bool operator!=(char c) const
473
{ return a.d->data()[i] != c; }
474
inline bool operator>(char c) const
475
{ return a.d->data()[i] > c; }
476
inline bool operator>=(char c) const
477
{ return a.d->data()[i] >= c; }
478
inline bool operator<(char c) const
479
{ return a.d->data()[i] < c; }
480
inline bool operator<=(char c) const
481
{ return a.d->data()[i] <= c; }
484
inline QByteRef QByteArray::operator[](int i)
485
{ Q_ASSERT(i >= 0); return QByteRef(*this, i); }
486
inline QByteRef QByteArray::operator[](uint i)
487
{ return QByteRef(*this, i); }
488
inline QByteArray::iterator QByteArray::begin()
489
{ detach(); return d->data(); }
490
inline QByteArray::const_iterator QByteArray::begin() const
491
{ return d->data(); }
492
inline QByteArray::const_iterator QByteArray::cbegin() const
493
{ return d->data(); }
494
inline QByteArray::const_iterator QByteArray::constBegin() const
495
{ return d->data(); }
496
inline QByteArray::iterator QByteArray::end()
497
{ detach(); return d->data() + d->size; }
498
inline QByteArray::const_iterator QByteArray::end() const
499
{ return d->data() + d->size; }
500
inline QByteArray::const_iterator QByteArray::cend() const
501
{ return d->data() + d->size; }
502
inline QByteArray::const_iterator QByteArray::constEnd() const
503
{ return d->data() + d->size; }
504
inline QByteArray &QByteArray::operator+=(char c)
505
{ return append(c); }
506
inline QByteArray &QByteArray::operator+=(const char *s)
507
{ return append(s); }
508
inline QByteArray &QByteArray::operator+=(const QByteArray &a)
509
{ return append(a); }
510
inline void QByteArray::push_back(char c)
512
inline void QByteArray::push_back(const char *c)
514
inline void QByteArray::push_back(const QByteArray &a)
516
inline void QByteArray::push_front(char c)
518
inline void QByteArray::push_front(const char *c)
520
inline void QByteArray::push_front(const QByteArray &a)
522
inline bool QByteArray::contains(const QByteArray &a) const
523
{ return indexOf(a) != -1; }
524
inline bool QByteArray::contains(char c) const
525
{ return indexOf(c) != -1; }
526
inline bool operator==(const QByteArray &a1, const QByteArray &a2)
527
{ return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
528
inline bool operator==(const QByteArray &a1, const char *a2)
529
{ return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
530
inline bool operator==(const char *a1, const QByteArray &a2)
531
{ return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
532
inline bool operator!=(const QByteArray &a1, const QByteArray &a2)
533
{ return !(a1==a2); }
534
inline bool operator!=(const QByteArray &a1, const char *a2)
535
{ return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
536
inline bool operator!=(const char *a1, const QByteArray &a2)
537
{ return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
538
inline bool operator<(const QByteArray &a1, const QByteArray &a2)
539
{ return qstrcmp(a1, a2) < 0; }
540
inline bool operator<(const QByteArray &a1, const char *a2)
541
{ return qstrcmp(a1, a2) < 0; }
542
inline bool operator<(const char *a1, const QByteArray &a2)
543
{ return qstrcmp(a1, a2) < 0; }
544
inline bool operator<=(const QByteArray &a1, const QByteArray &a2)
545
{ return qstrcmp(a1, a2) <= 0; }
546
inline bool operator<=(const QByteArray &a1, const char *a2)
547
{ return qstrcmp(a1, a2) <= 0; }
548
inline bool operator<=(const char *a1, const QByteArray &a2)
549
{ return qstrcmp(a1, a2) <= 0; }
550
inline bool operator>(const QByteArray &a1, const QByteArray &a2)
551
{ return qstrcmp(a1, a2) > 0; }
552
inline bool operator>(const QByteArray &a1, const char *a2)
553
{ return qstrcmp(a1, a2) > 0; }
554
inline bool operator>(const char *a1, const QByteArray &a2)
555
{ return qstrcmp(a1, a2) > 0; }
556
inline bool operator>=(const QByteArray &a1, const QByteArray &a2)
557
{ return qstrcmp(a1, a2) >= 0; }
558
inline bool operator>=(const QByteArray &a1, const char *a2)
559
{ return qstrcmp(a1, a2) >= 0; }
560
inline bool operator>=(const char *a1, const QByteArray &a2)
561
{ return qstrcmp(a1, a2) >= 0; }
562
#if !defined(QT_USE_QSTRINGBUILDER)
563
inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
564
{ return QByteArray(a1) += a2; }
565
inline const QByteArray operator+(const QByteArray &a1, const char *a2)
566
{ return QByteArray(a1) += a2; }
567
inline const QByteArray operator+(const QByteArray &a1, char a2)
568
{ return QByteArray(a1) += a2; }
569
inline const QByteArray operator+(const char *a1, const QByteArray &a2)
570
{ return QByteArray(a1) += a2; }
571
inline const QByteArray operator+(char a1, const QByteArray &a2)
572
{ return QByteArray(&a1, 1) += a2; }
573
#endif // QT_USE_QSTRINGBUILDER
574
inline bool QByteArray::contains(const char *c) const
575
{ return indexOf(c) != -1; }
576
inline QByteArray &QByteArray::replace(char before, const char *c)
577
{ return replace(&before, 1, c, qstrlen(c)); }
578
inline QByteArray &QByteArray::replace(const QByteArray &before, const char *c)
579
{ return replace(before.constData(), before.size(), c, qstrlen(c)); }
580
inline QByteArray &QByteArray::replace(const char *before, const char *after)
581
{ return replace(before, qstrlen(before), after, qstrlen(after)); }
583
inline QByteArray &QByteArray::setNum(short n, int base)
584
{ return base == 10 ? setNum(qlonglong(n), base) : setNum(qulonglong(ushort(n)), base); }
585
inline QByteArray &QByteArray::setNum(ushort n, int base)
586
{ return setNum(qulonglong(n), base); }
587
inline QByteArray &QByteArray::setNum(int n, int base)
588
{ return base == 10 ? setNum(qlonglong(n), base) : setNum(qulonglong(uint(n)), base); }
589
inline QByteArray &QByteArray::setNum(uint n, int base)
590
{ return setNum(qulonglong(n), base); }
591
inline QByteArray &QByteArray::setNum(float n, char f, int prec)
592
{ return setNum(double(n),f,prec); }
595
#if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE))
596
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QByteArray &);
597
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QByteArray &);
600
#ifndef QT_NO_COMPRESS
601
Q_CORE_EXPORT QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1);
602
Q_CORE_EXPORT QByteArray qUncompress(const uchar* data, int nbytes);
603
inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
604
{ return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
605
inline QByteArray qUncompress(const QByteArray& data)
606
{ return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
609
Q_DECLARE_SHARED(QByteArray)
615
#ifdef QT_USE_QSTRINGBUILDER
616
#include <QtCore/qstring.h>
619
#endif // QBYTEARRAY_H