Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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/qcompare.h>
13#include <QtCore/qcontainerfwd.h>
14#include <QtCore/qbytearrayalgorithms.h>
15#include <QtCore/qbytearrayview.h>
16
17#include <stdlib.h>
18#include <string.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
50using QByteArrayData = QArrayDataPointer<char>;
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:
61 typedef QTypedArrayData<char> Data;
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);
96 inline QByteArray(const QByteArray &) noexcept;
97 inline ~QByteArray();
98
99 QByteArray &operator=(const QByteArray &) noexcept;
100 QByteArray &operator=(const char *str);
101 inline QByteArray(QByteArray && other) noexcept
102 = default;
103 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QByteArray)
104 inline void swap(QByteArray &other) noexcept
105 { d.swap(other.d); }
106
107 bool isEmpty() const noexcept { return size() == 0; }
108 void resize(qsizetype size);
109 void resize(qsizetype size, char c);
110 void resizeForOverwrite(qsizetype size);
111
112 QByteArray &fill(char c, qsizetype size = -1);
113
114 inline qsizetype capacity() const;
115 inline void reserve(qsizetype size);
116 inline void squeeze();
117
118#ifndef QT_NO_CAST_FROM_BYTEARRAY
119 inline operator const char *() const;
120 inline operator const void *() const;
121#endif
122 inline char *data();
123 inline const char *data() const noexcept;
124 const char *constData() const noexcept { return data(); }
125 inline void detach();
126 inline bool isDetached() const;
127 inline bool isSharedWith(const QByteArray &other) const noexcept
128 { return data() == other.data() && size() == other.size(); }
129 void clear();
130
131 inline char at(qsizetype i) const;
132 inline char operator[](qsizetype i) const;
133 [[nodiscard]] inline char &operator[](qsizetype i);
134 [[nodiscard]] char front() const { return at(0); }
135 [[nodiscard]] inline char &front();
136 [[nodiscard]] char back() const { return at(size() - 1); }
137 [[nodiscard]] inline char &back();
138
139 QT_CORE_INLINE_SINCE(6, 7)
140 qsizetype indexOf(char c, qsizetype from = 0) const;
143
144 QT_CORE_INLINE_SINCE(6, 7)
145 qsizetype lastIndexOf(char c, qsizetype from = -1) const;
147 { return lastIndexOf(bv, size()); }
150
151 inline bool contains(char c) const;
152 inline bool contains(QByteArrayView bv) const;
153 qsizetype count(char c) const;
156
157 inline int compare(QByteArrayView a, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
158
159#if QT_CORE_REMOVED_SINCE(6, 7)
162 QByteArray mid(qsizetype index, qsizetype len = -1) const;
164 QByteArray last(qsizetype n) const;
165 QByteArray sliced(qsizetype pos) const;
166 QByteArray sliced(qsizetype pos, qsizetype n) const;
167 QByteArray chopped(qsizetype len) const;
168#else
169 [[nodiscard]] QByteArray left(qsizetype n) const &
170 {
171 if (n >= size())
172 return *this;
173 return first(qMax(n, 0));
174 }
175 [[nodiscard]] QByteArray left(qsizetype n) &&
176 {
177 if (n >= size())
178 return std::move(*this);
179 return std::move(*this).first(qMax(n, 0));
180 }
181 [[nodiscard]] QByteArray right(qsizetype n) const &
182 {
183 if (n >= size())
184 return *this;
185 return last(qMax(n, 0));
186 }
187 [[nodiscard]] QByteArray right(qsizetype n) &&
188 {
189 if (n >= size())
190 return std::move(*this);
191 return std::move(*this).last(qMax(n, 0));
192 }
193 [[nodiscard]] QByteArray mid(qsizetype index, qsizetype len = -1) const &;
194 [[nodiscard]] QByteArray mid(qsizetype index, qsizetype len = -1) &&;
195
196 [[nodiscard]] QByteArray first(qsizetype n) const &
197 { verify(0, n); return sliced(0, n); }
198 [[nodiscard]] QByteArray last(qsizetype n) const &
199 { verify(0, n); return sliced(size() - n, n); }
200 [[nodiscard]] QByteArray sliced(qsizetype pos) const &
201 { verify(pos, 0); return sliced(pos, size() - pos); }
202 [[nodiscard]] QByteArray sliced(qsizetype pos, qsizetype n) const &
203 { verify(pos, n); return QByteArray(d.data() + pos, n); }
204 [[nodiscard]] QByteArray chopped(qsizetype len) const &
205 { verify(0, len); return sliced(0, size() - len); }
206
207 [[nodiscard]] QByteArray first(qsizetype n) &&
208 {
209 verify(0, n);
210 resize(n); // may detach and allocate memory
211 return std::move(*this);
212 }
213 [[nodiscard]] QByteArray last(qsizetype n) &&
214 { verify(0, n); return sliced_helper(*this, size() - n, n); }
215 [[nodiscard]] QByteArray sliced(qsizetype pos) &&
216 { verify(pos, 0); return sliced_helper(*this, pos, size() - pos); }
218 { verify(pos, n); return sliced_helper(*this, pos, n); }
219 [[nodiscard]] QByteArray chopped(qsizetype len) &&
220 { verify(0, len); return std::move(*this).first(size() - len); }
221#endif
222
225 bool startsWith(char c) const { return size() > 0 && front() == c; }
226
227 bool endsWith(char c) const { return size() > 0 && back() == c; }
230
231 bool isUpper() const;
232 bool isLower() const;
233
234 [[nodiscard]] bool isValidUtf8() const noexcept
235 {
237 }
238
239 void truncate(qsizetype pos);
240 void chop(qsizetype n);
241
243 { verify(pos, 0); return remove(0, pos); }
245 {
246 verify(pos, n);
247 if (isNull())
248 return *this;
249 resize(pos + n);
250 return remove(0, pos);
251 }
252
253#if !defined(Q_QDOC)
254 [[nodiscard]] QByteArray toLower() const &
255 { return toLower_helper(*this); }
256 [[nodiscard]] QByteArray toLower() &&
257 { return toLower_helper(*this); }
258 [[nodiscard]] QByteArray toUpper() const &
259 { return toUpper_helper(*this); }
260 [[nodiscard]] QByteArray toUpper() &&
261 { return toUpper_helper(*this); }
262 [[nodiscard]] QByteArray trimmed() const &
263 { return trimmed_helper(*this); }
264 [[nodiscard]] QByteArray trimmed() &&
265 { return trimmed_helper(*this); }
266 [[nodiscard]] QByteArray simplified() const &
267 { return simplified_helper(*this); }
268 [[nodiscard]] QByteArray simplified() &&
269 { return simplified_helper(*this); }
270#else
271 [[nodiscard]] QByteArray toLower() const;
272 [[nodiscard]] QByteArray toUpper() const;
273 [[nodiscard]] QByteArray trimmed() const;
274 [[nodiscard]] QByteArray simplified() const;
275#endif
276
277 [[nodiscard]] QByteArray leftJustified(qsizetype width, char fill = ' ', bool truncate = false) const;
278 [[nodiscard]] QByteArray rightJustified(qsizetype width, char fill = ' ', bool truncate = false) const;
279
281 { return insert(0, QByteArrayView(&c, 1)); }
282 inline QByteArray &prepend(qsizetype count, char c);
283 QByteArray &prepend(const char *s)
284 { return insert(0, QByteArrayView(s, qsizetype(qstrlen(s)))); }
286 { return insert(0, QByteArrayView(s, len)); }
289 { return insert(0, a); }
290
291 QByteArray &append(char c);
292 inline QByteArray &append(qsizetype count, char c);
293 QByteArray &append(const char *s)
294 { return append(s, -1); }
296 { return append(QByteArrayView(s, len < 0 ? qsizetype(qstrlen(s)) : len)); }
297 QByteArray &append(const QByteArray &a);
300
301 QByteArray &assign(QByteArrayView v);
303 {
304 Q_ASSERT(n >= 0);
305 return fill(c, n);
306 }
307 template <typename InputIterator, if_input_iterator<InputIterator> = true>
308 QByteArray &assign(InputIterator first, InputIterator last)
309 {
310 d.assign(first, last);
311 d.data()[d.size] = '\0';
312 return *this;
313 }
314
316 inline QByteArray &insert(qsizetype i, const char *s)
317 { return insert(i, QByteArrayView(s)); }
319 { return insert(i, QByteArrayView(data)); }
322 { return insert(i, QByteArrayView(&c, 1)); }
324 { return insert(i, QByteArrayView(s, len)); }
325
328 { return size_t(pos) < size_t(size()) ? remove(pos, 1) : *this; }
329 QByteArray &removeFirst() { return !isEmpty() ? remove(0, 1) : *this; }
330 QByteArray &removeLast() { return !isEmpty() ? remove(size() - 1, 1) : *this; }
331
332 template <typename Predicate>
333 QByteArray &removeIf(Predicate pred)
334 {
335 removeIf_helper(pred);
336 return *this;
337 }
338
340 { return replace(index, len, QByteArrayView(s, alen)); }
342 QByteArray &replace(char before, QByteArrayView after)
343 { return replace(QByteArrayView(&before, 1), after); }
344 QByteArray &replace(const char *before, qsizetype bsize, const char *after, qsizetype asize)
345 { return replace(QByteArrayView(before, bsize), QByteArrayView(after, asize)); }
346 QByteArray &replace(QByteArrayView before, QByteArrayView after);
347 QByteArray &replace(char before, char after);
348
350 { return append(c); }
351 QByteArray &operator+=(const char *s)
352 { return append(s); }
354 { return append(a); }
357
358 QList<QByteArray> split(char sep) const;
359
360 [[nodiscard]] QByteArray repeated(qsizetype times) const;
361
362#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
363#if QT_CORE_REMOVED_SINCE(6, 8)
364 QT_ASCII_CAST_WARN inline bool operator==(const QString &s2) const;
365 QT_ASCII_CAST_WARN inline bool operator!=(const QString &s2) const;
366 QT_ASCII_CAST_WARN inline bool operator<(const QString &s2) const;
367 QT_ASCII_CAST_WARN inline bool operator>(const QString &s2) const;
368 QT_ASCII_CAST_WARN inline bool operator<=(const QString &s2) const;
369 QT_ASCII_CAST_WARN inline bool operator>=(const QString &s2) const;
370#endif // QT_CORE_REMOVED_SINCE(6, 8)
371#endif // !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
372
373 short toShort(bool *ok = nullptr, int base = 10) const;
374 ushort toUShort(bool *ok = nullptr, int base = 10) const;
375 int toInt(bool *ok = nullptr, int base = 10) const;
376 uint toUInt(bool *ok = nullptr, int base = 10) const;
377 long toLong(bool *ok = nullptr, int base = 10) const;
378 ulong toULong(bool *ok = nullptr, int base = 10) const;
379 qlonglong toLongLong(bool *ok = nullptr, int base = 10) const;
380 qulonglong toULongLong(bool *ok = nullptr, int base = 10) const;
381 float toFloat(bool *ok = nullptr) const;
382 double toDouble(bool *ok = nullptr) const;
383 QByteArray toBase64(Base64Options options = Base64Encoding) const;
384 QByteArray toHex(char separator = '\0') const;
385 QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
386 const QByteArray &include = QByteArray(),
387 char percent = '%') const;
388 [[nodiscard]] QByteArray percentDecoded(char percent = '%') const;
389
390 inline QByteArray &setNum(short, int base = 10);
391 inline QByteArray &setNum(ushort, int base = 10);
392 inline QByteArray &setNum(int, int base = 10);
393 inline QByteArray &setNum(uint, int base = 10);
394 inline QByteArray &setNum(long, int base = 10);
395 inline QByteArray &setNum(ulong, int base = 10);
396 QByteArray &setNum(qlonglong, int base = 10);
397 QByteArray &setNum(qulonglong, int base = 10);
398 inline QByteArray &setNum(float, char format = 'g', int precision = 6);
399 QByteArray &setNum(double, char format = 'g', int precision = 6);
400 QByteArray &setRawData(const char *a, qsizetype n);
401
402 [[nodiscard]] static QByteArray number(int, int base = 10);
403 [[nodiscard]] static QByteArray number(uint, int base = 10);
404 [[nodiscard]] static QByteArray number(long, int base = 10);
405 [[nodiscard]] static QByteArray number(ulong, int base = 10);
406 [[nodiscard]] static QByteArray number(qlonglong, int base = 10);
407 [[nodiscard]] static QByteArray number(qulonglong, int base = 10);
408 [[nodiscard]] static QByteArray number(double, char format = 'g', int precision = 6);
409 [[nodiscard]] static QByteArray fromRawData(const char *data, qsizetype size)
410 {
411 return QByteArray(DataPointer(nullptr, const_cast<char *>(data), size));
412 }
413
414 class FromBase64Result;
415 [[nodiscard]] static FromBase64Result fromBase64Encoding(QByteArray &&base64, Base64Options options = Base64Encoding);
416 [[nodiscard]] static FromBase64Result fromBase64Encoding(const QByteArray &base64, Base64Options options = Base64Encoding);
417 [[nodiscard]] static QByteArray fromBase64(const QByteArray &base64, Base64Options options = Base64Encoding);
418 [[nodiscard]] static QByteArray fromHex(const QByteArray &hexEncoded);
419 [[nodiscard]] static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
420
421#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
422 static QByteArray fromCFData(CFDataRef data);
423 static QByteArray fromRawCFData(CFDataRef data);
424 CFDataRef toCFData() const Q_DECL_CF_RETURNS_RETAINED;
425 CFDataRef toRawCFData() const Q_DECL_CF_RETURNS_RETAINED;
426 static QByteArray fromNSData(const NSData *data);
427 static QByteArray fromRawNSData(const NSData *data);
428 NSData *toNSData() const Q_DECL_NS_RETURNS_AUTORELEASED;
429 NSData *toRawNSData() const Q_DECL_NS_RETURNS_AUTORELEASED;
430#endif
431
432#if defined(Q_OS_WASM) || defined(Q_QDOC)
433 static QByteArray fromEcmaUint8Array(emscripten::val uint8array);
434 emscripten::val toEcmaUint8Array();
435#endif
436
437 typedef char *iterator;
438 typedef const char *const_iterator;
441 typedef std::reverse_iterator<iterator> reverse_iterator;
442 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
443 iterator begin() { return data(); }
444 const_iterator begin() const noexcept { return d.data(); }
445 const_iterator cbegin() const noexcept { return begin(); }
446 const_iterator constBegin() const noexcept { return begin(); }
447 iterator end() { return begin() + size(); }
448 const_iterator end() const noexcept { return begin() + size(); }
449 const_iterator cend() const noexcept { return end(); }
450 const_iterator constEnd() const noexcept { return end(); }
455 const_reverse_iterator crbegin() const noexcept { return rbegin(); }
456 const_reverse_iterator crend() const noexcept { return rend(); }
457
458 // stl compatibility
461 typedef const char & const_reference;
462 typedef char & reference;
463 typedef char *pointer;
464 typedef const char *const_pointer;
465 typedef char value_type;
466 void push_back(char c)
467 { append(c); }
468 void push_back(const char *s)
469 { append(s); }
470 void push_back(const QByteArray &a)
471 { append(a); }
474 void push_front(char c)
475 { prepend(c); }
476 void push_front(const char *c)
477 { prepend(c); }
479 { prepend(a); }
482 void shrink_to_fit() { squeeze(); }
483 iterator erase(const_iterator first, const_iterator last);
484 inline iterator erase(const_iterator it) { return erase(it, it + 1); }
485 static constexpr qsizetype max_size() noexcept
486 {
487 // -1 to deal with the NUL terminator
488 return Data::max_size() - 1;
489 }
490
491 static QByteArray fromStdString(const std::string &s);
492 std::string toStdString() const;
493
494 inline qsizetype size() const noexcept { return d->size; }
495#if QT_DEPRECATED_SINCE(6, 4)
496 QT_DEPRECATED_VERSION_X_6_4("Use size() or length() instead.")
497 inline qsizetype count() const noexcept { return size(); }
498#endif
499 inline qsizetype length() const noexcept { return size(); }
500 QT_CORE_INLINE_SINCE(6, 4)
501 bool isNull() const noexcept;
502
503 inline const DataPointer &data_ptr() const { return d; }
504 inline DataPointer &data_ptr() { return d; }
505#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
506 explicit inline QByteArray(const DataPointer &dd) : d(dd) {}
507#endif
508 explicit inline QByteArray(DataPointer &&dd) : d(std::move(dd)) {}
509
510private:
511 friend bool comparesEqual(const QByteArray &lhs, const QByteArrayView &rhs) noexcept
512 { return QByteArrayView(lhs) == rhs; }
514 compareThreeWay(const QByteArray &lhs, const QByteArrayView &rhs) noexcept
515 {
516 const int res = QtPrivate::compareMemory(QByteArrayView(lhs), rhs);
517 return Qt::compareThreeWay(res, 0);
518 }
522#if defined(__GLIBCXX__) && defined(__cpp_lib_three_way_comparison)
523 // libstdc++ has a bug [0] when `operator const void *()` is preferred over
524 // `operator<=>()` when calling std::less<> and other similar methods.
525 // Fix it by explicitly providing relational operators in such case.
526 // [0]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114153
527 friend bool operator<(const QByteArray &lhs, const QByteArray &rhs) noexcept
528 { return is_lt(compareThreeWay(lhs, rhs)); }
529 friend bool operator<=(const QByteArray &lhs, const QByteArray &rhs) noexcept
530 { return is_lteq(compareThreeWay(lhs, rhs)); }
531 friend bool operator>(const QByteArray &lhs, const QByteArray &rhs) noexcept
532 { return is_gt(compareThreeWay(lhs, rhs)); }
533 friend bool operator>=(const QByteArray &lhs, const QByteArray &rhs) noexcept
534 { return is_gteq(compareThreeWay(lhs, rhs)); }
535#endif // defined(__GLIBCXX__) && defined(__cpp_lib_three_way_comparison)
536
537 // Check isEmpty() instead of isNull() for backwards compatibility.
538 friend bool comparesEqual(const QByteArray &lhs, std::nullptr_t) noexcept
539 { return lhs.isEmpty(); }
540 friend Qt::strong_ordering compareThreeWay(const QByteArray &lhs, std::nullptr_t) noexcept
543
544 // defined in qstring.cpp
545 friend Q_CORE_EXPORT bool comparesEqual(const QByteArray &lhs, const QChar &rhs) noexcept;
546 friend Q_CORE_EXPORT Qt::strong_ordering
547 compareThreeWay(const QByteArray &lhs, const QChar &rhs) noexcept;
548 friend Q_CORE_EXPORT bool comparesEqual(const QByteArray &lhs, char16_t rhs) noexcept;
549 friend Q_CORE_EXPORT Qt::strong_ordering
550 compareThreeWay(const QByteArray &lhs, char16_t rhs) noexcept;
551#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
554#endif // !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
555
556
557 void reallocData(qsizetype alloc, QArrayData::AllocationOption option);
558 void reallocGrowData(qsizetype n);
559 void expand(qsizetype i);
560
561 Q_ALWAYS_INLINE constexpr void verify([[maybe_unused]] qsizetype pos = 0,
562 [[maybe_unused]] qsizetype n = 1) const
563 {
564 Q_ASSERT(pos >= 0);
565 Q_ASSERT(pos <= d.size);
566 Q_ASSERT(n >= 0);
567 Q_ASSERT(n <= d.size - pos);
568 }
569
570 static QByteArray sliced_helper(QByteArray &a, qsizetype pos, qsizetype n);
571 static QByteArray toLower_helper(const QByteArray &a);
572 static QByteArray toLower_helper(QByteArray &a);
573 static QByteArray toUpper_helper(const QByteArray &a);
574 static QByteArray toUpper_helper(QByteArray &a);
575 static QByteArray trimmed_helper(const QByteArray &a);
576 static QByteArray trimmed_helper(QByteArray &a);
577 static QByteArray simplified_helper(const QByteArray &a);
578 static QByteArray simplified_helper(QByteArray &a);
579 template <typename Predicate>
580 qsizetype removeIf_helper(Predicate pred)
581 {
582 const qsizetype result = d->eraseIf(pred);
583 if (result > 0)
584 d.data()[d.size] = '\0';
585 return result;
586 }
587
588 friend class QString;
589 friend Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, qsizetype nbytes);
590
591 template <typename T> friend qsizetype erase(QByteArray &ba, const T &t);
592 template <typename Predicate> friend qsizetype erase_if(QByteArray &ba, Predicate pred);
593};
594
595Q_DECLARE_OPERATORS_FOR_FLAGS(QByteArray::Base64Options)
596
597inline constexpr QByteArray::QByteArray() noexcept {}
599
600inline char QByteArray::at(qsizetype i) const
601{ verify(i, 1); return d.data()[i]; }
603{ verify(i, 1); return d.data()[i]; }
604
605#ifndef QT_NO_CAST_FROM_BYTEARRAY
606inline QByteArray::operator const char *() const
607{ return data(); }
608inline QByteArray::operator const void *() const
609{ return data(); }
610#endif
611inline char *QByteArray::data()
612{
613 detach();
614 Q_ASSERT(d.data());
615 return d.data();
616}
617inline const char *QByteArray::data() const noexcept
618{
619#if QT5_NULL_STRINGS == 1
620 return d.data() ? d.data() : &_empty;
621#else
622 return d.data();
623#endif
624}
626{ if (d->needsDetach()) reallocData(size(), QArrayData::KeepSize); }
627inline bool QByteArray::isDetached() const
628{ return !d->isShared(); }
629inline QByteArray::QByteArray(const QByteArray &a) noexcept : d(a.d)
630{}
631
632inline qsizetype QByteArray::capacity() const { return qsizetype(d->constAllocatedCapacity()); }
633
635{
636 if (d->needsDetach() || asize > capacity() - d->freeSpaceAtBegin())
637 reallocData(qMax(size(), asize), QArrayData::KeepSize);
638 if (d->constAllocatedCapacity())
639 d->setFlag(Data::CapacityReserved);
640}
641
643{
644 if (!d.isMutable())
645 return;
646 if (d->needsDetach() || size() < capacity())
647 reallocData(size(), QArrayData::KeepSize);
648 if (d->constAllocatedCapacity())
649 d->clearFlag(Data::CapacityReserved);
650}
651
653{ verify(i, 1); return data()[i]; }
654inline char &QByteArray::front() { return operator[](0); }
655inline char &QByteArray::back() { return operator[](size() - 1); }
657{ return insert(size(), n, ch); }
659{ return insert(0, n, ch); }
660inline bool QByteArray::contains(char c) const
661{ return indexOf(c) != -1; }
663{ return indexOf(bv) != -1; }
665{
666 return cs == Qt::CaseSensitive ? QtPrivate::compareMemory(*this, a) :
667 qstrnicmp(data(), size(), a.data(), a.size());
668}
669#if !defined(QT_USE_QSTRINGBUILDER)
671{ return QByteArray(a1) += a2; }
672inline QByteArray operator+(QByteArray &&lhs, const QByteArray &rhs)
673{ return std::move(lhs += rhs); }
674inline QByteArray operator+(const QByteArray &a1, const char *a2)
675{ return QByteArray(a1) += a2; }
676inline QByteArray operator+(QByteArray &&lhs, const char *rhs)
677{ return std::move(lhs += rhs); }
678inline QByteArray operator+(const QByteArray &a1, char a2)
679{ return QByteArray(a1) += a2; }
680inline QByteArray operator+(QByteArray &&lhs, char rhs)
681{ return std::move(lhs += rhs); }
682inline QByteArray operator+(const char *a1, const QByteArray &a2)
683{ return QByteArray(a1) += a2; }
684inline QByteArray operator+(char a1, const QByteArray &a2)
685{ return QByteArray(&a1, 1) += a2; }
686#endif // QT_USE_QSTRINGBUILDER
687
689{ return setNum(qlonglong(n), base); }
693{ return setNum(qlonglong(n), base); }
697{ return setNum(qlonglong(n), base); }
701{ return setNum(double(n), format, precision); }
702
703#if QT_CORE_INLINE_IMPL_SINCE(6, 4)
704bool QByteArray::isNull() const noexcept
705{
706 return d->isNull();
707}
708#endif
709#if QT_CORE_INLINE_IMPL_SINCE(6, 7)
711{
712 return qToByteArrayViewIgnoringNull(*this).indexOf(ch, from);
713}
715{
716 return qToByteArrayViewIgnoringNull(*this).lastIndexOf(ch, from);
717}
718#endif
719
720#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED)
721Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QByteArray &);
723#endif
724
725#ifndef QT_NO_COMPRESS
726Q_CORE_EXPORT QByteArray qCompress(const uchar* data, qsizetype nbytes, int compressionLevel = -1);
727Q_CORE_EXPORT QByteArray qUncompress(const uchar* data, qsizetype nbytes);
728inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
729{ return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
731{ return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
732#endif
733
734Q_DECLARE_SHARED(QByteArray)
735
737{
738public:
741
743 {
744 decoded.swap(other.decoded);
745 std::swap(decodingStatus, other.decodingStatus);
746 }
747
748 explicit operator bool() const noexcept { return decodingStatus == QByteArray::Base64DecodingStatus::Ok; }
749
750#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(Q_QDOC)
751 QByteArray &operator*() & noexcept { return decoded; }
752 const QByteArray &operator*() const & noexcept { return decoded; }
753 QByteArray &&operator*() && noexcept { return std::move(decoded); }
754#else
755 QByteArray &operator*() noexcept { return decoded; }
756 const QByteArray &operator*() const noexcept { return decoded; }
757#endif
758
759 friend inline bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
760 {
761 if (lhs.decodingStatus != rhs.decodingStatus)
762 return false;
763
764 if (lhs.decodingStatus == QByteArray::Base64DecodingStatus::Ok && lhs.decoded != rhs.decoded)
765 return false;
766
767 return true;
768 }
769
770 friend inline bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
771 {
772 return !(lhs == rhs);
773 }
774};
775
776Q_DECLARE_SHARED(QByteArray::FromBase64Result)
777
778
779Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t qHash(const QByteArray::FromBase64Result &key, size_t seed = 0) noexcept;
780
781template <typename T>
783{
784 return ba.removeIf_helper([&t](const auto &e) { return t == e; });
785}
786
787template <typename Predicate>
789{
790 return ba.removeIf_helper(pred);
791}
792
793//
794// QByteArrayView members that require QByteArray:
795//
797{
798 return QByteArray(*this);
799}
800
801namespace Qt {
802inline namespace Literals {
803inline namespace StringLiterals {
804
805inline QByteArray operator""_ba(const char *str, size_t size) noexcept
806{
807 return QByteArray(QByteArrayData(nullptr, const_cast<char *>(str), qsizetype(size)));
808}
809
810} // StringLiterals
811} // Literals
812} // Qt
813
814inline namespace QtLiterals {
815#if QT_DEPRECATED_SINCE(6, 8)
816
817QT_DEPRECATED_VERSION_X_6_8("Use _ba from Qt::StringLiterals namespace instead.")
818inline QByteArray operator""_qba(const char *str, size_t size) noexcept
819{
820 return Qt::StringLiterals::operator""_ba(str, size);
821}
822
823#endif // QT_DEPRECATED_SINCE(6, 8)
824} // QtLiterals
825
827
828#endif // QBYTEARRAY_H
QByteArray toByteArray() const
Definition qbytearray.h:796
qsizetype lastIndexOf(QByteArrayView a) const noexcept
qsizetype indexOf(QByteArrayView a, qsizetype from=0) const noexcept
QByteArray & operator*() noexcept
Definition qbytearray.h:755
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:759
QByteArray::Base64DecodingStatus decodingStatus
Definition qbytearray.h:740
void swap(QByteArray::FromBase64Result &other) noexcept
Definition qbytearray.h:742
const QByteArray & operator*() const noexcept
Returns the decoded byte array.
Definition qbytearray.h:756
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:770
\inmodule QtCore
Definition qbytearray.h:57
QByteArray trimmed() const &
Definition qbytearray.h:262
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
Definition qbytearray.h:611
const char * const_pointer
Definition qbytearray.h:464
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:323
void push_front(QByteArrayView a)
Definition qbytearray.h:480
friend bool comparesEqual(const QByteArray &lhs, std::nullptr_t) noexcept
Definition qbytearray.h:538
bool endsWith(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:227
DataPointer & data_ptr()
Definition qbytearray.h:504
char * iterator
This typedef provides an STL-style non-const iterator for QByteArray.
Definition qbytearray.h:437
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:450
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:446
QByteArray & insert(qsizetype i, const char *s)
Inserts s at index position i and returns a reference to this byte array.
Definition qbytearray.h:316
QByteArray & prepend(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:280
QByteArray & slice(qsizetype pos)
Definition qbytearray.h:242
const_reverse_iterator crbegin() const noexcept
Definition qbytearray.h:455
QByteArray right(qsizetype n) &&
Definition qbytearray.h:187
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
Definition qbytearray.h:494
reverse_iterator rbegin()
Definition qbytearray.h:451
qsizetype size_type
Definition qbytearray.h:459
void reserve(qsizetype size)
Attempts to allocate memory for at least size bytes.
Definition qbytearray.h:634
QByteArray & assign(qsizetype n, char c)
Definition qbytearray.h:302
iterator erase(const_iterator it)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:484
friend Qt::strong_ordering compareThreeWay(const QByteArray &lhs, std::nullptr_t) noexcept
Definition qbytearray.h:540
QByteArray simplified() const &
Definition qbytearray.h:266
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:468
QByteArray left(qsizetype n) const &
Definition qbytearray.h:169
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition qbytearray.h:442
QByteArray toUpper() const &
Definition qbytearray.h:258
char * pointer
Definition qbytearray.h:463
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:321
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:688
reverse_iterator rend()
Definition qbytearray.h:452
const_iterator begin() const noexcept
Definition qbytearray.h:444
void shrink_to_fit()
Definition qbytearray.h:482
QByteArray right(qsizetype n) const &
Definition qbytearray.h:181
const_reverse_iterator crend() const noexcept
Definition qbytearray.h:456
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:351
QByteArray & operator+=(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:349
QByteArray & removeLast()
Definition qbytearray.h:330
QByteArray & prepend(const char *s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:283
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:288
bool isValidUtf8() const noexcept
Returns true if this byte array contains valid UTF-8 encoded data, or false otherwise.
Definition qbytearray.h:234
qsizetype length() const noexcept
Same as size().
Definition qbytearray.h:499
bool isDetached() const
Definition qbytearray.h:627
static constexpr qsizetype max_size() noexcept
Definition qbytearray.h:485
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last byte in the byte-...
Definition qbytearray.h:447
const char * const_iterator
This typedef provides an STL-style const iterator for QByteArray.
Definition qbytearray.h:438
QByteArray toUpper() &&
Definition qbytearray.h:260
char front() const
Definition qbytearray.h:134
char & reference
Definition qbytearray.h:462
QByteArray & removeAt(qsizetype pos)
Definition qbytearray.h:327
QByteArray trimmed() &&
Definition qbytearray.h:264
friend Qt::strong_ordering compareThreeWay(const QByteArray &lhs, const QByteArrayView &rhs) noexcept
Definition qbytearray.h:514
QByteArray & append(const char *s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:293
void push_back(const QByteArray &a)
This function is provided for STL compatibility.
Definition qbytearray.h:470
bool isSharedWith(const QByteArray &other) const noexcept
Definition qbytearray.h:127
bool startsWith(QByteArrayView bv) const
Definition qbytearray.h:223
char at(qsizetype i) const
Returns the byte at index position i in the byte array.
Definition qbytearray.h:600
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:344
const_iterator ConstIterator
Definition qbytearray.h:440
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:342
QByteArray left(qsizetype n) &&
Definition qbytearray.h:175
qsizetype count(QByteArrayView bv) const
Definition qbytearray.h:154
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:353
QByteArray(QByteArray &&other) noexcept=default
Move-constructs a QByteArray instance, making it point at the same object that other was pointing to.
void push_back(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:466
iterator Iterator
Definition qbytearray.h:439
void swap(QByteArray &other) noexcept
Definition qbytearray.h:104
void push_back(QByteArrayView a)
Definition qbytearray.h:472
QByteArray & removeIf(Predicate pred)
Definition qbytearray.h:333
QByteArray toLower() &&
Definition qbytearray.h:256
QByteArray sliced(qsizetype pos, qsizetype n) const &
Definition qbytearray.h:202
QByteArray & insert(qsizetype i, QByteArrayView data)
QByteArray & assign(InputIterator first, InputIterator last)
Definition qbytearray.h:308
QByteArray & removeFirst()
Definition qbytearray.h:329
bool contains(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:660
const_reverse_iterator rend() const noexcept
Definition qbytearray.h:454
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
Definition qbytearray.h:107
QByteArray sliced(qsizetype pos, qsizetype n) &&
Definition qbytearray.h:217
constexpr QByteArray() noexcept
Constructs an empty byte array.
Definition qbytearray.h:597
const_iterator end() const noexcept
Definition qbytearray.h:448
void detach()
Definition qbytearray.h:625
QByteArray first(qsizetype n) &&
Definition qbytearray.h:207
void squeeze()
Releases any memory not required to store the array's data.
Definition qbytearray.h:642
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:285
QByteArray sliced(qsizetype pos) &&
Definition qbytearray.h:215
QByteArray & insert(qsizetype i, const QByteArray &data)
Inserts data at index position i and returns a reference to this byte array.
Definition qbytearray.h:318
const_iterator cbegin() const noexcept
Definition qbytearray.h:445
const_reverse_iterator rbegin() const noexcept
Definition qbytearray.h:453
qsizetype lastIndexOf(QByteArrayView bv, qsizetype from) const
Definition qbytearray.h:148
QByteArray sliced(qsizetype pos) const &
Definition qbytearray.h:200
friend bool comparesEqual(const QByteArray &lhs, const QByteArrayView &rhs) noexcept
Definition qbytearray.h:511
QByteArray & operator+=(QByteArrayView a)
Definition qbytearray.h:355
int compare(QByteArrayView a, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition qbytearray.h:664
QByteArray toLower() const &
Definition qbytearray.h:254
const_iterator cend() const noexcept
Definition qbytearray.h:449
QByteArray chopped(qsizetype len) const &
Definition qbytearray.h:204
QByteArray(DataPointer &&dd)
Definition qbytearray.h:508
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:295
QByteArray & append(QByteArrayView a)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:298
qsizetype lastIndexOf(char c, qsizetype from=-1) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray last(qsizetype n) const &
Definition qbytearray.h:198
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first byte in the byte-array.
Definition qbytearray.h:443
void push_front(const QByteArray &a)
This function is provided for STL compatibility.
Definition qbytearray.h:478
qsizetype capacity() const
Returns the maximum number of bytes that can be stored in the byte array without forcing a reallocati...
Definition qbytearray.h:632
char value_type
Definition qbytearray.h:465
~QByteArray()
Destroys the byte array.
Definition qbytearray.h:598
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:136
std::reverse_iterator< iterator > reverse_iterator
Definition qbytearray.h:441
QByteArray simplified() &&
Definition qbytearray.h:268
QByteArray & slice(qsizetype pos, qsizetype n)
Definition qbytearray.h:244
char operator[](qsizetype i) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:602
QByteArray chopped(qsizetype len) &&
Definition qbytearray.h:219
void push_front(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:474
qptrdiff difference_type
Definition qbytearray.h:460
const char & const_reference
Definition qbytearray.h:461
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:476
bool endsWith(QByteArrayView bv) const
Definition qbytearray.h:228
QByteArray last(qsizetype n) &&
Definition qbytearray.h:213
bool startsWith(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qbytearray.h:225
QByteArray & assign(QByteArrayView v)
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
Definition qbytearray.h:409
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:339
\inmodule QtCore
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString static QString qsizetype from
Definition qstring.h:291
static QString static QString qsizetype Qt::CaseSensitivity cs
Definition qstring.h:291
\inmodule QtCore \title Classes and helpers for defining comparison operators \keyword qtcompare
Definition qcompare.h:400
static const strong_ordering greater
Definition qcompare.h:405
static const strong_ordering equivalent
Definition qcompare.h:403
QString str
[2]
a resize(100000)
b clear()
list append(new Employee("Blackpool", "Stephen"))
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 qsizetype lastIndexOf(QByteArrayView haystack, qsizetype from, char needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
qsizetype findByteArray(QByteArrayView haystack, qsizetype from, char 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 Q_DECL_PURE_FUNCTION bool startsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype count(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT int compareMemory(QByteArrayView lhs, QByteArrayView rhs)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isValidUtf8(QByteArrayView s) noexcept
Definition qcompare.h:63
constexpr Qt::strong_ordering compareThreeWay(LeftInt lhs, RightInt rhs) noexcept
CaseSensitivity
@ CaseSensitive
@ Ok
Definition qbezier.cpp:173
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:788
QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
Definition qbytearray.h:670
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QByteArray &)
QArrayDataPointer< char > QByteArrayData
Definition qbytearray.h:50
qsizetype erase(QByteArray &ba, const T &t)
Definition qbytearray.h:782
Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, qsizetype nbytes)
size_t qstrlen(const char *str)
QByteArrayView qToByteArrayViewIgnoringNull(const QByteArrayLike &b) noexcept
#define Q_DECLARE_STRONGLY_ORDERED(...)
#define Q_DECL_NS_RETURNS_AUTORELEASED
#define Q_DECL_PURE_FUNCTION
#define Q_DECL_CF_RETURNS_RETAINED
#define Q_ALWAYS_INLINE
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)
bool comparesEqual(const QDir &lhs, const QDir &rhs)
Definition qdir.cpp:1819
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
#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 GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei width
GLint left
GLint first
GLfloat n
GLint GLsizei GLsizei GLenum format
GLdouble s
[6]
Definition qopenglext.h:235
GLuint res
const GLubyte * c
GLuint GLfloat * val
GLdouble GLdouble t
Definition qopenglext.h:243
GLuint64EXT * result
[6]
GLuint GLenum option
GLenum GLsizei len
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:1220
#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:32
unsigned long ulong
Definition qtypes.h:35
ptrdiff_t qptrdiff
Definition qtypes.h:164
quint64 qulonglong
Definition qtypes.h:64
ptrdiff_t qsizetype
Definition qtypes.h:165
unsigned int uint
Definition qtypes.h:34
unsigned short ushort
Definition qtypes.h:33
qint64 qlonglong
Definition qtypes.h:63
Qt::weak_ordering compareThreeWay(const QUrl &lhs, const QUrl &rhs)
Definition qurl.cpp:3079
static const uint base
Definition qurlidna.cpp:20
bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:294
bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:296
static int toInt(const QChar &qc, int R)
static double toDouble(Value v)
#define explicit
QByteArray ba
[0]
settings remove("monkey")
ba fill(true)
list prepend("one")
list lastIndexOf("B")
list indexOf("B")
QSharedPointer< T > other(t)
[5]
this swap(other)
QAction * at