1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtCore module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
45 #include <QtCore/qrefcount.h>
46 #include <QtCore/qnamespace.h>
53 #error qbytearray.h must be included before any header file that defines truncate
56 #if defined(Q_CC_GNU) && (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
57 //There is a bug in GCC 4.0 that tries to instantiate template of annonymous enum
58 # ifdef QT_USE_FAST_OPERATOR_PLUS
59 # undef QT_USE_FAST_OPERATOR_PLUS
61 # ifdef QT_USE_QSTRINGBUILDER
62 # undef QT_USE_QSTRINGBUILDER
73 /*****************************************************************************
74 Safe and portable C string functions; extensions to standard string.h
75 *****************************************************************************/
77 Q_CORE_EXPORT char *qstrdup(const char *);
79 inline uint qstrlen(const char *str)
80 { return str ? uint(strlen(str)) : 0; }
82 inline uint qstrnlen(const char *str, uint maxlen)
86 while (length < maxlen && *str++)
92 Q_CORE_EXPORT char *qstrcpy(char *dst, const char *src);
93 Q_CORE_EXPORT char *qstrncpy(char *dst, const char *src, uint len);
95 Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2);
96 Q_CORE_EXPORT int qstrcmp(const QByteArray &str1, const QByteArray &str2);
97 Q_CORE_EXPORT int qstrcmp(const QByteArray &str1, const char *str2);
98 static inline int qstrcmp(const char *str1, const QByteArray &str2)
99 { return -qstrcmp(str2, str1); }
101 inline int qstrncmp(const char *str1, const char *str2, uint len)
103 return (str1 && str2) ? strncmp(str1, str2, len)
104 : (str1 ? 1 : (str2 ? -1 : 0));
106 Q_CORE_EXPORT int qstricmp(const char *, const char *);
107 Q_CORE_EXPORT int qstrnicmp(const char *, const char *, uint len);
109 // implemented in qvsnprintf.cpp
110 Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
111 Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt, ...);
113 // qChecksum: Internet checksum
115 Q_CORE_EXPORT quint16 qChecksum(const char *s, uint len);
120 template <typename T> class QList;
122 struct QByteArrayData
124 QtPrivate::RefCount ref;
127 uint capacityReserved : 1;
131 inline char *data() { return reinterpret_cast<char *>(this) + offset; }
132 inline const char *data() const { return reinterpret_cast<const char *>(this) + offset; }
135 template<int N> struct QStaticByteArrayData
140 QByteArrayData *data_ptr() const
142 Q_ASSERT(ba.ref.isStatic());
143 return const_cast<QByteArrayData *>(&ba);
147 struct QByteArrayDataPtr
152 #define Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, offset) \
153 { Q_REFCOUNT_INITIALIZE_STATIC, size, 0, 0, offset } \
156 #define Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER(size) \
157 Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, sizeof(QByteArrayData)) \
160 #if defined(Q_COMPILER_LAMBDA)
162 # define QByteArrayLiteral(str) \
163 ([]() -> QByteArrayDataPtr { \
164 enum { Size = sizeof(str) - 1 }; \
165 static const QStaticByteArrayData<Size> qbytearray_literal = { \
166 Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER(Size), \
168 QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; \
173 #elif defined(Q_CC_GNU)
174 // We need to create a QByteArrayData in the .rodata section of memory
175 // and the only way to do that is to create a "static const" variable.
176 // To do that, we need the __extension__ {( )} trick which only GCC supports
178 # define QByteArrayLiteral(str) \
180 enum { Size = sizeof(str) - 1 }; \
181 static const QStaticByteArrayData<Size> qbytearray_literal = { \
182 Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER(Size), \
184 QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; \
191 #ifndef QByteArrayLiteral
192 // no lambdas, not GCC, use const char * instead
194 # define QByteArrayLiteral(str) (str)
198 class Q_CORE_EXPORT QByteArray
201 typedef QByteArrayData Data;
205 QByteArray(const char *, int size = -1);
206 QByteArray(int size, char c);
207 QByteArray(int size, Qt::Initialization);
208 inline QByteArray(const QByteArray &);
209 inline ~QByteArray();
211 QByteArray &operator=(const QByteArray &);
212 QByteArray &operator=(const char *str);
213 #ifdef Q_COMPILER_RVALUE_REFS
214 inline QByteArray &operator=(QByteArray &&other)
215 { qSwap(d, other.d); return *this; }
218 inline void swap(QByteArray &other) { qSwap(d, other.d); }
220 inline int size() const;
221 bool isEmpty() const;
222 void resize(int size);
224 QByteArray &fill(char c, int size = -1);
226 int capacity() const;
227 void reserve(int size);
230 #ifndef QT_NO_CAST_FROM_BYTEARRAY
231 operator const char *() const;
232 operator const void *() const;
235 const char *data() const;
236 inline const char *constData() const;
237 inline void detach();
238 bool isDetached() const;
239 inline bool isSharedWith(const QByteArray &other) const { return d == other.d; }
242 char at(int i) const;
243 char operator[](int i) const;
244 char operator[](uint i) const;
245 QByteRef operator[](int i);
246 QByteRef operator[](uint i);
248 int indexOf(char c, int from = 0) const;
249 int indexOf(const char *c, int from = 0) const;
250 int indexOf(const QByteArray &a, int from = 0) const;
251 int lastIndexOf(char c, int from = -1) const;
252 int lastIndexOf(const char *c, int from = -1) const;
253 int lastIndexOf(const QByteArray &a, int from = -1) const;
255 bool contains(char c) const;
256 bool contains(const char *a) const;
257 bool contains(const QByteArray &a) const;
258 int count(char c) const;
259 int count(const char *a) const;
260 int count(const QByteArray &a) const;
262 QByteArray left(int len) const;
263 QByteArray right(int len) const;
264 QByteArray mid(int index, int len = -1) const;
266 bool startsWith(const QByteArray &a) const;
267 bool startsWith(char c) const;
268 bool startsWith(const char *c) const;
270 bool endsWith(const QByteArray &a) const;
271 bool endsWith(char c) const;
272 bool endsWith(const char *c) const;
274 void truncate(int pos);
277 QByteArray toLower() const;
278 QByteArray toUpper() const;
280 QByteArray trimmed() const;
281 QByteArray simplified() const;
282 QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
283 QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
285 QByteArray &prepend(char c);
286 QByteArray &prepend(const char *s);
287 QByteArray &prepend(const char *s, int len);
288 QByteArray &prepend(const QByteArray &a);
289 QByteArray &append(char c);
290 QByteArray &append(const char *s);
291 QByteArray &append(const char *s, int len);
292 QByteArray &append(const QByteArray &a);
293 QByteArray &insert(int i, char c);
294 QByteArray &insert(int i, const char *s);
295 QByteArray &insert(int i, const char *s, int len);
296 QByteArray &insert(int i, const QByteArray &a);
297 QByteArray &remove(int index, int len);
298 QByteArray &replace(int index, int len, const char *s);
299 QByteArray &replace(int index, int len, const char *s, int alen);
300 QByteArray &replace(int index, int len, const QByteArray &s);
301 QByteArray &replace(char before, const char *after);
302 QByteArray &replace(char before, const QByteArray &after);
303 QByteArray &replace(const char *before, const char *after);
304 QByteArray &replace(const char *before, int bsize, const char *after, int asize);
305 QByteArray &replace(const QByteArray &before, const QByteArray &after);
306 QByteArray &replace(const QByteArray &before, const char *after);
307 QByteArray &replace(const char *before, const QByteArray &after);
308 QByteArray &replace(char before, char after);
309 QByteArray &operator+=(char c);
310 QByteArray &operator+=(const char *s);
311 QByteArray &operator+=(const QByteArray &a);
313 QList<QByteArray> split(char sep) const;
315 QByteArray repeated(int times) const;
317 #ifndef QT_NO_CAST_TO_ASCII
318 QT_ASCII_CAST_WARN QByteArray &append(const QString &s);
319 QT_ASCII_CAST_WARN QByteArray &insert(int i, const QString &s);
320 QT_ASCII_CAST_WARN QByteArray &replace(const QString &before, const char *after);
321 QT_ASCII_CAST_WARN QByteArray &replace(char c, const QString &after);
322 QT_ASCII_CAST_WARN QByteArray &replace(const QString &before, const QByteArray &after);
324 QT_ASCII_CAST_WARN QByteArray &operator+=(const QString &s);
325 QT_ASCII_CAST_WARN int indexOf(const QString &s, int from = 0) const;
326 QT_ASCII_CAST_WARN int lastIndexOf(const QString &s, int from = -1) const;
328 #ifndef QT_NO_CAST_FROM_ASCII
329 inline QT_ASCII_CAST_WARN bool operator==(const QString &s2) const;
330 inline QT_ASCII_CAST_WARN bool operator!=(const QString &s2) const;
331 inline QT_ASCII_CAST_WARN bool operator<(const QString &s2) const;
332 inline QT_ASCII_CAST_WARN bool operator>(const QString &s2) const;
333 inline QT_ASCII_CAST_WARN bool operator<=(const QString &s2) const;
334 inline QT_ASCII_CAST_WARN bool operator>=(const QString &s2) const;
337 short toShort(bool *ok = 0, int base = 10) const;
338 ushort toUShort(bool *ok = 0, int base = 10) const;
339 int toInt(bool *ok = 0, int base = 10) const;
340 uint toUInt(bool *ok = 0, int base = 10) const;
341 long toLong(bool *ok = 0, int base = 10) const;
342 ulong toULong(bool *ok = 0, int base = 10) const;
343 qlonglong toLongLong(bool *ok = 0, int base = 10) const;
344 qulonglong toULongLong(bool *ok = 0, int base = 10) const;
345 float toFloat(bool *ok = 0) const;
346 double toDouble(bool *ok = 0) const;
347 QByteArray toBase64() const;
348 QByteArray toHex() const;
349 QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
350 const QByteArray &include = QByteArray(),
351 char percent = '%') const;
353 QByteArray &setNum(short, int base = 10);
354 QByteArray &setNum(ushort, int base = 10);
355 QByteArray &setNum(int, int base = 10);
356 QByteArray &setNum(uint, int base = 10);
357 QByteArray &setNum(qlonglong, int base = 10);
358 QByteArray &setNum(qulonglong, int base = 10);
359 QByteArray &setNum(float, char f = 'g', int prec = 6);
360 QByteArray &setNum(double, char f = 'g', int prec = 6);
361 QByteArray &setRawData(const char *a, uint n); // ### Qt 5: use an int
363 static QByteArray number(int, int base = 10);
364 static QByteArray number(uint, int base = 10);
365 static QByteArray number(qlonglong, int base = 10);
366 static QByteArray number(qulonglong, int base = 10);
367 static QByteArray number(double, char f = 'g', int prec = 6);
368 static QByteArray fromRawData(const char *, int size);
369 static QByteArray fromBase64(const QByteArray &base64);
370 static QByteArray fromHex(const QByteArray &hexEncoded);
371 static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
374 typedef char *iterator;
375 typedef const char *const_iterator;
376 typedef iterator Iterator;
377 typedef const_iterator ConstIterator;
379 const_iterator begin() const;
380 const_iterator cbegin() const;
381 const_iterator constBegin() const;
383 const_iterator end() const;
384 const_iterator cend() const;
385 const_iterator constEnd() const;
388 typedef const char & const_reference;
389 typedef char & reference;
390 typedef char value_type;
391 void push_back(char c);
392 void push_back(const char *c);
393 void push_back(const QByteArray &a);
394 void push_front(char c);
395 void push_front(const char *c);
396 void push_front(const QByteArray &a);
398 inline int count() const { return d->size; }
399 int length() const { return d->size; }
402 Q_DECL_CONSTEXPR inline QByteArray(QByteArrayDataPtr dd) : d(dd.ptr) {}
405 operator QNoImplicitBoolCast() const;
406 static const QStaticByteArrayData<1> shared_null;
407 static const QStaticByteArrayData<1> shared_empty;
409 void reallocData(int alloc, bool grow = false);
411 QByteArray nulTerminated() const;
413 friend class QByteRef;
414 friend class QString;
415 friend Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, int nbytes);
417 typedef Data * DataPtr;
418 inline DataPtr &data_ptr() { return d; }
421 inline QByteArray::QByteArray(): d(shared_null.data_ptr()) { }
422 inline QByteArray::~QByteArray() { if (!d->ref.deref()) free(d); }
423 inline int QByteArray::size() const
426 inline char QByteArray::at(int i) const
427 { Q_ASSERT(i >= 0 && i < size()); return d->data()[i]; }
428 inline char QByteArray::operator[](int i) const
429 { Q_ASSERT(i >= 0 && i < size()); return d->data()[i]; }
430 inline char QByteArray::operator[](uint i) const
431 { Q_ASSERT(i < uint(size())); return d->data()[i]; }
433 inline bool QByteArray::isEmpty() const
434 { return d->size == 0; }
435 #ifndef QT_NO_CAST_FROM_BYTEARRAY
436 inline QByteArray::operator const char *() const
437 { return d->data(); }
438 inline QByteArray::operator const void *() const
439 { return d->data(); }
441 inline char *QByteArray::data()
442 { detach(); return d->data(); }
443 inline const char *QByteArray::data() const
444 { return d->data(); }
445 inline const char *QByteArray::constData() const
446 { return d->data(); }
447 inline void QByteArray::detach()
448 { if (d->ref.isShared() || (d->offset != sizeof(QByteArrayData))) reallocData(d->size); }
449 inline bool QByteArray::isDetached() const
450 { return !d->ref.isShared(); }
451 inline QByteArray::QByteArray(const QByteArray &a) : d(a.d)
454 inline int QByteArray::capacity() const
457 inline void QByteArray::reserve(int asize)
459 if (d->ref.isShared() || asize > int(d->alloc))
462 if (!d->capacityReserved) {
463 // cannot set unconditionally, since d could be the shared_null/shared_empty (which is const)
464 d->capacityReserved = true;
468 inline void QByteArray::squeeze()
470 if (d->ref.isShared() || d->size < int(d->alloc))
471 reallocData(d->size);
473 if (d->capacityReserved) {
474 // cannot set unconditionally, since d could be shared_null or
476 d->capacityReserved = false;
480 class Q_CORE_EXPORT QByteRef {
483 inline QByteRef(QByteArray &array, int idx)
485 friend class QByteArray;
487 inline operator char() const
488 { return i < a.d->size ? a.d->data()[i] : char(0); }
489 inline QByteRef &operator=(char c)
490 { if (i >= a.d->size) a.expand(i); else a.detach();
491 a.d->data()[i] = c; return *this; }
492 inline QByteRef &operator=(const QByteRef &c)
493 { if (i >= a.d->size) a.expand(i); else a.detach();
494 a.d->data()[i] = c.a.d->data()[c.i]; return *this; }
495 inline bool operator==(char c) const
496 { return a.d->data()[i] == c; }
497 inline bool operator!=(char c) const
498 { return a.d->data()[i] != c; }
499 inline bool operator>(char c) const
500 { return a.d->data()[i] > c; }
501 inline bool operator>=(char c) const
502 { return a.d->data()[i] >= c; }
503 inline bool operator<(char c) const
504 { return a.d->data()[i] < c; }
505 inline bool operator<=(char c) const
506 { return a.d->data()[i] <= c; }
509 inline QByteRef QByteArray::operator[](int i)
510 { Q_ASSERT(i >= 0); return QByteRef(*this, i); }
511 inline QByteRef QByteArray::operator[](uint i)
512 { return QByteRef(*this, i); }
513 inline QByteArray::iterator QByteArray::begin()
514 { detach(); return d->data(); }
515 inline QByteArray::const_iterator QByteArray::begin() const
516 { return d->data(); }
517 inline QByteArray::const_iterator QByteArray::cbegin() const
518 { return d->data(); }
519 inline QByteArray::const_iterator QByteArray::constBegin() const
520 { return d->data(); }
521 inline QByteArray::iterator QByteArray::end()
522 { detach(); return d->data() + d->size; }
523 inline QByteArray::const_iterator QByteArray::end() const
524 { return d->data() + d->size; }
525 inline QByteArray::const_iterator QByteArray::cend() const
526 { return d->data() + d->size; }
527 inline QByteArray::const_iterator QByteArray::constEnd() const
528 { return d->data() + d->size; }
529 inline QByteArray &QByteArray::operator+=(char c)
530 { return append(c); }
531 inline QByteArray &QByteArray::operator+=(const char *s)
532 { return append(s); }
533 inline QByteArray &QByteArray::operator+=(const QByteArray &a)
534 { return append(a); }
535 inline void QByteArray::push_back(char c)
537 inline void QByteArray::push_back(const char *c)
539 inline void QByteArray::push_back(const QByteArray &a)
541 inline void QByteArray::push_front(char c)
543 inline void QByteArray::push_front(const char *c)
545 inline void QByteArray::push_front(const QByteArray &a)
547 inline bool QByteArray::contains(const QByteArray &a) const
548 { return indexOf(a) != -1; }
549 inline bool QByteArray::contains(char c) const
550 { return indexOf(c) != -1; }
551 inline bool operator==(const QByteArray &a1, const QByteArray &a2)
552 { return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
553 inline bool operator==(const QByteArray &a1, const char *a2)
554 { return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
555 inline bool operator==(const char *a1, const QByteArray &a2)
556 { return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
557 inline bool operator!=(const QByteArray &a1, const QByteArray &a2)
558 { return !(a1==a2); }
559 inline bool operator!=(const QByteArray &a1, const char *a2)
560 { return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
561 inline bool operator!=(const char *a1, const QByteArray &a2)
562 { return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
563 inline bool operator<(const QByteArray &a1, const QByteArray &a2)
564 { return qstrcmp(a1, a2) < 0; }
565 inline bool operator<(const QByteArray &a1, const char *a2)
566 { return qstrcmp(a1, a2) < 0; }
567 inline bool operator<(const char *a1, const QByteArray &a2)
568 { return qstrcmp(a1, a2) < 0; }
569 inline bool operator<=(const QByteArray &a1, const QByteArray &a2)
570 { return qstrcmp(a1, a2) <= 0; }
571 inline bool operator<=(const QByteArray &a1, const char *a2)
572 { return qstrcmp(a1, a2) <= 0; }
573 inline bool operator<=(const char *a1, const QByteArray &a2)
574 { return qstrcmp(a1, a2) <= 0; }
575 inline bool operator>(const QByteArray &a1, const QByteArray &a2)
576 { return qstrcmp(a1, a2) > 0; }
577 inline bool operator>(const QByteArray &a1, const char *a2)
578 { return qstrcmp(a1, a2) > 0; }
579 inline bool operator>(const char *a1, const QByteArray &a2)
580 { return qstrcmp(a1, a2) > 0; }
581 inline bool operator>=(const QByteArray &a1, const QByteArray &a2)
582 { return qstrcmp(a1, a2) >= 0; }
583 inline bool operator>=(const QByteArray &a1, const char *a2)
584 { return qstrcmp(a1, a2) >= 0; }
585 inline bool operator>=(const char *a1, const QByteArray &a2)
586 { return qstrcmp(a1, a2) >= 0; }
587 #if !defined(QT_USE_QSTRINGBUILDER)
588 inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
589 { return QByteArray(a1) += a2; }
590 inline const QByteArray operator+(const QByteArray &a1, const char *a2)
591 { return QByteArray(a1) += a2; }
592 inline const QByteArray operator+(const QByteArray &a1, char a2)
593 { return QByteArray(a1) += a2; }
594 inline const QByteArray operator+(const char *a1, const QByteArray &a2)
595 { return QByteArray(a1) += a2; }
596 inline const QByteArray operator+(char a1, const QByteArray &a2)
597 { return QByteArray(&a1, 1) += a2; }
598 #endif // QT_USE_QSTRINGBUILDER
599 inline bool QByteArray::contains(const char *c) const
600 { return indexOf(c) != -1; }
601 inline QByteArray &QByteArray::replace(char before, const char *c)
602 { return replace(&before, 1, c, qstrlen(c)); }
603 inline QByteArray &QByteArray::replace(const QByteArray &before, const char *c)
604 { return replace(before.constData(), before.size(), c, qstrlen(c)); }
605 inline QByteArray &QByteArray::replace(const char *before, const char *after)
606 { return replace(before, qstrlen(before), after, qstrlen(after)); }
608 inline QByteArray &QByteArray::setNum(short n, int base)
609 { return setNum(qlonglong(n), base); }
610 inline QByteArray &QByteArray::setNum(ushort n, int base)
611 { return setNum(qulonglong(n), base); }
612 inline QByteArray &QByteArray::setNum(int n, int base)
613 { return setNum(qlonglong(n), base); }
614 inline QByteArray &QByteArray::setNum(uint n, int base)
615 { return setNum(qulonglong(n), base); }
616 inline QByteArray &QByteArray::setNum(float n, char f, int prec)
617 { return setNum(double(n),f,prec); }
620 #if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE))
621 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QByteArray &);
622 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QByteArray &);
625 #ifndef QT_NO_COMPRESS
626 Q_CORE_EXPORT QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1);
627 Q_CORE_EXPORT QByteArray qUncompress(const uchar* data, int nbytes);
628 inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
629 { return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
630 inline QByteArray qUncompress(const QByteArray& data)
631 { return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
634 Q_DECLARE_TYPEINFO(QByteArray, Q_MOVABLE_TYPE);
635 Q_DECLARE_SHARED(QByteArray)
641 #ifdef QT_USE_QSTRINGBUILDER
642 #include <QtCore/qstring.h>
645 #endif // QBYTEARRAY_H