Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qbytearray.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// Copyright (C) 2016 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QBYTEARRAY_H
6#define QBYTEARRAY_H
7
8#include <QtCore/qrefcount.h>
9#include <QtCore/qnamespace.h>
10#include <QtCore/qarraydata.h>
11#include <QtCore/qarraydatapointer.h>
12#include <QtCore/qcontainerfwd.h>
13#include <QtCore/qbytearrayalgorithms.h>
14#include <QtCore/qbytearrayview.h>
15
16#include <stdlib.h>
17#include <string.h>
18#include <stdarg.h>
19
20#include <string>
21#include <iterator>
22
23#ifndef QT5_NULL_STRINGS
24// Would ideally be off, but in practice breaks too much (Qt 6.0).
25#define QT5_NULL_STRINGS 1
26#endif
27
28#ifdef truncate
29#error qbytearray.h must be included before any header file that defines truncate
30#endif
31
32#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
35#endif
36
37#if defined(Q_OS_WASM) || defined(Q_QDOC)
38namespace emscripten {
39 class val;
40}
41#endif
42
43class tst_QByteArray;
44
46
47class QString;
48class QDataStream;
49
51
52# define QByteArrayLiteral(str) \
53 (QByteArray(QByteArrayData(nullptr, const_cast<char *>(str), sizeof(str) - 1))) \
54
55
56class Q_CORE_EXPORT QByteArray
57{
58public:
60private:
62
64 static const char _empty;
65
66 friend class ::tst_QByteArray;
67
68 template <typename InputIterator>
69 using if_input_iterator = QtPrivate::IfIsInputIterator<InputIterator>;
70public:
71
73 Base64Encoding = 0,
74 Base64UrlEncoding = 1,
75
76 KeepTrailingEquals = 0,
77 OmitTrailingEquals = 2,
78
79 IgnoreBase64DecodingErrors = 0,
80 AbortOnBase64DecodingErrors = 4,
81 };
82 Q_DECLARE_FLAGS(Base64Options, Base64Option)
83
85 Ok,
86 IllegalInputLength,
87 IllegalCharacter,
88 IllegalPadding,
89 };
90
91 inline constexpr QByteArray() noexcept;
92 QByteArray(const char *, qsizetype size = -1);
94 QByteArray(qsizetype size, Qt::Initialization);
95 inline QByteArray(const QByteArray &) noexcept;
96 inline ~QByteArray();
97
98 QByteArray &operator=(const QByteArray &) noexcept;
99 QByteArray &operator=(const char *str);
100 inline QByteArray(QByteArray && other) noexcept
101 = default;
102 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QByteArray)
103 inline void swap(QByteArray &other) noexcept
104 { d.swap(other.d); }
105
106 bool isEmpty() const noexcept { return size() == 0; }
107 void resize(qsizetype size);
108 void resize(qsizetype size, char c);
109
110 QByteArray &fill(char c, qsizetype size = -1);
111
112 inline qsizetype capacity() const;
113 inline void reserve(qsizetype size);
114 inline void squeeze();
115
116#ifndef QT_NO_CAST_FROM_BYTEARRAY
117 inline operator const char *() const;
118 inline operator const void *() const;
119#endif
120 inline char *data();
121 inline const char *data() const noexcept;
122 const char *constData() const noexcept { return data(); }
123 inline void detach();
124 inline bool isDetached() const;
125 inline bool isSharedWith(const QByteArray &other) const noexcept
126 { return data() == other.data() && size() == other.size(); }
127 void clear();
128
129 inline char at(qsizetype i) const;
130 inline char operator[](qsizetype i) const;
131 [[nodiscard]] inline char &operator[](qsizetype i);
132 [[nodiscard]] char front() const { return at(0); }
133 [[nodiscard]] inline char &front();
134 [[nodiscard]] char back() const { return at(size() - 1); }
135 [[nodiscard]] inline char &back();
136
137 qsizetype indexOf(char c, qsizetype from = 0) const;
139 { return QtPrivate::findByteArray(qToByteArrayViewIgnoringNull(*this), from, bv); }
140
141 qsizetype lastIndexOf(char c, qsizetype from = -1) const;
143 { return lastIndexOf(bv, size()); }
145 { return QtPrivate::lastIndexOf(qToByteArrayViewIgnoringNull(*this), from, bv); }
146
147 inline bool contains(char c) const;
148 inline bool contains(QByteArrayView bv) const;
149 qsizetype count(char c) const;
151 { return QtPrivate::count(qToByteArrayViewIgnoringNull(*this), bv); }
152
153 inline int compare(QByteArrayView a, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
154
155 [[nodiscard]] QByteArray left(qsizetype len) const;
156 [[nodiscard]] QByteArray right(qsizetype len) const;
157 [[nodiscard]] QByteArray mid(qsizetype index, qsizetype len = -1) const;
158
159 [[nodiscard]] QByteArray first(qsizetype n) const
160 { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return QByteArray(data(), n); }
161 [[nodiscard]] QByteArray last(qsizetype n) const
162 { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return QByteArray(data() + size() - n, n); }
163 [[nodiscard]] QByteArray sliced(qsizetype pos) const
164 { Q_ASSERT(pos >= 0); Q_ASSERT(pos <= size()); return QByteArray(data() + pos, size() - pos); }
165 [[nodiscard]] QByteArray sliced(qsizetype pos, qsizetype n) const
166 { Q_ASSERT(pos >= 0); Q_ASSERT(n >= 0); Q_ASSERT(size_t(pos) + size_t(n) <= size_t(size())); return QByteArray(data() + pos, n); }
167 [[nodiscard]] QByteArray chopped(qsizetype len) const
168 { Q_ASSERT(len >= 0); Q_ASSERT(len <= size()); return first(size() - len); }
169
172 bool startsWith(char c) const { return size() > 0 && front() == c; }
173
174 bool endsWith(char c) const { return size() > 0 && back() == c; }
177
178 bool isUpper() const;
179 bool isLower() const;
180
181 [[nodiscard]] bool isValidUtf8() const noexcept
182 {
184 }
185
186 void truncate(qsizetype pos);
187 void chop(qsizetype n);
188
189#if !defined(Q_QDOC)
190 [[nodiscard]] QByteArray toLower() const &
191 { return toLower_helper(*this); }
192 [[nodiscard]] QByteArray toLower() &&
193 { return toLower_helper(*this); }
194 [[nodiscard]] QByteArray toUpper() const &
195 { return toUpper_helper(*this); }
196 [[nodiscard]] QByteArray toUpper() &&
197 { return toUpper_helper(*this); }
198 [[nodiscard]] QByteArray trimmed() const &
199 { return trimmed_helper(*this); }
200 [[nodiscard]] QByteArray trimmed() &&
201 { return trimmed_helper(*this); }
202 [[nodiscard]] QByteArray simplified() const &
203 { return simplified_helper(*this); }
204 [[nodiscard]] QByteArray simplified() &&
205 { return simplified_helper(*this); }
206#else
207 [[nodiscard]] QByteArray toLower() const;
208 [[nodiscard]] QByteArray toUpper() const;
209 [[nodiscard]] QByteArray trimmed() const;
210 [[nodiscard]] QByteArray simplified() const;
211#endif
212
213 [[nodiscard]] QByteArray leftJustified(qsizetype width, char fill = ' ', bool truncate = false) const;
214 [[nodiscard]] QByteArray rightJustified(qsizetype width, char fill = ' ', bool truncate = false) const;
215
217 { return insert(0, QByteArrayView(&c, 1)); }
218 inline QByteArray &prepend(qsizetype count, char c);
219 QByteArray &prepend(const char *s)
220 { return insert(0, QByteArrayView(s, qsizetype(qstrlen(s)))); }
222 { return insert(0, QByteArrayView(s, len)); }
225 { return insert(0, a); }
226
227 QByteArray &append(char c);
228 inline QByteArray &append(qsizetype count, char c);
229 QByteArray &append(const char *s)
230 { return append(s, -1); }
232 { return append(QByteArrayView(s, len < 0 ? qsizetype(qstrlen(s)) : len)); }
233 QByteArray &append(const QByteArray &a);
235 { return insert(size(), a); }
236
237 QByteArray &assign(QByteArrayView v);
239 {
240 Q_ASSERT(n >= 0);
241 return fill(c, n);
242 }
243 template <typename InputIterator, if_input_iterator<InputIterator> = true>
244 QByteArray &assign(InputIterator first, InputIterator last)
245 {
246 d.assign(first, last);
247 d.data()[d.size] = '\0';
248 return *this;
249 }
250
252 inline QByteArray &insert(qsizetype i, const char *s)
253 { return insert(i, QByteArrayView(s)); }
255 { return insert(i, QByteArrayView(data)); }
258 { return insert(i, QByteArrayView(&c, 1)); }
260 { return insert(i, QByteArrayView(s, len)); }
261
264 { return size_t(pos) < size_t(size()) ? remove(pos, 1) : *this; }
265 QByteArray &removeFirst() { return !isEmpty() ? remove(0, 1) : *this; }
266 QByteArray &removeLast() { return !isEmpty() ? remove(size() - 1, 1) : *this; }
267
268 template <typename Predicate>
269 QByteArray &removeIf(Predicate pred)
270 {
271 removeIf_helper(pred);
272 return *this;
273 }
274
276 { return replace(index, len, QByteArrayView(s, alen)); }
278 QByteArray &replace(char before, QByteArrayView after)
279 { return replace(QByteArrayView(&before, 1), after); }
280 QByteArray &replace(const char *before, qsizetype bsize, const char *after, qsizetype asize)
281 { return replace(QByteArrayView(before, bsize), QByteArrayView(after, asize)); }
282 QByteArray &replace(QByteArrayView before, QByteArrayView after);
283 QByteArray &replace(char before, char after);
284
286 { return append(c); }
287 QByteArray &operator+=(const char *s)
288 { return append(s); }
290 { return append(a); }
292 { return append(a); }
293
294 QList<QByteArray> split(char sep) const;
295
296 [[nodiscard]] QByteArray repeated(qsizetype times) const;
297
298#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
299 QT_ASCII_CAST_WARN inline bool operator==(const QString &s2) const;
300 QT_ASCII_CAST_WARN inline bool operator!=(const QString &s2) const;
301 QT_ASCII_CAST_WARN inline bool operator<(const QString &s2) const;
302 QT_ASCII_CAST_WARN inline bool operator>(const QString &s2) const;
303 QT_ASCII_CAST_WARN inline bool operator<=(const QString &s2) const;
304 QT_ASCII_CAST_WARN inline bool operator>=(const QString &s2) const;
305#endif
306 friend inline bool operator==(const QByteArray &a1, const QByteArray &a2) noexcept
307 { return QByteArrayView(a1) == QByteArrayView(a2); }
308 friend inline bool operator==(const QByteArray &a1, const char *a2) noexcept
309 { return QByteArrayView(a1) == QByteArrayView(a2); }
310 friend inline bool operator==(const char *a1, const QByteArray &a2) noexcept
311 { return QByteArrayView(a1) == QByteArrayView(a2); }
312 friend inline bool operator!=(const QByteArray &a1, const QByteArray &a2) noexcept
313 { return !(a1==a2); }
314 friend inline bool operator!=(const QByteArray &a1, const char *a2) noexcept
315 { return QByteArrayView(a1) != QByteArrayView(a2); }
316 friend inline bool operator!=(const char *a1, const QByteArray &a2) noexcept
317 { return QByteArrayView(a1) != QByteArrayView(a2); }
318 friend inline bool operator<(const QByteArray &a1, const QByteArray &a2) noexcept
320 friend inline bool operator<(const QByteArray &a1, const char *a2) noexcept
321 { return QtPrivate::compareMemory(a1, a2) < 0; }
322 friend inline bool operator<(const char *a1, const QByteArray &a2) noexcept
323 { return QtPrivate::compareMemory(a1, a2) < 0; }
324 friend inline bool operator<=(const QByteArray &a1, const QByteArray &a2) noexcept
326 friend inline bool operator<=(const QByteArray &a1, const char *a2) noexcept
327 { return QtPrivate::compareMemory(a1, a2) <= 0; }
328 friend inline bool operator<=(const char *a1, const QByteArray &a2) noexcept
329 { return QtPrivate::compareMemory(a1, a2) <= 0; }
330 friend inline bool operator>(const QByteArray &a1, const QByteArray &a2) noexcept
332 friend inline bool operator>(const QByteArray &a1, const char *a2) noexcept
333 { return QtPrivate::compareMemory(a1, a2) > 0; }
334 friend inline bool operator>(const char *a1, const QByteArray &a2) noexcept
335 { return QtPrivate::compareMemory(a1, a2) > 0; }
336 friend inline bool operator>=(const QByteArray &a1, const QByteArray &a2) noexcept
338 friend inline bool operator>=(const QByteArray &a1, const char *a2) noexcept
339 { return QtPrivate::compareMemory(a1, a2) >= 0; }
340 friend inline bool operator>=(const char *a1, const QByteArray &a2) noexcept
341 { return QtPrivate::compareMemory(a1, a2) >= 0; }
342
343 // Check isEmpty() instead of isNull() for backwards compatibility.
344 friend inline bool operator==(const QByteArray &a1, std::nullptr_t) noexcept { return a1.isEmpty(); }
345 friend inline bool operator!=(const QByteArray &a1, std::nullptr_t) noexcept { return !a1.isEmpty(); }
346 friend inline bool operator< (const QByteArray & , std::nullptr_t) noexcept { return false; }
347 friend inline bool operator> (const QByteArray &a1, std::nullptr_t) noexcept { return !a1.isEmpty(); }
348 friend inline bool operator<=(const QByteArray &a1, std::nullptr_t) noexcept { return a1.isEmpty(); }
349 friend inline bool operator>=(const QByteArray & , std::nullptr_t) noexcept { return true; }
350
351 friend inline bool operator==(std::nullptr_t, const QByteArray &a2) noexcept { return a2 == nullptr; }
352 friend inline bool operator!=(std::nullptr_t, const QByteArray &a2) noexcept { return a2 != nullptr; }
353 friend inline bool operator< (std::nullptr_t, const QByteArray &a2) noexcept { return a2 > nullptr; }
354 friend inline bool operator> (std::nullptr_t, const QByteArray &a2) noexcept { return a2 < nullptr; }
355 friend inline bool operator<=(std::nullptr_t, const QByteArray &a2) noexcept { return a2 >= nullptr; }
356 friend inline bool operator>=(std::nullptr_t, const QByteArray &a2) noexcept { return a2 <= nullptr; }
357
358 short toShort(bool *ok = nullptr, int base = 10) const;
359 ushort toUShort(bool *ok = nullptr, int base = 10) const;
360 int toInt(bool *ok = nullptr, int base = 10) const;
361 uint toUInt(bool *ok = nullptr, int base = 10) const;
362 long toLong(bool *ok = nullptr, int base = 10) const;
363 ulong toULong(bool *ok = nullptr, int base = 10) const;
364 qlonglong toLongLong(bool *ok = nullptr, int base = 10) const;
365 qulonglong toULongLong(bool *ok = nullptr, int base = 10) const;
366 float toFloat(bool *ok = nullptr) const;
367 double toDouble(bool *ok = nullptr) const;
368 QByteArray toBase64(Base64Options options = Base64Encoding) const;
369 QByteArray toHex(char separator = '\0') const;
370 QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
371 const QByteArray &include = QByteArray(),
372 char percent = '%') const;
373 [[nodiscard]] QByteArray percentDecoded(char percent = '%') const;
374
375 inline QByteArray &setNum(short, int base = 10);
376 inline QByteArray &setNum(ushort, int base = 10);
377 inline QByteArray &setNum(int, int base = 10);
378 inline QByteArray &setNum(uint, int base = 10);
379 inline QByteArray &setNum(long, int base = 10);
380 inline QByteArray &setNum(ulong, int base = 10);
381 QByteArray &setNum(qlonglong, int base = 10);
382 QByteArray &setNum(qulonglong, int base = 10);
383 inline QByteArray &setNum(float, char format = 'g', int precision = 6);
384 QByteArray &setNum(double, char format = 'g', int precision = 6);
385 QByteArray &setRawData(const char *a, qsizetype n);
386
387 [[nodiscard]] static QByteArray number(int, int base = 10);
388 [[nodiscard]] static QByteArray number(uint, int base = 10);
389 [[nodiscard]] static QByteArray number(long, int base = 10);
390 [[nodiscard]] static QByteArray number(ulong, int base = 10);
391 [[nodiscard]] static QByteArray number(qlonglong, int base = 10);
392 [[nodiscard]] static QByteArray number(qulonglong, int base = 10);
393 [[nodiscard]] static QByteArray number(double, char format = 'g', int precision = 6);
394 [[nodiscard]] static QByteArray fromRawData(const char *data, qsizetype size)
395 {
396 return QByteArray(DataPointer(nullptr, const_cast<char *>(data), size));
397 }
398
399 class FromBase64Result;
400 [[nodiscard]] static FromBase64Result fromBase64Encoding(QByteArray &&base64, Base64Options options = Base64Encoding);
401 [[nodiscard]] static FromBase64Result fromBase64Encoding(const QByteArray &base64, Base64Options options = Base64Encoding);
402 [[nodiscard]] static QByteArray fromBase64(const QByteArray &base64, Base64Options options = Base64Encoding);
403 [[nodiscard]] static QByteArray fromHex(const QByteArray &hexEncoded);
404 [[nodiscard]] static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
405
406#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
407 static QByteArray fromCFData(CFDataRef data);
408 static QByteArray fromRawCFData(CFDataRef data);
409 CFDataRef toCFData() const Q_DECL_CF_RETURNS_RETAINED;
410 CFDataRef toRawCFData() const Q_DECL_CF_RETURNS_RETAINED;
411 static QByteArray fromNSData(const NSData *data);
412 static QByteArray fromRawNSData(const NSData *data);
413 NSData *toNSData() const Q_DECL_NS_RETURNS_AUTORELEASED;
414 NSData *toRawNSData() const Q_DECL_NS_RETURNS_AUTORELEASED;
415#endif
416
417#if defined(Q_OS_WASM) || defined(Q_QDOC)
418 static QByteArray fromEcmaUint8Array(emscripten::val uint8array);
419 emscripten::val toEcmaUint8Array();
420#endif
421
422 typedef char *iterator;
423 typedef const char *const_iterator;
426 typedef std::reverse_iterator<iterator> reverse_iterator;
427 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
428 iterator begin() { return data(); }
429 const_iterator begin() const noexcept { return data(); }
430 const_iterator cbegin() const noexcept { return begin(); }
431 const_iterator constBegin() const noexcept { return begin(); }
432 iterator end() { return data() + size(); }
433 const_iterator end() const noexcept { return data() + size(); }
434 const_iterator cend() const noexcept { return end(); }
435 const_iterator constEnd() const noexcept { return end(); }
440 const_reverse_iterator crbegin() const noexcept { return rbegin(); }
441 const_reverse_iterator crend() const noexcept { return rend(); }
442
443 // stl compatibility
446 typedef const char & const_reference;
447 typedef char & reference;
448 typedef char *pointer;
449 typedef const char *const_pointer;
450 typedef char value_type;
451 void push_back(char c)
452 { append(c); }
453 void push_back(const char *s)
454 { append(s); }
455 void push_back(const QByteArray &a)
456 { append(a); }
458 { append(a); }
459 void push_front(char c)
460 { prepend(c); }
461 void push_front(const char *c)
462 { prepend(c); }
464 { prepend(a); }
466 { prepend(a); }
467 void shrink_to_fit() { squeeze(); }
468 iterator erase(const_iterator first, const_iterator last);
469 inline iterator erase(const_iterator it) { return erase(it, it + 1); }
470
471 static QByteArray fromStdString(const std::string &s);
472 std::string toStdString() const;
473
474 inline qsizetype size() const noexcept { return d->size; }
475#if QT_DEPRECATED_SINCE(6, 4)
476 QT_DEPRECATED_VERSION_X_6_4("Use size() or length() instead.")
477 inline qsizetype count() const noexcept { return size(); }
478#endif
479 inline qsizetype length() const noexcept { return size(); }
480 QT_CORE_INLINE_SINCE(6, 4)
481 bool isNull() const noexcept;
482
483 inline DataPointer &data_ptr() { return d; }
484#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
485 explicit inline QByteArray(const DataPointer &dd) : d(dd) {}
486#endif
487 explicit inline QByteArray(DataPointer &&dd) : d(std::move(dd)) {}
488
489private:
490 void reallocData(qsizetype alloc, QArrayData::AllocationOption option);
491 void reallocGrowData(qsizetype n);
492 void expand(qsizetype i);
493
494 static QByteArray toLower_helper(const QByteArray &a);
495 static QByteArray toLower_helper(QByteArray &a);
496 static QByteArray toUpper_helper(const QByteArray &a);
497 static QByteArray toUpper_helper(QByteArray &a);
498 static QByteArray trimmed_helper(const QByteArray &a);
499 static QByteArray trimmed_helper(QByteArray &a);
500 static QByteArray simplified_helper(const QByteArray &a);
501 static QByteArray simplified_helper(QByteArray &a);
502 template <typename Predicate>
503 qsizetype removeIf_helper(Predicate pred)
504 {
505 const qsizetype result = d->eraseIf(pred);
506 if (result > 0)
507 d.data()[d.size] = '\0';
508 return result;
509 }
510
511 friend class QString;
512 friend Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, qsizetype nbytes);
513
514 template <typename T> friend qsizetype erase(QByteArray &ba, const T &t);
515 template <typename Predicate> friend qsizetype erase_if(QByteArray &ba, Predicate pred);
516};
517
518Q_DECLARE_OPERATORS_FOR_FLAGS(QByteArray::Base64Options)
519
520inline constexpr QByteArray::QByteArray() noexcept {}
522
523inline char QByteArray::at(qsizetype i) const
524{ Q_ASSERT(size_t(i) < size_t(size())); return d.data()[i]; }
526{ Q_ASSERT(size_t(i) < size_t(size())); return d.data()[i]; }
527
528#ifndef QT_NO_CAST_FROM_BYTEARRAY
529inline QByteArray::operator const char *() const
530{ return data(); }
531inline QByteArray::operator const void *() const
532{ return data(); }
533#endif
534inline char *QByteArray::data()
535{
536 detach();
537 Q_ASSERT(d.data());
538 return d.data();
539}
540inline const char *QByteArray::data() const noexcept
541{
542#if QT5_NULL_STRINGS == 1
543 return d.data() ? d.data() : &_empty;
544#else
545 return d.data();
546#endif
547}
549{ if (d->needsDetach()) reallocData(size(), QArrayData::KeepSize); }
550inline bool QByteArray::isDetached() const
551{ return !d->isShared(); }
552inline QByteArray::QByteArray(const QByteArray &a) noexcept : d(a.d)
553{}
554
555inline qsizetype QByteArray::capacity() const { return qsizetype(d->constAllocatedCapacity()); }
556
558{
559 if (d->needsDetach() || asize > capacity() - d->freeSpaceAtBegin())
560 reallocData(qMax(size(), asize), QArrayData::KeepSize);
561 if (d->constAllocatedCapacity())
562 d->setFlag(Data::CapacityReserved);
563}
564
566{
567 if (!d.isMutable())
568 return;
569 if (d->needsDetach() || size() < capacity())
570 reallocData(size(), QArrayData::KeepSize);
571 if (d->constAllocatedCapacity())
572 d->clearFlag(Data::CapacityReserved);
573}
574
576{ Q_ASSERT(i >= 0 && i < size()); return data()[i]; }
577inline char &QByteArray::front() { return operator[](0); }
578inline char &QByteArray::back() { return operator[](size() - 1); }
580{ return insert(size(), n, ch); }
582{ return insert(0, n, ch); }
583inline bool QByteArray::contains(char c) const
584{ return indexOf(c) != -1; }
586{ return indexOf(bv) != -1; }
588{
589 return cs == Qt::CaseSensitive ? QtPrivate::compareMemory(*this, a) :
590 qstrnicmp(data(), size(), a.data(), a.size());
591}
592#if !defined(QT_USE_QSTRINGBUILDER)
594{ return QByteArray(a1) += a2; }
595inline QByteArray operator+(QByteArray &&lhs, const QByteArray &rhs)
596{ return std::move(lhs += rhs); }
597inline QByteArray operator+(const QByteArray &a1, const char *a2)
598{ return QByteArray(a1) += a2; }
599inline QByteArray operator+(QByteArray &&lhs, const char *rhs)
600{ return std::move(lhs += rhs); }
601inline QByteArray operator+(const QByteArray &a1, char a2)
602{ return QByteArray(a1) += a2; }
603inline QByteArray operator+(QByteArray &&lhs, char rhs)
604{ return std::move(lhs += rhs); }
605inline QByteArray operator+(const char *a1, const QByteArray &a2)
606{ return QByteArray(a1) += a2; }
607inline QByteArray operator+(char a1, const QByteArray &a2)
608{ return QByteArray(&a1, 1) += a2; }
609#endif // QT_USE_QSTRINGBUILDER
610
612{ return setNum(qlonglong(n), base); }
614{ return setNum(qulonglong(n), base); }
616{ return setNum(qlonglong(n), base); }
618{ return setNum(qulonglong(n), base); }
620{ return setNum(qlonglong(n), base); }
622{ return setNum(qulonglong(n), base); }
624{ return setNum(double(n), format, precision); }
625
626#if QT_CORE_INLINE_IMPL_SINCE(6, 4)
627bool QByteArray::isNull() const noexcept
628{
629 return d->isNull();
630}
631#endif
632
633#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED)
634Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QByteArray &);
636#endif
637
638#ifndef QT_NO_COMPRESS
639Q_CORE_EXPORT QByteArray qCompress(const uchar* data, qsizetype nbytes, int compressionLevel = -1);
640Q_CORE_EXPORT QByteArray qUncompress(const uchar* data, qsizetype nbytes);
641inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
642{ return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
644{ return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
645#endif
646
647Q_DECLARE_SHARED(QByteArray)
648
650{
651public:
654
656 {
657 decoded.swap(other.decoded);
658 std::swap(decodingStatus, other.decodingStatus);
659 }
660
661 explicit operator bool() const noexcept { return decodingStatus == QByteArray::Base64DecodingStatus::Ok; }
662
663#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(Q_QDOC)
664 QByteArray &operator*() & noexcept { return decoded; }
665 const QByteArray &operator*() const & noexcept { return decoded; }
666 QByteArray &&operator*() && noexcept { return std::move(decoded); }
667#else
668 QByteArray &operator*() noexcept { return decoded; }
669 const QByteArray &operator*() const noexcept { return decoded; }
670#endif
671
672 friend inline bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
673 {
674 if (lhs.decodingStatus != rhs.decodingStatus)
675 return false;
676
677 if (lhs.decodingStatus == QByteArray::Base64DecodingStatus::Ok && lhs.decoded != rhs.decoded)
678 return false;
679
680 return true;
681 }
682
683 friend inline bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
684 {
685 return !(lhs == rhs);
686 }
687};
688
689Q_DECLARE_SHARED(QByteArray::FromBase64Result)
690
691
692Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t qHash(const QByteArray::FromBase64Result &key, size_t seed = 0) noexcept;
693
694template <typename T>
696{
697 return ba.removeIf_helper([&t](const auto &e) { return t == e; });
698}
699
700template <typename Predicate>
702{
703 return ba.removeIf_helper(pred);
704}
705
706//
707// QByteArrayView members that require QByteArray:
708//
710{
711 return QByteArray(data(), size());
712}
713
714namespace Qt {
715inline namespace Literals {
716inline namespace StringLiterals {
717
718inline QByteArray operator"" _ba(const char *str, size_t size) noexcept
719{
720 return QByteArray(QByteArrayData(nullptr, const_cast<char *>(str), qsizetype(size)));
721}
722
723} // StringLiterals
724} // Literals
725} // Qt
726
727inline namespace QtLiterals {
728#if QT_DEPRECATED_SINCE(6, 8)
729
730QT_DEPRECATED_VERSION_X_6_8("Use _ba from Qt::StringLiterals namespace instead.")
731inline QByteArray operator"" _qba(const char *str, size_t size) noexcept
732{
733 return Qt::StringLiterals::operator""_ba(str, size);
734}
735
736#endif // QT_DEPRECATED_SINCE(6, 8)
737} // QtLiterals
738
740
741#endif // QBYTEARRAY_H
QByteArray toByteArray() const
Definition qbytearray.h:709
constexpr qsizetype size() const noexcept
constexpr const_pointer data() const noexcept
QByteArray & operator*() noexcept
Definition qbytearray.h:668
friend bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are equal, otherwise returns false.
Definition qbytearray.h:672
QByteArray::Base64DecodingStatus decodingStatus
Definition qbytearray.h:653
void swap(QByteArray::FromBase64Result &other) noexcept
Definition qbytearray.h:655
const QByteArray & operator*() const noexcept
Returns the decoded byte array.
Definition qbytearray.h:669
friend bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are different, otherwise returns false.
Definition qbytearray.h:683
\inmodule QtCore
Definition qbytearray.h:57
QByteArray trimmed() const &
Definition qbytearray.h:198
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
Definition qbytearray.h:534
const char * const_pointer
Definition qbytearray.h:449
QByteArray & insert(qsizetype i, const char *s, qsizetype len)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:259
void push_front(QByteArrayView a)
Definition qbytearray.h:465
bool endsWith(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:174
char * iterator
This typedef provides an STL-style non-const iterator for QByteArray.
Definition qbytearray.h:422
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing just after the last byte in the ...
Definition qbytearray.h:435
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first byte in the byte-ar...
Definition qbytearray.h:431
QByteArray & insert(qsizetype i, const char *s)
Inserts s at index position i and returns a reference to this byte array.
Definition qbytearray.h:252
QByteArray & prepend(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:216
friend bool operator<=(const char *a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:328
const_reverse_iterator crbegin() const noexcept
Definition qbytearray.h:440
friend bool operator!=(const QByteArray &a1, std::nullptr_t) noexcept
Definition qbytearray.h:345
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
Definition qbytearray.h:474
reverse_iterator rbegin()
Definition qbytearray.h:436
qsizetype size_type
Definition qbytearray.h:444
void reserve(qsizetype size)
Attempts to allocate memory for at least size bytes.
Definition qbytearray.h:557
QByteArray & assign(qsizetype n, char c)
Definition qbytearray.h:238
QByteArray last(qsizetype n) const
Definition qbytearray.h:161
iterator erase(const_iterator it)
Definition qbytearray.h:469
QByteArray simplified() const &
Definition qbytearray.h:202
void push_back(const char *s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:453
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition qbytearray.h:427
QByteArray toUpper() const &
Definition qbytearray.h:194
char * pointer
Definition qbytearray.h:448
QByteArray & insert(qsizetype i, char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:257
QByteArray & setNum(short, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:611
friend bool operator!=(std::nullptr_t, const QByteArray &a2) noexcept
Definition qbytearray.h:352
reverse_iterator rend()
Definition qbytearray.h:437
const_iterator begin() const noexcept
Definition qbytearray.h:429
friend bool operator>(const char *a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:334
void shrink_to_fit()
Definition qbytearray.h:467
friend bool operator>=(const QByteArray &, std::nullptr_t) noexcept
Definition qbytearray.h:349
qsizetype lastIndexOf(QByteArrayView bv) const
Definition qbytearray.h:142
friend bool operator<=(const QByteArray &a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:324
friend bool operator>=(std::nullptr_t, const QByteArray &a2) noexcept
Definition qbytearray.h:356
qsizetype indexOf(QByteArrayView bv, qsizetype from=0) const
Definition qbytearray.h:138
const_reverse_iterator crend() const noexcept
Definition qbytearray.h:441
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray & operator+=(const char *s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:287
QByteArray & operator+=(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:285
QByteArray & removeLast()
Definition qbytearray.h:266
QByteArray & prepend(const char *s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:219
QByteArray chopped(qsizetype len) const
Definition qbytearray.h:167
QByteArray & prepend(QByteArrayView a)
Prepends the byte array view ba to this byte array and returns a reference to this byte array.
Definition qbytearray.h:224
friend bool operator==(const char *a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:310
bool isValidUtf8() const noexcept
Returns true if this byte array contains valid UTF-8 encoded data, or false otherwise.
Definition qbytearray.h:181
friend bool operator>=(const QByteArray &a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:336
qsizetype length() const noexcept
Same as size().
Definition qbytearray.h:479
bool isDetached() const
Definition qbytearray.h:550
friend bool operator==(std::nullptr_t, const QByteArray &a2) noexcept
Definition qbytearray.h:351
friend bool operator==(const QByteArray &a1, std::nullptr_t) noexcept
Definition qbytearray.h:344
friend bool operator<(const QByteArray &a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:318
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last byte in the byte-...
Definition qbytearray.h:432
QByteArray sliced(qsizetype pos, qsizetype n) const
Definition qbytearray.h:165
const char * const_iterator
This typedef provides an STL-style const iterator for QByteArray.
Definition qbytearray.h:423
friend bool operator!=(const QByteArray &a1, const char *a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:314
QByteArray toUpper() &&
Definition qbytearray.h:196
char front() const
Definition qbytearray.h:132
friend bool operator>=(const QByteArray &a1, const char *a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:338
char & reference
Definition qbytearray.h:447
QByteArray & removeAt(qsizetype pos)
Definition qbytearray.h:263
QByteArray trimmed() &&
Definition qbytearray.h:200
QByteArray & append(const char *s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:229
void push_back(const QByteArray &a)
This function is provided for STL compatibility.
Definition qbytearray.h:455
bool isSharedWith(const QByteArray &other) const noexcept
Definition qbytearray.h:125
bool startsWith(QByteArrayView bv) const
Definition qbytearray.h:170
char at(qsizetype i) const
Returns the byte at index position i in the byte array.
Definition qbytearray.h:523
QByteArray & replace(const char *before, qsizetype bsize, const char *after, qsizetype asize)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:280
const_iterator ConstIterator
Definition qbytearray.h:425
QByteArray & replace(char before, QByteArrayView after)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:278
friend bool operator<(const char *a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:322
qsizetype count(QByteArrayView bv) const
Definition qbytearray.h:150
friend bool operator!=(const QByteArray &a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:312
QByteArray & operator+=(const QByteArray &a)
Appends the byte array ba onto the end of this byte array and returns a reference to this byte array.
Definition qbytearray.h:289
void push_back(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:451
iterator Iterator
Definition qbytearray.h:424
void swap(QByteArray &other) noexcept
Definition qbytearray.h:103
void push_back(QByteArrayView a)
Definition qbytearray.h:457
QByteArray & removeIf(Predicate pred)
Definition qbytearray.h:269
QByteArray toLower() &&
Definition qbytearray.h:192
QByteArray & insert(qsizetype i, QByteArrayView data)
QByteArray & assign(InputIterator first, InputIterator last)
Definition qbytearray.h:244
QByteArray & removeFirst()
Definition qbytearray.h:265
bool contains(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:583
const_reverse_iterator rend() const noexcept
Definition qbytearray.h:439
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
Definition qbytearray.h:106
constexpr QByteArray() noexcept
Constructs an empty byte array.
Definition qbytearray.h:520
const_iterator end() const noexcept
Definition qbytearray.h:433
void detach()
Definition qbytearray.h:548
void squeeze()
Releases any memory not required to store the array's data.
Definition qbytearray.h:565
QByteArray & prepend(const char *s, qsizetype len)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:221
QByteArray & insert(qsizetype i, const QByteArray &data)
Inserts data at index position i and returns a reference to this byte array.
Definition qbytearray.h:254
friend bool operator<=(std::nullptr_t, const QByteArray &a2) noexcept
Definition qbytearray.h:355
const_iterator cbegin() const noexcept
Definition qbytearray.h:430
const_reverse_iterator rbegin() const noexcept
Definition qbytearray.h:438
qsizetype lastIndexOf(QByteArrayView bv, qsizetype from) const
Definition qbytearray.h:144
QByteArray sliced(qsizetype pos) const
Definition qbytearray.h:163
QByteArray first(qsizetype n) const
Definition qbytearray.h:159
QByteArray & operator+=(QByteArrayView a)
Definition qbytearray.h:291
friend bool operator>=(const char *a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:340
friend bool operator>(const QByteArray &a1, const char *a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:332
friend bool operator>(const QByteArray &a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:330
int compare(QByteArrayView a, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition qbytearray.h:587
QByteArray toLower() const &
Definition qbytearray.h:190
const_iterator cend() const noexcept
Definition qbytearray.h:434
QByteArray(DataPointer &&dd)
Definition qbytearray.h:487
QByteArray & append(const char *s, qsizetype len)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:231
QByteArray & append(QByteArrayView a)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:234
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first byte in the byte-array.
Definition qbytearray.h:428
void push_front(const QByteArray &a)
This function is provided for STL compatibility.
Definition qbytearray.h:463
qsizetype capacity() const
Returns the maximum number of bytes that can be stored in the byte array without forcing a reallocati...
Definition qbytearray.h:555
char value_type
Definition qbytearray.h:450
~QByteArray()
Destroys the byte array.
Definition qbytearray.h:521
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
char back() const
Definition qbytearray.h:134
std::reverse_iterator< iterator > reverse_iterator
Definition qbytearray.h:426
friend bool operator==(const QByteArray &a1, const char *a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:308
QByteArray simplified() &&
Definition qbytearray.h:204
char operator[](qsizetype i) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:525
void push_front(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:459
friend bool operator<(const QByteArray &a1, const char *a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:320
qptrdiff difference_type
Definition qbytearray.h:445
friend bool operator!=(const char *a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:316
const char & const_reference
Definition qbytearray.h:446
friend bool operator<=(const QByteArray &a1, const char *a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:326
bool isNull() const noexcept
Returns true if this byte array is null; otherwise returns false.
void push_front(const char *c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:461
bool endsWith(QByteArrayView bv) const
Definition qbytearray.h:175
friend bool operator<=(const QByteArray &a1, std::nullptr_t) noexcept
Definition qbytearray.h:348
bool startsWith(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:172
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
Definition qbytearray.h:394
QByteArray & replace(qsizetype index, qsizetype len, const char *s, qsizetype alen)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:275
friend bool operator==(const QByteArray &a1, const QByteArray &a2) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:306
\inmodule QtCore\reentrant
Definition qdatastream.h:30
Definition qlist.h:74
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
friend class QByteArray
Definition qstring.h:964
QString str
[2]
a resize(100000)
b clear()
list append(new Employee("Blackpool", "Stephen"))
double e
cache insert(employee->id(), employee)
QSet< QString >::iterator it
set reserve(20000)
Combined button and popup list for selecting options.
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype lastIndexOf(QByteArrayView haystack, qsizetype from, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype count(QByteArrayView haystack, QByteArrayView needle) noexcept
typename std::enable_if< std::is_convertible< typename std::iterator_traits< Iterator >::iterator_category, std::input_iterator_tag >::value, bool >::type IfIsInputIterator
Q_CORE_EXPORT int compareMemory(QByteArrayView lhs, QByteArrayView rhs)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findByteArray(QByteArrayView haystack, qsizetype from, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isValidUtf8(QByteArrayView s) noexcept
CaseSensitivity
@ CaseSensitive
@ Ok
Definition qbezier.cpp:275
int qstrnicmp(const char *str1, qsizetype len1, const char *str2, qsizetype len2)
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QByteArray &)
Q_CORE_EXPORT QByteArray qCompress(const uchar *data, qsizetype nbytes, int compressionLevel=-1)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t qHash(const QByteArray::FromBase64Result &key, size_t seed=0) noexcept
qsizetype erase_if(QByteArray &ba, Predicate pred)
Definition qbytearray.h:701
QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
Definition qbytearray.h:593
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QByteArray &)
QArrayDataPointer< char > QByteArrayData
Definition qbytearray.h:50
qsizetype erase(QByteArray &ba, const T &t)
Definition qbytearray.h:695
Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, qsizetype nbytes)
size_t qstrlen(const char *str)
QByteArrayView qToByteArrayViewIgnoringNull(const QByteArrayLike &b) noexcept
#define Q_DECL_NS_RETURNS_AUTORELEASED
#define Q_DECL_PURE_FUNCTION
#define Q_DECL_CF_RETURNS_RETAINED
constexpr bool operator!=(const timespec &t1, const timespec &t2)
constexpr timespec operator*(const timespec &t1, int mul)
#define Q_FORWARD_DECLARE_CF_TYPE(type)
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
NSUInteger capacity
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLsizei const GLfloat * v
[13]
GLuint64 key
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLuint GLuint end
GLenum GLenum GLsizei count
GLdouble GLdouble right
GLint GLsizei width
GLint left
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint first
GLfloat n
GLint GLsizei GLsizei GLenum format
const GLubyte * c
GLuint GLfloat * val
GLenum GLsizei len
GLdouble GLdouble t
Definition qopenglext.h:243
GLuint64EXT * result
[6]
GLdouble s
[6]
Definition qopenglext.h:235
GLuint GLenum option
GLenum GLint GLint * precision
const void * data_ptr(const QTransform &t)
Definition qpainter_p.h:48
bool operator>(const QPoint &a, const QPoint &b)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
static void split(QT_FT_Vector *b)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
static constexpr QChar sep
#define s2
#define a2
#define a1
#define QT_ASCII_CAST_WARN
#define QT_DEPRECATED_VERSION_X_6_4(text)
#define QT_DEPRECATED_VERSION_X_6_8(text)
static int compare(quint64 a, quint64 b)
unsigned char uchar
Definition qtypes.h:27
unsigned long ulong
Definition qtypes.h:30
ptrdiff_t qptrdiff
Definition qtypes.h:69
quint64 qulonglong
Definition qtypes.h:59
ptrdiff_t qsizetype
Definition qtypes.h:70
unsigned int uint
Definition qtypes.h:29
unsigned short ushort
Definition qtypes.h:28
qint64 qlonglong
Definition qtypes.h:58
bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:272
bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:274
static int toInt(const QChar &qc, int R)
static double toDouble(Value v)
QByteArray ba
[0]
settings remove("monkey")
ba fill(true)
list prepend("one")
list lastIndexOf("B")
list indexOf("B")
QSharedPointer< T > other(t)
[5]
QAction * at
@ CapacityReserved
the capacity was reserved by the user, try to keep it
Definition qarraydata.h:30