7#include <QtCore/qcborvalue.h>
9#include <initializer_list>
24 QCborValueRef
item {};
49#if QT_CORE_REMOVED_SINCE(6, 8)
74 static bool comparesEqual_helper(
const Iterator &lhs,
const Iterator &rhs)
noexcept
76 return lhs.item.d == rhs.item.d && lhs.item.i == rhs.item.i;
79 static bool comparesEqual_helper(
const Iterator &lhs,
const ConstIterator &rhs)
noexcept
81 return lhs.item.d == rhs.item.d && lhs.item.i == rhs.item.i;
85 const Iterator &rhs)
noexcept
92 const ConstIterator &rhs)
noexcept
101 return comparesEqual_helper(lhs, rhs);
106 return compareThreeWay_helper(lhs, rhs);
111 return comparesEqual_helper(lhs, rhs);
116 return compareThreeWay_helper(lhs, rhs);
146#if QT_CORE_REMOVED_SINCE(6, 8)
174 return lhs.item.d == rhs.item.d && lhs.item.i == rhs.item.i;
177 const ConstIterator &rhs)
noexcept
186 return comparesEqual_helper(lhs, rhs);
191 return compareThreeWay_helper(lhs, rhs);
224 bool isEmpty()
const {
return size() == 0; }
258#if QT_CORE_REMOVED_SINCE(6, 8)
288 bool empty()
const {
return isEmpty(); }
311 int c = lhs.compare(rhs);
323 return comparesEqual_helper(lhs, rhs);
328 return compareThreeWay_helper(lhs, rhs);
339 return comparesEqual_helper(lhs, rhs);
344 return compareThreeWay_helper(lhs, rhs);
351 friend QCborValueRef;
354 QExplicitlySharedDataPointer<QCborContainerPrivate>
d;
360 :
n(-1), container(
a.
d.take()),
t(Array)
364#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
365inline QCborArray QCborValueRef::toArray()
const
367 return concrete().toArray();
372 return concrete().toArray(
a);
388#if !defined(QT_NO_DEBUG_STREAM)
392#ifndef QT_NO_DATASTREAM
393#if QT_CONFIG(cborstreamwriter)
const QCborValueRef reference
ConstIterator & operator-=(qsizetype j)
Makes the iterator go back by j positions.
QCborValueConstRef operator*() const
Returns the current item.
qsizetype operator-(ConstIterator j) const
Returns the offset of this iterator relative to other.
ConstIterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
friend bool comparesEqual(const ConstIterator &lhs, const ConstIterator &rhs) noexcept
constexpr ConstIterator()=default
Constructs an uninitialized iterator.
ConstIterator & operator+=(qsizetype j)
Advances the iterator by j positions.
qsizetype difference_type
constexpr ConstIterator(const ConstIterator &)=default
Constructs a copy of other.
const QCborValueRef * pointer
ConstIterator operator+(qsizetype j) const
Returns an iterator to the item at a position j steps forward from this iterator.
ConstIterator & operator--()
The prefix {–} operator, {–it}, makes the preceding item current and returns this iterator.
std::random_access_iterator_tag iterator_category
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator.
const QCborValueConstRef * operator->() const
Returns a pointer to the current item.
ConstIterator & operator=(const ConstIterator &other)
Makes this iterator a copy of other and returns a reference to this iterator.
QCborValueConstRef operator[](qsizetype j) const
Returns the item at a position j steps forward from the item pointed to by this iterator.
friend Qt::strong_ordering compareThreeWay(const ConstIterator &lhs, const ConstIterator &rhs) noexcept
const QCborValue value_type
ConstIterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
ConstIterator & operator++()
The prefix {++} operator, {++it}, advances the iterator to the next item in the array and returns thi...
ConstIterator operator-(qsizetype j) const
Returns an iterator to the item at a position j steps backward from this iterator.
qsizetype operator-(Iterator j) const
Returns the offset of this iterator relative to other.
friend Qt::strong_ordering compareThreeWay(const Iterator &lhs, const Iterator &rhs) noexcept
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 ...
Iterator operator-(qsizetype j) const
Returns an iterator to the item at position j steps backward from this iterator.
Iterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Iterator & operator=(const Iterator &other)
Makes this iterator a copy of other and returns a reference to this iterator.
friend bool comparesEqual(const Iterator &lhs, const Iterator &rhs) noexcept
Iterator & operator++()
The prefix {++} operator, {++it}, advances the iterator to the next item in the array and returns thi...
Iterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCborValueRef operator*() const
Returns a modifiable reference to the current item.
constexpr Iterator(const Iterator &)=default
Makes a copy of other.
Iterator & operator--()
The prefix {–} operator, {–it}, makes the preceding item current and returns this iterator.
Iterator & operator+=(qsizetype j)
Advances the iterator by j positions.
qsizetype difference_type
Iterator operator+(qsizetype j) const
Returns an iterator to the item at position j steps forward from this iterator.
std::random_access_iterator_tag iterator_category
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator.
QCborValueRef * operator->()
Iterator & operator-=(qsizetype j)
Makes the iterator go back by j positions.
const QCborValueConstRef * operator->() const
Returns a pointer to a modifiable reference to the current item.
friend Qt::strong_ordering compareThreeWay(const Iterator &lhs, const ConstIterator &rhs) noexcept
\inmodule QtCore\reentrant
QCborValue & reference
A typedef to {QCborValue &}, for compatibility with generic algorithms.
QCborValue takeLast()
Removes the last item in the array and returns it.
const_iterator constEnd() const
Returns an array iterator pointing to just after the last element in this array.
const_iterator constBegin() const
Returns an array iterator pointing to the first item in this array.
QCborValue takeAt(qsizetype i)
Removes the item at position i from the array and returns it.
QCborValue takeFirst()
Removes the first item in the array and returns it, making the second element become the first.
void append(QCborValue &&value)
Appends value into the array after all other elements it may already contain.
friend Qt::strong_ordering compareThreeWay(const QCborArray &lhs, const QCborArray &rhs) noexcept
iterator begin()
Returns an array iterator pointing to the first item in this array.
const value_type * const_pointer
A typedef to {const QCborValue *}, for compatibility with generic algorithms.
void pop_front()
Synonym for removeFirst().
const_iterator begin() const
Returns an array iterator pointing to the first item in this array.
void append(const QCborValue &value)
ConstIterator const_iterator
A synonym to QCborArray::ConstIterator.
friend bool comparesEqual(const QCborArray &lhs, const QCborValue &rhs) noexcept
const_iterator end() const
Returns an array iterator pointing to just after the last element in this array.
void push_back(const QCborValue &t)
Synonym for append().
QCborValue toCborValue() const
Explicitly construcuts a \l QCborValue object that represents this array.
Iterator iterator
A synonym to QCborArray::Iterator.
friend bool comparesEqual(const QCborArray &lhs, const QCborValueConstRef &rhs) noexcept
void removeLast()
Removes the last item in the array.
iterator insert(const_iterator before, const QCborValue &value)
This is an overloaded member function, provided for convenience. It differs from the above function o...
value_type * pointer
A typedef to {QCborValue *}, for compatibility with generic algorithms.
QCborValue first() const
Returns the first QCborValue of this array.
const_iterator cend() const
Returns an array iterator pointing to just after the last element in this array.
void push_front(const QCborValue &t)
Synonym for prepend().
const QCborValue & const_reference
A typedef to {const QCborValue &}, for compatibility with generic algorithms.
QCborArray & operator+=(const QCborValue &v)
Appends v to this array and returns a reference to this array.
QCborValueRef last()
Returns a reference to the last QCborValue of this array.
void prepend(QCborValue &&value)
Prepends value into the array before any other elements it may already contain.
friend Qt::strong_ordering compareThreeWay(const QCborArray &lhs, const QCborValueConstRef &rhs) noexcept
friend Qt::strong_ordering compareThreeWay(const QCborArray &lhs, const QCborValue &rhs) noexcept
QCborValue last() const
Returns the last QCborValue of this array.
iterator erase(iterator it)
void removeFirst()
Removes the first item in the array, making the second element become the first.
qsizetype difference_type
A typedef to qsizetype.
void swap(QCborArray &other) noexcept
Swaps the contents of this object and other.
QCborValue extract(ConstIterator it)
Extracts a value from the array at the position indicated by iterator it and returns the value so ext...
bool empty() const
Synonym for isEmpty().
QCborValue value_type
The type of values that can be held in a QCborArray: that is, QCborValue.
iterator insert(iterator before, const QCborValue &value)
const_iterator cbegin() const
Returns an array iterator pointing to the first item in this array.
QCborArray operator+(const QCborValue &v) const
Returns a new QCborArray containing the same elements as this array, plus v appended as the last elem...
qsizetype size_type
A typedef to qsizetype.
iterator erase(const_iterator it)
Removes the element pointed to by the array iterator it from this array, then returns an iterator to ...
void pop_back()
Synonym for removeLast().
QCborValueRef operator[](qsizetype i)
Returns a reference to the QCborValue element at position i in the array.
QCborValueRef first()
Returns a reference to the first QCborValue of this array.
const QCborValue operator[](qsizetype i) const
Returns the QCborValue element at position i in the array.
QCborArray & operator<<(const QCborValue &v)
Appends v to this array and returns a reference to this array.
void prepend(const QCborValue &value)
iterator end()
Returns an array iterator pointing to just after the last element in this array.
QCborArray toArray() const
QCborValue concrete() const noexcept
\inmodule QtCore\reentrant
QCborArray toArray() const
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
qsizetype size() const noexcept
\inmodule QtCore \title Classes and helpers for defining comparison operators \keyword qtcompare
list append(new Employee("Blackpool", "Stephen"))
cache insert(employee->id(), employee)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
constexpr Qt::strong_ordering compareThreeWay(LeftInt lhs, RightInt rhs) noexcept
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_DECLARE_STRONGLY_ORDERED(...)
#define Q_DECL_PURE_FUNCTION
constexpr bool operator!=(const timespec &t1, const timespec &t2)
bool comparesEqual(const QDir &lhs, const QDir &rhs)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static bool contains(const QJsonArray &haystack, unsigned needle)
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
bool operator>(const QPoint &a, const QPoint &b)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
static int compare(quint64 a, quint64 b)
bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
QCborValue(QCborTag(2), QByteArray("\x01\0\0\0\0\0\0\0\0", 9))
[0]