Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qcborarray.h
Go to the documentation of this file.
1// Copyright (C) 2022 Intel Corporation.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QCBORARRAY_H
5#define QCBORARRAY_H
6
7#include <QtCore/qcborvalue.h>
8
9#include <initializer_list>
10
12
13class QJsonArray;
14class QDataStream;
15
16namespace QJsonPrivate { class Variant; }
17
19class Q_CORE_EXPORT QCborArray
20{
21public:
22 class ConstIterator;
23 class Iterator {
24 QCborValueRef item {};
25 friend class ConstIterator;
26 friend class QCborArray;
27 Iterator(QCborContainerPrivate *dd, qsizetype ii) : item(dd, ii) {}
28 public:
29 typedef std::random_access_iterator_tag iterator_category;
32 typedef QCborValueRef reference;
33 typedef QCborValueRef *pointer;
34
35 constexpr Iterator() = default;
36 constexpr Iterator(const Iterator &) = default;
38 {
39 // rebind the reference
40 item.d = other.item.d;
41 item.i = other.item.i;
42 return *this;
43 }
44
45 QCborValueRef operator*() const { return item; }
46 QCborValueRef *operator->() { return &item; }
47 const QCborValueConstRef *operator->() const { return &item; }
48 QCborValueRef operator[](qsizetype j) const { return { item.d, item.i + j }; }
49
50 bool operator==(const Iterator &o) const { return item.d == o.item.d && item.i == o.item.i; }
51 bool operator!=(const Iterator &o) const { return !(*this == o); }
52 bool operator<(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i < other.item.i; }
53 bool operator<=(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i <= other.item.i; }
54 bool operator>(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i > other.item.i; }
55 bool operator>=(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i >= other.item.i; }
56 bool operator==(const ConstIterator &o) const { return item.d == o.item.d && item.i == o.item.i; }
57 bool operator!=(const ConstIterator &o) const { return !(*this == o); }
58 bool operator<(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i < other.item.i; }
59 bool operator<=(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i <= other.item.i; }
60 bool operator>(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i > other.item.i; }
61 bool operator>=(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i >= other.item.i; }
62 Iterator &operator++() { ++item.i; return *this; }
63 Iterator operator++(int) { Iterator n = *this; ++item.i; return n; }
64 Iterator &operator--() { item.i--; return *this; }
65 Iterator operator--(int) { Iterator n = *this; item.i--; return n; }
66 Iterator &operator+=(qsizetype j) { item.i += j; return *this; }
67 Iterator &operator-=(qsizetype j) { item.i -= j; return *this; }
68 Iterator operator+(qsizetype j) const { return Iterator({ item.d, item.i + j }); }
69 Iterator operator-(qsizetype j) const { return Iterator({ item.d, item.i - j }); }
70 qsizetype operator-(Iterator j) const { return item.i - j.item.i; }
71 };
72
75 friend class Iterator;
76 friend class QCborArray;
78 public:
79 typedef std::random_access_iterator_tag iterator_category;
81 typedef const QCborValue value_type;
82 typedef const QCborValueRef reference;
83 typedef const QCborValueRef *pointer;
84
85 constexpr ConstIterator() = default;
86 constexpr ConstIterator(const ConstIterator &) = default;
88 {
89 // rebind the reference
90 item.d = other.item.d;
91 item.i = other.item.i;
92 return *this;
93 }
94
95 QCborValueConstRef operator*() const { return item; }
96 const QCborValueConstRef *operator->() const { return &item; }
97 QCborValueConstRef operator[](qsizetype j) const { return QCborValueRef{ item.d, item.i + j }; }
98
99 bool operator==(const Iterator &o) const { return item.d == o.item.d && item.i == o.item.i; }
100 bool operator!=(const Iterator &o) const { return !(*this == o); }
101 bool operator<(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i < other.item.i; }
102 bool operator<=(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i <= other.item.i; }
103 bool operator>(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i > other.item.i; }
104 bool operator>=(const Iterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i >= other.item.i; }
105 bool operator==(const ConstIterator &o) const { return item.d == o.item.d && item.i == o.item.i; }
106 bool operator!=(const ConstIterator &o) const { return !(*this == o); }
107 bool operator<(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i < other.item.i; }
108 bool operator<=(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i <= other.item.i; }
109 bool operator>(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i > other.item.i; }
110 bool operator>=(const ConstIterator& other) const { Q_ASSERT(item.d == other.item.d); return item.i >= other.item.i; }
111 ConstIterator &operator++() { ++item.i; return *this; }
112 ConstIterator operator++(int) { ConstIterator n = *this; ++item.i; return n; }
113 ConstIterator &operator--() { item.i--; return *this; }
114 ConstIterator operator--(int) { ConstIterator n = *this; item.i--; return n; }
115 ConstIterator &operator+=(qsizetype j) { item.i += j; return *this; }
116 ConstIterator &operator-=(qsizetype j) { item.i -= j; return *this; }
117 ConstIterator operator+(qsizetype j) const { return ConstIterator({ item.d, item.i + j }); }
118 ConstIterator operator-(qsizetype j) const { return ConstIterator({ item.d, item.i - j }); }
119 qsizetype operator-(ConstIterator j) const { return item.i - j.item.i; }
120 };
121
125 typedef const value_type *const_pointer;
129
130 QCborArray() noexcept;
131 QCborArray(const QCborArray &other) noexcept;
132 QCborArray &operator=(const QCborArray &other) noexcept;
133 QCborArray(std::initializer_list<QCborValue> args)
134 : QCborArray()
135 {
136 detach(qsizetype(args.size()));
137 for (const QCborValue &v : args)
138 append(v);
139 }
140 ~QCborArray();
141
142 void swap(QCborArray &other) noexcept
143 {
144 d.swap(other.d);
145 }
146
147 QCborValue toCborValue() const { return *this; }
148
149 qsizetype size() const noexcept;
150 bool isEmpty() const { return size() == 0; }
151 void clear();
152
153 QCborValue at(qsizetype i) const;
154 QCborValue first() const { return at(0); }
155 QCborValue last() const { return at(size() - 1); }
156 const QCborValue operator[](qsizetype i) const { return at(i); }
157 QCborValueRef first() { Q_ASSERT(!isEmpty()); return begin()[0]; }
158 QCborValueRef last() { Q_ASSERT(!isEmpty()); return begin()[size() - 1]; }
159 QCborValueRef operator[](qsizetype i)
160 {
161 if (i >= size())
162 insert(i, QCborValue());
163 return begin()[i];
164 }
165
166 void insert(qsizetype i, const QCborValue &value);
168 void prepend(const QCborValue &value) { insert(0, value); }
169 void prepend(QCborValue &&value) { insert(0, std::move(value)); }
170 void append(const QCborValue &value) { insert(-1, value); }
171 void append(QCborValue &&value) { insert(-1, std::move(value)); }
172 QCborValue extract(ConstIterator it) { return extract(Iterator{ it.item.d, it.item.i }); }
173 QCborValue extract(Iterator it);
174 void removeAt(qsizetype i);
175 QCborValue takeAt(qsizetype i) { Q_ASSERT(i < size()); return extract(begin() + i); }
176 void removeFirst() { removeAt(0); }
177 void removeLast() { removeAt(size() - 1); }
178 QCborValue takeFirst() { return takeAt(0); }
179 QCborValue takeLast() { return takeAt(size() - 1); }
180
181 bool contains(const QCborValue &value) const;
182
183 int compare(const QCborArray &other) const noexcept Q_DECL_PURE_FUNCTION;
184#if 0 && __has_include(<compare>)
185 std::strong_ordering operator<=>(const QCborArray &other) const
186 {
187 int c = compare(other);
188 if (c > 0) return std::strong_ordering::greater;
189 if (c == 0) return std::strong_ordering::equivalent;
190 return std::strong_ordering::less;
191 }
192#else
193 bool operator==(const QCborArray &other) const noexcept
194 { return compare(other) == 0; }
195 bool operator!=(const QCborArray &other) const noexcept
196 { return !(*this == other); }
197 bool operator<(const QCborArray &other) const
198 { return compare(other) < 0; }
199#endif
200
203 iterator begin() { detach(); return iterator{d.data(), 0}; }
204 const_iterator constBegin() const { return const_iterator{d.data(), 0}; }
205 const_iterator begin() const { return constBegin(); }
206 const_iterator cbegin() const { return constBegin(); }
207 iterator end() { detach(); return iterator{d.data(), size()}; }
208 const_iterator constEnd() const { return const_iterator{d.data(), size()}; }
209 const_iterator end() const { return constEnd(); }
210 const_iterator cend() const { return constEnd(); }
212 { insert(before.item.i, value); return iterator{d.data(), before.item.i}; }
214 { insert(before.item.i, value); return iterator{d.data(), before.item.i}; }
215 iterator erase(iterator it) { removeAt(it.item.i); return iterator{d.data(), it.item.i}; }
216 iterator erase(const_iterator it) { removeAt(it.item.i); return iterator{d.data(), it.item.i}; }
217
218 void push_back(const QCborValue &t) { append(t); }
219 void push_front(const QCborValue &t) { prepend(t); }
220 void pop_front() { removeFirst(); }
221 void pop_back() { removeLast(); }
222 bool empty() const { return isEmpty(); }
223
224 // convenience
226 { QCborArray n = *this; n += v; return n; }
228 { append(v); return *this; }
230 { append(v); return *this; }
231
232 static QCborArray fromStringList(const QStringList &list);
233 static QCborArray fromVariantList(const QVariantList &list);
234 static QCborArray fromJsonArray(const QJsonArray &array);
235 static QCborArray fromJsonArray(QJsonArray &&array) noexcept;
236 QVariantList toVariantList() const;
237 QJsonArray toJsonArray() const;
238
239private:
240 void detach(qsizetype reserve = 0);
241
242 friend QCborValue;
243 friend QCborValueRef;
245 explicit QCborArray(QCborContainerPrivate &dd) noexcept;
247};
248
249Q_DECLARE_SHARED(QCborArray)
250
252 : n(-1), container(a.d.take()), t(Array)
253{
254}
255
256#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
257inline QCborArray QCborValueRef::toArray() const
258{
259 return concrete().toArray();
260}
261
262inline QCborArray QCborValueRef::toArray(const QCborArray &a) const
263{
264 return concrete().toArray(a);
265}
266#endif
267
269{
270 return concrete().toArray();
271}
272
274{
275 return concrete().toArray(a);
276}
277
278Q_CORE_EXPORT size_t qHash(const QCborArray &array, size_t seed = 0);
279
280#if !defined(QT_NO_DEBUG_STREAM)
281Q_CORE_EXPORT QDebug operator<<(QDebug, const QCborArray &a);
282#endif
283
284#ifndef QT_NO_DATASTREAM
285#if QT_CONFIG(cborstreamwriter)
286Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QCborArray &);
287#endif
288Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QCborArray &);
289#endif
290
292
293#endif // QCBORARRAY_H
\inmodule QtCore
Definition qcborarray.h:73
const QCborValueRef reference
Definition qcborarray.h:82
ConstIterator & operator-=(qsizetype j)
Makes the iterator go back by j positions.
Definition qcborarray.h:116
QCborValueConstRef operator*() const
Returns the current item.
Definition qcborarray.h:95
qsizetype operator-(ConstIterator j) const
Returns the offset of this iterator relative to other.
Definition qcborarray.h:119
bool operator>(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs after the entry pointed to ...
Definition qcborarray.h:109
ConstIterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qcborarray.h:114
bool operator>=(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs after or is the same entry ...
Definition qcborarray.h:110
constexpr ConstIterator()=default
Constructs an uninitialized iterator.
bool operator<(const Iterator &other) const
Definition qcborarray.h:101
bool operator<(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs before the entry pointed to...
Definition qcborarray.h:107
bool operator!=(const ConstIterator &o) const
Returns true if o points to a different entry in the array than this iterator; otherwise returns fals...
Definition qcborarray.h:106
ConstIterator & operator+=(qsizetype j)
Advances the iterator by j positions.
Definition qcborarray.h:115
bool operator<=(const Iterator &other) const
Definition qcborarray.h:102
bool operator==(const Iterator &o) const
Definition qcborarray.h:99
bool operator>=(const Iterator &other) const
Definition qcborarray.h:104
constexpr ConstIterator(const ConstIterator &)=default
Constructs a copy of other.
const QCborValueRef * pointer
Definition qcborarray.h:83
ConstIterator operator+(qsizetype j) const
Returns an iterator to the item at a position j steps forward from this iterator.
Definition qcborarray.h:117
ConstIterator & operator--()
The prefix {–} operator, {–it}, makes the preceding item current and returns this iterator.
Definition qcborarray.h:113
std::random_access_iterator_tag iterator_category
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator.
Definition qcborarray.h:79
const QCborValueConstRef * operator->() const
Returns a pointer to the current item.
Definition qcborarray.h:96
ConstIterator & operator=(const ConstIterator &other)
Makes this iterator a copy of other and returns a reference to this iterator.
Definition qcborarray.h:87
bool operator==(const ConstIterator &o) const
Returns true if other points to the same entry in the array as this iterator; otherwise returns false...
Definition qcborarray.h:105
bool operator!=(const Iterator &o) const
Definition qcborarray.h:100
QCborValueConstRef operator[](qsizetype j) const
Returns the item at a position j steps forward from the item pointed to by this iterator.
Definition qcborarray.h:97
const QCborValue value_type
Definition qcborarray.h:81
ConstIterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qcborarray.h:112
ConstIterator & operator++()
The prefix {++} operator, {++it}, advances the iterator to the next item in the array and returns thi...
Definition qcborarray.h:111
bool operator<=(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs before or is the same entry...
Definition qcborarray.h:108
ConstIterator operator-(qsizetype j) const
Returns an iterator to the item at a position j steps backward from this iterator.
Definition qcborarray.h:118
bool operator>(const Iterator &other) const
Definition qcborarray.h:103
\inmodule QtCore
Definition qcborarray.h:23
qsizetype operator-(Iterator j) const
Returns the offset of this iterator relative to other.
Definition qcborarray.h:70
constexpr Iterator()=default
Constructs an uninitialized iterator.
QCborValueRef operator[](qsizetype j) const
Returns a modifiable reference to the item at a position j steps forward from the item pointed to by ...
Definition qcborarray.h:48
bool operator<(const Iterator &other) const
Definition qcborarray.h:52
bool operator<=(const Iterator &other) const
Definition qcborarray.h:53
Iterator operator-(qsizetype j) const
Returns an iterator to the item at position j steps backward from this iterator.
Definition qcborarray.h:69
bool operator==(const ConstIterator &o) const
Returns true if other points to the same entry in the array as this iterator; otherwise returns false...
Definition qcborarray.h:56
Iterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qcborarray.h:65
QCborValue value_type
Definition qcborarray.h:31
Iterator & operator=(const Iterator &other)
Makes this iterator a copy of other and returns a reference to this iterator.
Definition qcborarray.h:37
bool operator>(const Iterator &other) const
Definition qcborarray.h:54
Iterator & operator++()
The prefix {++} operator, {++it}, advances the iterator to the next item in the array and returns thi...
Definition qcborarray.h:62
Iterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qcborarray.h:63
QCborValueRef operator*() const
Returns a modifiable reference to the current item.
Definition qcborarray.h:45
constexpr Iterator(const Iterator &)=default
Makes a copy of other.
bool operator<(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs before the entry pointed to...
Definition qcborarray.h:58
bool operator>=(const Iterator &other) const
Definition qcborarray.h:55
Iterator & operator--()
The prefix {–} operator, {–it}, makes the preceding item current and returns this iterator.
Definition qcborarray.h:64
Iterator & operator+=(qsizetype j)
Advances the iterator by j positions.
Definition qcborarray.h:66
qsizetype difference_type
Definition qcborarray.h:30
Iterator operator+(qsizetype j) const
Returns an iterator to the item at position j steps forward from this iterator.
Definition qcborarray.h:68
QCborValueRef reference
Definition qcborarray.h:32
std::random_access_iterator_tag iterator_category
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator.
Definition qcborarray.h:29
bool operator>=(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs after or is the same entry ...
Definition qcborarray.h:61
QCborValueRef * operator->()
Definition qcborarray.h:46
bool operator>(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs after the entry pointed to ...
Definition qcborarray.h:60
bool operator!=(const ConstIterator &o) const
Returns true if other points to a different entry in the array than this iterator; otherwise returns ...
Definition qcborarray.h:57
bool operator!=(const Iterator &o) const
Definition qcborarray.h:51
QCborValueRef * pointer
Definition qcborarray.h:33
bool operator<=(const ConstIterator &other) const
Returns true if the entry in the array pointed to by this iterator occurs before or is the same entry...
Definition qcborarray.h:59
Iterator & operator-=(qsizetype j)
Makes the iterator go back by j positions.
Definition qcborarray.h:67
bool operator==(const Iterator &o) const
Definition qcborarray.h:50
const QCborValueConstRef * operator->() const
Returns a pointer to a modifiable reference to the current item.
Definition qcborarray.h:47
\inmodule QtCore\reentrant
Definition qcborarray.h:20
QCborValue & reference
A typedef to {QCborValue &}, for compatibility with generic algorithms.
Definition qcborarray.h:126
QCborValue takeLast()
Removes the last item in the array and returns it.
Definition qcborarray.h:179
const_iterator constEnd() const
Returns an array iterator pointing to just after the last element in this array.
Definition qcborarray.h:208
const_iterator constBegin() const
Returns an array iterator pointing to the first item in this array.
Definition qcborarray.h:204
QCborValue takeAt(qsizetype i)
Removes the item at position i from the array and returns it.
Definition qcborarray.h:175
QCborValue takeFirst()
Removes the first item in the array and returns it, making the second element become the first.
Definition qcborarray.h:178
void append(QCborValue &&value)
Appends value into the array after all other elements it may already contain.
Definition qcborarray.h:171
iterator begin()
Returns an array iterator pointing to the first item in this array.
Definition qcborarray.h:203
bool operator==(const QCborArray &other) const noexcept
Compares this array and other, comparing each element in sequence, and returns true if both arrays co...
Definition qcborarray.h:193
bool operator!=(const QCborArray &other) const noexcept
Compares this array and other, comparing each element in sequence, and returns true if the two arrays...
Definition qcborarray.h:195
const value_type * const_pointer
A typedef to {const QCborValue *}, for compatibility with generic algorithms.
Definition qcborarray.h:125
void pop_front()
Synonym for removeFirst().
Definition qcborarray.h:220
const_iterator begin() const
Returns an array iterator pointing to the first item in this array.
Definition qcborarray.h:205
void append(const QCborValue &value)
Definition qcborarray.h:170
ConstIterator const_iterator
A synonym to QCborArray::ConstIterator.
Definition qcborarray.h:202
const_iterator end() const
Returns an array iterator pointing to just after the last element in this array.
Definition qcborarray.h:209
void push_back(const QCborValue &t)
Synonym for append().
Definition qcborarray.h:218
QCborValue toCborValue() const
Explicitly construcuts a \l QCborValue object that represents this array.
Definition qcborarray.h:147
Iterator iterator
A synonym to QCborArray::Iterator.
Definition qcborarray.h:201
void removeLast()
Removes the last item in the array.
Definition qcborarray.h:177
iterator insert(const_iterator before, const QCborValue &value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qcborarray.h:213
value_type * pointer
A typedef to {QCborValue *}, for compatibility with generic algorithms.
Definition qcborarray.h:124
QCborValue first() const
Returns the first QCborValue of this array.
Definition qcborarray.h:154
const_iterator cend() const
Returns an array iterator pointing to just after the last element in this array.
Definition qcborarray.h:210
void push_front(const QCborValue &t)
Synonym for prepend().
Definition qcborarray.h:219
const QCborValue & const_reference
A typedef to {const QCborValue &}, for compatibility with generic algorithms.
Definition qcborarray.h:127
QCborArray & operator+=(const QCborValue &v)
Appends v to this array and returns a reference to this array.
Definition qcborarray.h:227
QCborValueRef last()
Returns a reference to the last QCborValue of this array.
Definition qcborarray.h:158
void prepend(QCborValue &&value)
Prepends value into the array before any other elements it may already contain.
Definition qcborarray.h:169
QCborValue last() const
Returns the last QCborValue of this array.
Definition qcborarray.h:155
iterator erase(iterator it)
Definition qcborarray.h:215
void removeFirst()
Removes the first item in the array, making the second element become the first.
Definition qcborarray.h:176
qsizetype difference_type
A typedef to qsizetype.
Definition qcborarray.h:128
void swap(QCborArray &other) noexcept
Swaps the contents of this object and other.
Definition qcborarray.h:142
QCborValue extract(ConstIterator it)
Extracts a value from the array at the position indicated by iterator it and returns the value so ext...
Definition qcborarray.h:172
bool empty() const
Synonym for isEmpty().
Definition qcborarray.h:222
QCborValue value_type
The type of values that can be held in a QCborArray: that is, QCborValue.
Definition qcborarray.h:123
iterator insert(iterator before, const QCborValue &value)
Definition qcborarray.h:211
const_iterator cbegin() const
Returns an array iterator pointing to the first item in this array.
Definition qcborarray.h:206
QCborArray operator+(const QCborValue &v) const
Returns a new QCborArray containing the same elements as this array, plus v appended as the last elem...
Definition qcborarray.h:225
qsizetype size_type
A typedef to qsizetype.
Definition qcborarray.h:122
iterator erase(const_iterator it)
Removes the element pointed to by the array iterator it from this array, then returns an iterator to ...
Definition qcborarray.h:216
bool operator<(const QCborArray &other) const
Compares this array and other, comparing each element in sequence, and returns true if this array sho...
Definition qcborarray.h:197
void pop_back()
Synonym for removeLast().
Definition qcborarray.h:221
QCborValueRef operator[](qsizetype i)
Returns a reference to the QCborValue element at position i in the array.
Definition qcborarray.h:159
QCborValueRef first()
Returns a reference to the first QCborValue of this array.
Definition qcborarray.h:157
const QCborValue operator[](qsizetype i) const
Returns the QCborValue element at position i in the array.
Definition qcborarray.h:156
QCborArray & operator<<(const QCborValue &v)
Appends v to this array and returns a reference to this array.
Definition qcborarray.h:229
void prepend(const QCborValue &value)
Definition qcborarray.h:168
iterator end()
Returns an array iterator pointing to just after the last element in this array.
Definition qcborarray.h:207
QCborArray toArray() const
Definition qcborarray.h:268
QCborValue concrete() const noexcept
Definition qcborvalue.h:408
\inmodule QtCore\reentrant
Definition qcborvalue.h:50
QCborArray toArray() const
\inmodule QtCore\reentrant
Definition qdatastream.h:30
\inmodule QtCore
\inmodule QtCore\reentrant
Definition qjsonarray.h:18
qsizetype size() const noexcept
Definition qlist.h:386
\inmodule QtCore
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 QDataStream & operator>>(QDataStream &, QCborArray &)
Q_CORE_EXPORT size_t qHash(const QCborArray &array, size_t seed=0)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QCborArray &a)
#define Q_DECL_PURE_FUNCTION
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLfloat n
const GLubyte * c
GLenum array
GLdouble GLdouble t
Definition qopenglext.h:243
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static int compare(quint64 a, quint64 b)
ptrdiff_t qsizetype
Definition qtypes.h:70
QList< int > list
[14]
list prepend("one")
QSharedPointer< T > other(t)
[5]
QGraphicsItem * item
QAction * at
QJSValueList args