7#include <QtCore/qcborvalue.h>
8#include <QtCore/qpair.h>
10#include <initializer_list>
30 QCborValueRef
item {};
55#if QT_VERSION >= QT_VERSION_CHECK(7,0,0)
91 friend class QCborValueRef;
114#if QT_VERSION >= QT_VERSION_CHECK(7,0,0)
152 for (
const auto &pair :
args)
153 insert(pair.first, pair.second);
165 bool isEmpty()
const {
return size() == 0; }
177#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
189#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
195 QCborValueRef operator[](
const QString &
key);
224#if 0 && __has_include(<compare>)
225 std::strong_ordering operator<=>(
const QCborMap &
other)
const
228 if (
c > 0)
return std::strong_ordering::greater;
229 if (
c == 0)
return std::strong_ordering::equivalent;
230 return std::strong_ordering::less;
236 {
return !(*
this ==
other); }
255 bool empty()
const {
return isEmpty(); }
261 const_iterator constFind(
qint64 key)
const;
263 const_iterator constFind(
const QString &
key)
const;
272 QCborValueRef
v = operator[](
key);
274 return {
d.data(),
v.i };
278 QCborValueRef
v = operator[](
key);
280 return {
d.data(),
v.i };
284 QCborValueRef
v = operator[](
key);
286 return {
d.data(),
v.i };
290 QCborValueRef
v = operator[](
key);
292 return {
d.data(),
v.i };
307 friend class QCborValueRef;
318 :
n(-1), container(
m.
d.take()),
t(
Map)
322#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
323inline QCborMap QCborValueRef::toMap()
const
325 return concrete().toMap();
330 return concrete().toMap(
m);
346#if !defined(QT_NO_DEBUG_STREAM)
350#ifndef QT_NO_DATASTREAM
351#if QT_CONFIG(cborstreamwriter)
bool operator>=(const Iterator &other) const
QCborValueConstRef key() const
Returns the current item's key.
ConstIterator & operator++()
The prefix {++} operator, {++i}, advances the iterator to the next item in the map and returns this i...
value_type operator[](qsizetype j) const
bool operator==(const ConstIterator &o) const
constexpr ConstIterator(const ConstIterator &)=default
Constructs an iterator as a copy of other.
ConstIterator operator-(qsizetype j) const
Returns an iterator to the item at j positions backward from this iterator.
ConstIterator & operator--()
The prefix {–} operator, {–i}, makes the preceding item current and returns this iterator.
qsizetype difference_type
bool operator<(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs before the entry pointed to b...
bool operator!=(const ConstIterator &o) const
QPair< QCborValueConstRef, QCborValueConstRef > reference
bool operator>(const Iterator &other) const
qsizetype operator-(ConstIterator j) const
Returns the position of the item at iterator j relative to the item at this iterator.
ConstIterator & operator-=(qsizetype j)
Makes the iterator go back by j items.
const QCborValueConstRef * operator->() const
Returns a pointer to the current pair's value.
QCborValueConstRef value() const
Returns the current item's value.
constexpr ConstIterator()=default
Constructs an uninitialized iterator.
ConstIterator & operator=(const ConstIterator &other)
Makes this iterator a copy of other and returns a reference to this iterator.
bool operator>=(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs after or is the same entry as...
QPair< QCborValueConstRef, QCborValueConstRef > pointer
ConstIterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::random_access_iterator_tag iterator_category
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random-access iterator.
bool operator<=(const Iterator &other) const
bool operator>(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs after the entry pointed to by...
bool operator<(const Iterator &other) const
ConstIterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QPair< QCborValueConstRef, QCborValueConstRef > value_type
ConstIterator operator+(qsizetype j) const
Returns an iterator to the item at j positions forward from this iterator.
bool operator!=(const Iterator &o) const
Returns true if other points to a different entry in the map than this iterator; otherwise returns fa...
bool operator==(const Iterator &o) const
Returns true if other points to the same entry in the map as this iterator; otherwise returns false.
value_type operator*() const
Returns a pair containing the current item's key and value.
ConstIterator & operator+=(qsizetype j)
Advances the iterator by j items.
bool operator<=(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs before or is the same entry a...
\inmodule QtCore\reentrant
Iterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 a modifiable reference to the current pair's value.
bool operator>(const Iterator &other) const
bool operator==(const ConstIterator &o) const
Returns true if other points to the same entry in the map as this iterator; otherwise returns false.
bool operator!=(const Iterator &o) const
Iterator operator+(qsizetype j) const
Returns an iterator to the item at j positions forward from this iterator.
value_type operator*() const
Returns a pair containing the current item's key and a modifiable reference to the current item's val...
QCborValueConstRef key() const
Returns the current item's key.
Iterator & operator=(const Iterator &other)
Makes this iterator a copy of other and returns a reference to this iterator.
constexpr Iterator()=default
Constructs an uninitialized iterator.
bool operator>=(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs after or is the same entry as...
bool operator<(const Iterator &other) const
bool operator!=(const ConstIterator &o) const
Returns true if other points to a different entry in the map than this iterator; otherwise returns fa...
Iterator & operator-=(qsizetype j)
Makes the iterator go back by j items.
Iterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool operator<=(const Iterator &other) const
bool operator>(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs after the entry pointed to by...
bool operator>=(const Iterator &other) const
qsizetype operator-(Iterator j) const
Returns the position of the item at iterator j relative to the item at this iterator.
Iterator operator-(qsizetype j) const
Returns an iterator to the item at j positions backward from this iterator.
QPair< QCborValueConstRef, QCborValueRef > pointer
value_type operator[](qsizetype j) const
Iterator & operator++()
The prefix {++} operator, {++i}, advances the iterator to the next item in the map and returns this i...
qsizetype difference_type
constexpr Iterator(const Iterator &)=default
Constructs an iterator as a copy of other.
QCborValueRef * operator->()
Iterator & operator--()
The prefix {–} operator, {–i}, makes the preceding item current and returns this iterator.
QCborValueRef value() const
Returns a modifiable reference to the current item's value.
Iterator & operator+=(qsizetype j)
Advances the iterator by j items.
QPair< QCborValueConstRef, QCborValueRef > reference
bool operator==(const Iterator &o) const
bool operator<=(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs before or is the same entry a...
QPair< QCborValueConstRef, QCborValueRef > value_type
bool operator<(const ConstIterator &other) const
Returns true if the entry in the map pointed to by this iterator occurs before the entry pointed to b...
\inmodule QtCore\reentrant
bool operator<(const QCborMap &other) const
Compares this map and other, comparing each element in sequence, and returns true if this map should ...
QCborValue extract(const_iterator it)
Extracts a value from the map at the position indicated by iterator it and returns the value so extra...
QCborValue value(const QString &key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
iterator erase(const_iterator it)
Removes the key-value pair pointed to by the map iterator it and returns a pointer to the next elemen...
QCborValue toCborValue() const
Explicitly constructs a \l QCborValue object that represents this map.
const_iterator find(qint64 key) const
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair.
bool contains(const QString &key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const_iterator end() const
Returns a map iterator representing an element just past the last element in the map.
QCborValue value(qint64 key) const
Returns the QCborValue element in this map that corresponds to key key, if there is one.
iterator insert(QLatin1StringView key, const QCborValue &value_)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool operator==(const QCborMap &other) const noexcept
Compares this map and other, comparing each element in sequence, and returns true if the two maps con...
bool empty() const
Synonym for isEmpty().
const_iterator cend() const
Returns a map iterator representing an element just past the last element in the map.
void swap(QCborMap &other) noexcept
Swaps the contents of this map and other.
const_iterator find(const QCborValue &key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCborValue take(QLatin1StringView key)
Removes the key key and the corresponding value from the map and returns the value,...
bool operator!=(const QCborMap &other) const noexcept
Compares this map and other, comparing each element in sequence, and returns true if the two maps con...
qsizetype size_type
The type that QCborMap uses for sizes.
QT_ASCII_CAST_WARN const QCborValue value(const char(&key)[N]) const
iterator end()
Returns a map iterator representing an element just past the last element in the map.
void remove(const QCborValue &key)
Removes the key key and the corresponding value from the map, if it is found.
void remove(const QString &key)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCborValue mapped_type
The type that is mapped to (the value), that is, a QCborValue.
QCborValue take(qint64 key)
Removes the key key and the corresponding value from the map and returns the value,...
const_iterator find(const QString &key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
iterator insert(const QCborValue &key, const QCborValue &value_)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const QCborValue operator[](const QCborValue &key) const
Returns the QCborValue element in this map that corresponds to key key, if there is one.
const QCborValue operator[](QLatin1StringView key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCborValue value(const QCborValue &key) const
Returns the QCborValue element in this map that corresponds to key key, if there is one.
QCborValue take(const QCborValue &key)
Removes the key key and the corresponding value from the map and returns the value,...
QPair< QCborValue, QCborValue > value_type
The value that is stored in this container: a pair of QCborValues.
const_iterator begin() const
Returns a map iterator pointing to the first key-value pair of this map.
void remove(QLatin1StringView key)
This is an overloaded member function, provided for convenience. It differs from the above function o...
iterator insert(const QString &key, const QCborValue &value_)
This is an overloaded member function, provided for convenience. It differs from the above function o...
ConstIterator const_iterator
A synonym for QCborMap::ConstIterator.
const_iterator cbegin() const
Returns a map iterator pointing to the first key-value pair of this map.
const_iterator find(QLatin1StringView key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCborValue key_type
The key type for this map.
bool contains(qint64 key) const
Returns true if this map contains a key-value pair identified by key key.
iterator insert(qint64 key, const QCborValue &value_)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const_iterator constBegin() const
Returns a map iterator pointing to the first key-value pair of this map.
QT_ASCII_CAST_WARN const QCborValue operator[](const char(&key)[N]) const
bool contains(const QCborValue &key) const
Returns true if this map contains a key-value pair identified by key key.
bool contains(QLatin1StringView key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCborValue take(const QString &key)
Removes the key key and the corresponding value from the map and returns the value,...
const QCborValue operator[](const QString &key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
iterator begin()
Returns a map iterator pointing to the first key-value pair of this map.
const QCborValue operator[](qint64 key) const
Returns the QCborValue element in this map that corresponds to key key, if there is one.
QCborValue value(QLatin1StringView key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const_iterator constEnd() const
Returns a map iterator representing an element just past the last element in the map.
iterator insert(value_type v)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Iterator iterator
A synonym for QCborMap::Iterator.
void remove(qint64 key)
Removes the key key and the corresponding value from the map, if it is found.
QCborValue concrete() const noexcept
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
qsizetype size() const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QHash< int, QWidget * > hash
[35multi]
QMap< QString, QString > map
[6]
cache insert(employee->id(), employee)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
qsizetype erase(QByteArray &ba, const T &t)
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QCborMap &)
Q_CORE_EXPORT size_t qHash(const QCborMap &map, size_t seed=0)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QCborMap &m)
#define Q_DECL_PURE_FUNCTION
std::pair< T1, T2 > QPair
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define QT_ASCII_CAST_WARN
static int compare(quint64 a, quint64 b)