QCborMap Class▲
-
Header: QCborMap
-
Since: Qt 5.12
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
-
qmake: QT += core
-
Group: QCborMap is part of cbor
Detailed Description▲
This class can be used to hold an associative container in CBOR, a map between a key and a value type. CBOR is the Concise Binary Object Representation, a very compact form of binary data encoding that is a superset of JSON. It was created by the IETF Constrained RESTful Environments (CoRE) WG, which has used it in many new RFCs. It is meant to be used alongside the https://.
Unlike JSON and https://, CBOR map keys can be of any type, not just strings. For that reason, https:// is effectively a map between https:// keys to https:// value elements.
However, for all member functions that take a key parameter, https:// provides overloads that will work efficiently with integers and strings. In fact, the use of integer keys is encouraged, since they occupy fewer bytes to transmit and are simpler to encode and decode. Newer protocols designed by the IETF CoRE WG to work specifically with CBOR are known to use them.
https:// is not sorted, because of that, searching for keys has linear complexity (O(n)). https:// actually keeps the elements in the order that they were inserted, which means that it is possible to make sorted QCborMaps by carefully inserting elements in sorted order. CBOR does not require sorting, but recommends it.
https:// can also be converted to and from https:// and https://. However, when performing the conversion, any non-string keys will be stringified using a one-way method that the conversion back to https:// will not undo.
See Also▲
See also https://, https://, https://, https://
Member Type Documentation▲
QCborMap::const_iterator▲
A synonym for https://
QCborMap::iterator▲
A synonym for https://.
QCborMap::key_type▲
The key type for this map. Since https:// keys can be any CBOR type, this is a https://.
QCborMap::mapped_type▲
The type that is mapped to (the value), that is, a https://.
QCborMap::size_type▲
The type that https:// uses for sizes.
QCborMap::value_type▲
The value that is stored in this container: a pair of QCborValues
Member Function Documentation▲
QCborMap::iterator QCborMap::find(qint64 key)▲
QCborMap::const_iterator QCborMap::find(qint64 key) const
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
CBOR recommends using integer keys, since they occupy less space and are simpler to encode and decode.
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(https://), value(const https:// &), value(const https:// &)
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(qint64)
QCborMap::iterator QCborMap::find(QLatin1String key)▲
QCborMap::const_iterator QCborMap::find(QLatin1String key) const
This is an overloaded function.
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(const https:// &), value(const https:// &)
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String)
QCborMap::iterator QCborMap::find(const QString &key)▲
QCborMap::const_iterator QCborMap::find(const QString &key) const
This is an overloaded function.
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(https://), value(const https:// &)
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &)
QCborMap::iterator QCborMap::find(const QCborValue &key)▲
QCborMap::const_iterator QCborMap::find(const QCborValue &key) const
This is an overloaded function.
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(https://), value(const https:// &)
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &)
QCborValue QCborMap::extract(QCborMap::const_iterator it)▲
QCborValue QCborMap::extract(QCborMap::iterator it)
Extracts a value from the map at the position indicated by iterator it and returns the value so extracted.
See Also▲
See also https://(), https://(), https://(), https://()
QCborMap::QCborMap()▲
QCborMap::QCborMap(std::initializer_list<value_type> args)▲
Constructs a https:// with items from a brace-initialization list found in args, as in the following example:
QCborMap map = {
{0, "Hello"},
{1, "World"},
{"foo", nullptr},
{"bar", QCborArray{0, 1, 2, 3, 4}}
};QCborMap::QCborMap(const QCborMap &other)▲
Creates a https:// object that is a copy of other.
QCborMap::~QCborMap()▲
Destroys this https:// object and frees any associated resources it owns.
QCborMap::iterator QCborMap::begin()▲
Returns a map iterator pointing to the first key-value pair of this map. If this map is empty, the returned iterator will be the same as https://().
See Also▲
See also https://(), https://()
QCborMap::const_iterator QCborMap::begin() const▲
Returns a map iterator pointing to the first key-value pair of this map. If this map is empty, the returned iterator will be the same as https://().
See Also▲
See also https://(), https://()
QCborMap::const_iterator QCborMap::cbegin() const▲
Returns a map iterator pointing to the first key-value pair of this map. If this map is empty, the returned iterator will be the same as https://().
See Also▲
See also https://(), https://()
QCborMap::const_iterator QCborMap::cend() const▲
Returns a map iterator representing an element just past the last element in the map.
See Also▲
See also https://(), https://(), https://(), https://()
void QCborMap::clear()▲
int QCborMap::compare(const QCborMap &other) const▲
Compares this map and other, comparing each element in sequence, and returns an integer that indicates whether this map should be sorted prior to (if the result is negative) or after other (if the result is positive). If this function returns 0, the two maps are equal and contain the same elements.
Note that CBOR maps are unordered, which means that two maps containing the very same pairs but in different order will still compare differently. To avoid this, it is recommended to insert elements into the map in a predictable order, such as by ascending key value. In fact, maps with keys in sorted order are required for Canonical CBOR representation.
For more information on CBOR sorting order, see https://().
See Also▲
See also https://(), https://(), https://()
QCborMap::const_iterator QCborMap::constBegin() const▲
Returns a map iterator pointing to the first key-value pair of this map. If this map is empty, the returned iterator will be the same as https://().
See Also▲
See also https://(), https://()
QCborMap::const_iterator QCborMap::constEnd() const▲
Returns a map iterator representing an element just past the last element in the map.
See Also▲
See also https://(), https://(), https://(), https://()
QCborMap::const_iterator QCborMap::constFind(qint64 key) const▲
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
CBOR recommends using integer keys, since they occupy less space and are simpler to encode and decode.
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(https://), value(const https:// &), value(const https:// &)
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(qint64)
QCborMap::const_iterator QCborMap::constFind(QLatin1String key) const▲
This is an overloaded function.
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(const https:// &), value(const https:// &)
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String)
QCborMap::const_iterator QCborMap::constFind(const QString &key) const▲
This is an overloaded function.
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(https://), value(const https:// &)
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &)
QCborMap::const_iterator QCborMap::constFind(const QCborValue &key) const▲
This is an overloaded function.
Returns a map iterator to the key-value pair whose key is key, if the map contains such a pair. If it doesn't, this function returns https://().
If the map contains more than one key equal to key, it is undefined which one this function will find. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(qint64), https://(QLatin1String), https://(const QString &)
bool QCborMap::contains(qint64 key) const▲
Returns true if this map contains a key-value pair identified by key key. CBOR recommends using integer keys, since they occupy less space and are simpler to encode and decode.
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(QLatin1String), https://(const QString &), https://(const QCborValue &)
bool QCborMap::contains(QLatin1String key) const▲
This is an overloaded function.
Returns true if this map contains a key-value pair identified by key key.
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(qint64), https://(const QString &), https://(const QCborValue &)
bool QCborMap::contains(const QString &key) const▲
This is an overloaded function.
Returns true if this map contains a key-value pair identified by key key.
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(qint64), https://(QLatin1String), https://(const QCborValue &)
bool QCborMap::contains(const QCborValue &key) const▲
Returns true if this map contains a key-value pair identified by key key.
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(qint64), https://(QLatin1String), https://(const QString &)
bool QCborMap::empty() const▲
Synonym for https://(). This function is provided for compatibility with generic code that uses the Standard Library API.
Returns true if this map is empty (https://() == 0).
See Also▲
See also https://(), https://()
QCborMap::iterator QCborMap::end()▲
Returns a map iterator representing an element just past the last element in the map.
See Also▲
See also https://(), https://(), https://(), https://()
QCborMap::const_iterator QCborMap::end() const▲
Returns a map iterator representing an element just past the last element in the map.
See Also▲
See also https://(), https://(), https://(), https://()
QCborMap::iterator QCborMap::erase(QCborMap::const_iterator it)▲
Removes the key-value pair pointed to by the map iterator it and returns a pointer to the next element, after removal.
See Also▲
See also https://(), https://(), https://(), https://(), https://()
QCborMap::iterator QCborMap::erase(QCborMap::iterator it)▲
This is an overloaded function.
Removes the key-value pair pointed to by the map iterator it and returns a pointer to the next element, after removal.
See Also▲
See also https://(), https://(), https://(), https://()
[static] QCborMap QCborMap::fromJsonObject(const QJsonObject &obj)▲
Converts all JSON items found in the obj object to CBOR using QCborValue::fromJson(), and returns the map composed of those elements.
This conversion is lossless, as the CBOR type system is a superset of JSON's. Moreover, the map returned by this function can be converted back to the original obj by using https://().
See Also▲
See also https://(), https://(), https://(), https://()
[static] QCborMap QCborMap::fromVariantHash(const QVariantHash &hash)▲
Converts all the items in hash to CBOR using https://() and returns the map composed of those elements.
Conversion from https:// is not completely lossless. Please see the documentation in https://() for more information.
See Also▲
See also https://(), https://(), https://(), https://()
[static] QCborMap QCborMap::fromVariantMap(const QVariantMap &map)▲
Converts all the items in map to CBOR using https://() and returns the map composed of those elements.
Conversion from https:// is not completely lossless. Please see the documentation in https://() for more information.
See Also▲
See also https://(), https://(), https://(), https://()
QCborMap::iterator QCborMap::insert(qint64 key, const QCborValue &value)▲
This is an overloaded function.
Inserts the key key and value value into this map and returns a map iterator pointing to the newly inserted pair.
If the map already had a key equal to key, its value will be overwritten by value.
See Also▲
See also https://(), https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://()
QCborMap::iterator QCborMap::insert(QLatin1String key, const QCborValue &value)▲
This is an overloaded function.
Inserts the key key and value value into this map and returns a map iterator pointing to the newly inserted pair.
If the map already had a key equal to key, its value will be overwritten by value.
See Also▲
See also https://(), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://()
QCborMap::iterator QCborMap::insert(const QString &key, const QCborValue &value)▲
This is an overloaded function.
Inserts the key key and value value into this map and returns a map iterator pointing to the newly inserted pair.
If the map already had a key equal to key, its value will be overwritten by value.
See Also▲
See also https://(), https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://()
QCborMap::iterator QCborMap::insert(const QCborValue &key, const QCborValue &value)▲
This is an overloaded function.
Inserts the key key and value value into this map and returns a map iterator pointing to the newly inserted pair.
If the map already had a key equal to key, its value will be overwritten by value.
See Also▲
See also https://(), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://()
QCborMap::iterator QCborMap::insert(QCborMap::value_type v)▲
This is an overloaded function.
Inserts the key-value pair in v into this map and returns a map iterator pointing to the newly inserted pair.
If the map already had a key equal to v.first, its value will be overwritten by v.second.
See Also▲
See also https://, https://(), https://()
bool QCborMap::isEmpty() const▲
Returns true if this map is empty (that is, https://() is 0).
See Also▲
See also https://(), https://()
QList<QCborValue> QCborMap::keys() const▲
void QCborMap::remove(qint64 key)▲
Removes the key key and the corresponding value from the map, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
remove(https://), remove(const https:// &), remove(const https:// &)
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64)
void QCborMap::remove(QLatin1String key)▲
This is an overloaded function.
Removes the key key and the corresponding value from the map, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
remove(qint64), remove(const https:// &), remove(const https:// &)
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String)
void QCborMap::remove(const QString &key)▲
This is an overloaded function.
Removes the key key and the corresponding value from the map, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
remove(qint64), remove(https://), remove(const https:// &)
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &)
void QCborMap::remove(const QCborValue &key)▲
Removes the key key and the corresponding value from the map, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
remove(qint64), remove(https://), remove(const https:// &)
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &)
qsizetype QCborMap::size() const▲
void QCborMap::swap(QCborMap &other)▲
Swaps the contents of this map and other.
QCborValue QCborMap::take(qint64 key)▲
Removes the key key and the corresponding value from the map and returns the value, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(QLatin1String), https://(const QString &), https://(const QCborValue &), https://()
QCborValue QCborMap::take(QLatin1String key)▲
Removes the key key and the corresponding value from the map and returns the value, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(qint64), https://(const QString &), https://(const QCborValue &), https://()
QCborValue QCborMap::take(const QString &key)▲
Removes the key key and the corresponding value from the map and returns the value, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(QLatin1String), https://(qint64), https://(const QCborValue &), https://()
QCborValue QCborMap::take(const QCborValue &key)▲
Removes the key key and the corresponding value from the map and returns the value, if it is found. If the map contains no such key, this function does nothing.
If the map contains more than one key equal to key, it is undefined which one this function will remove. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(QLatin1String), https://(const QString &), https://(qint64), https://()
QCborValue QCborMap::toCborValue() const▲
Explicitly constructs a https:// object that represents this map. This function is usually not necessary since https:// has a constructor for https://, so the conversion is implicit.
Converting https:// to https:// allows it to be used in any context where QCborValues can be used, including as keys and mapped types in https://, as well as https://().
See Also▲
See also https://(const QCborMap &)
QJsonObject QCborMap::toJsonObject() const▲
Recursively converts every https:// value in this map to JSON using https://() and creates a string key for all keys that aren't strings, then returns the corresponding https:// composed of those associations.
Please note that CBOR contains a richer and wider type set than JSON, so some information may be lost in this conversion. For more details on what conversions are applied, see https://().
Map key conversion to string▲
JSON objects are defined as having string keys, unlike CBOR, so the conversion of a https:// to https:// will imply a step of "stringification" of the key values. The conversion will use the special handling of tags and extended types from above and will also convert the rest of the types as follows:
|
Type |
Transformation |
|---|---|
|
Bool |
"true" and "false" |
|
Null |
"null" |
|
Undefined |
"undefined" |
|
Integer |
The decimal string form of the number |
|
Double |
The decimal string form of the number |
|
Byte array |
Unless tagged differently (see above), encoded as Base64url |
|
Array |
Replaced by the compact form of its https:// |
|
Map |
Replaced by the compact form of its https:// |
|
Tags and extended types |
Tag number is dropped and the tagged value is converted to string |
Notes▲
See Also▲
See also https://(), https://(), https://(), https://()
QVariantHash QCborMap::toVariantHash() const▲
Converts the CBOR values to https:// using https://() and "stringifies" all the CBOR keys in this map, returning the https:// that results from that association list.
QVariantMaps have string keys, unlike CBOR, so the conversion of a https:// to https:// will imply a step of "stringification" of the key values. See https://() for details.
In addition, the conversion to https:// is not completely lossless. Please see the documentation in https://() for more information.
See Also▲
See also https://(), https://(), https://(), https://(), https://()
QVariantMap QCborMap::toVariantMap() const▲
Converts the CBOR values to https:// using https://() and "stringifies" all the CBOR keys in this map, returning the https:// that results from that association list.
QVariantMaps have string keys, unlike CBOR, so the conversion of a https:// to https:// will imply a step of "stringification" of the key values. See https://() for details.
In addition, the conversion to https:// is not completely lossless. Please see the documentation in https://() for more information.
See Also▲
See also https://(), https://(), https://(), https://(), https://()
QCborValue QCborMap::value(qint64 key) const▲
Returns the https:// element in this map that corresponds to key key, if there is one. CBOR recommends using integer keys, since they occupy less space and are simpler to encode and decode.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one the return from function will reference. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(https://), value(const https:// &), value(const https:// &)
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(qint64)
QCborValue QCborMap::value(QLatin1String key) const▲
This is an overloaded function.
Returns the https:// element in this map that corresponds to key key, if there is one.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one this function will return. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(const https:// &), value(const https:// &)
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String)
QCborValue QCborMap::value(const QString &key) const▲
This is an overloaded function.
Returns the https:// element in this map that corresponds to key key, if there is one.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one this function will return. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(https://), value(const https:// &)
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &)
QCborValue QCborMap::value(const QCborValue &key) const▲
Returns the https:// element in this map that corresponds to key key, if there is one.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one this function will return. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
value(qint64), value(https://), value(const https:// &)
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &)
bool QCborMap::operator!=(const QCborMap &other) const▲
Compares this map and other, comparing each element in sequence, and returns true if the two maps contains any different elements or elements in different orders, false otherwise.
Note that CBOR maps are unordered, which means that two maps containing the very same pairs but in different order will still compare differently. To avoid this, it is recommended to insert elements into the map in a predictable order, such as by ascending key value. In fact, maps with keys in sorted order are required for Canonical CBOR representation.
For more information on CBOR equality in Qt, see, https://().
See Also▲
See also https://(), https://(), https://(), https://(), https://()
bool QCborMap::operator<(const QCborMap &other) const▲
Compares this map and other, comparing each element in sequence, and returns true if this map should be sorted before other, false otherwise.
Note that CBOR maps are unordered, which means that two maps containing the very same pairs but in different order will still compare differently. To avoid this, it is recommended to insert elements into the map in a predictable order, such as by ascending key value. In fact, maps with keys in sorted order are required for Canonical CBOR representation.
For more information on CBOR sorting order, see https://().
See Also▲
See also https://(), https://(), https://(), https://(), https://()
QCborMap &QCborMap::operator=(const QCborMap &other)▲
Replaces the contents of this object with a copy of other, then returns a reference to this object.
bool QCborMap::operator==(const QCborMap &other) const▲
Compares this map and other, comparing each element in sequence, and returns true if the two maps contains the same elements in the same order, false otherwise.
Note that CBOR maps are unordered, which means that two maps containing the very same pairs but in different order will still compare differently. To avoid this, it is recommended to insert elements into the map in a predictable order, such as by ascending key value. In fact, maps with keys in sorted order are required for Canonical CBOR representation.
For more information on CBOR equality in Qt, see, https://().
See Also▲
See also https://(), https://(), QCborMap::operator==(), https://(), https://()
const QCborValue QCborMap::operator[](qint64 key) const▲
Returns the https:// element in this map that corresponds to key key, if there is one. CBOR recommends using integer keys, since they occupy less space and are simpler to encode and decode.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one this function will return. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
operator[](https://), operator[](const https:// &), operator[](const QCborOperator[] &)
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(qint64)
const QCborValue QCborMap::operator[](QLatin1String key) const▲
This is an overloaded function.
Returns the https:// element in this map that corresponds to key key, if there is one.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one this function will return. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
operator[](qint64), operator[](const https:// &), operator[](const QCborOperator[] &)
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String)
const QCborValue QCborMap::operator[](const QString &key) const▲
This is an overloaded function.
Returns the https:// element in this map that corresponds to key key, if there is one.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one this function will return. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
operator[](qint64), operator[](https://), operator[](const QCborOperator[] &)
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &)
const QCborValue QCborMap::operator[](const QCborValue &key) const▲
Returns the https:// element in this map that corresponds to key key, if there is one.
If the map does not contain key key, this function returns a https:// containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one this function will return. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
operator[](qint64), operator[](https://), operator[](const QCborOperator[] &)
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &)
QCborValueRef QCborMap::operator[](qint64 key)▲
Returns a QCborValueRef to the value in this map that corresponds to key key. CBOR recommends using integer keys, since they occupy less space and are simpler to encode and decode.
QCborValueRef has the exact same API as https://, with one important difference: if you assign new values to it, this map will be updated with that new value.
If the map did not have a key equal to key, one is inserted and this function returns a reference to the new value, which will be a https:// with an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one the return will reference. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(qint64), https://(qint64), https://(qint64), https://(qint64), https://(QLatin1String), https://(const QString &), https://(const QCborValue &)
QCborValueRef QCborMap::operator[](QLatin1String key)▲
This is an overloaded function.
Returns a QCborValueRef to the value in this map that corresponds to key key.
QCborValueRef has the exact same API as https://, with one important difference: if you assign new values to it, this map will be updated with that new value.
If the map did not have a key equal to key, one is inserted and this function returns a reference to the new value, which will be a https:// with an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one the return will reference. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(QLatin1String), https://(qint64), https://(const QString &), https://(const QCborValue &)
QCborValueRef QCborMap::operator[](const QString &key)▲
This is an overloaded function.
Returns a QCborValueRef to the value in this map that corresponds to key key.
QCborValueRef has the exact same API as https://, with one important difference: if you assign new values to it, this map will be updated with that new value.
If the map did not have a key equal to key, one is inserted and this function returns a reference to the new value, which will be a https:// with an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one the return will reference. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(const QString &), https://(const QString &), https://(const QString &), https://(const QString &), https://(qint64), https://(QLatin1String), https://(const QCborValue &)
QCborValueRef QCborMap::operator[](const QCborValue &key)▲
This is an overloaded function.
Returns a QCborValueRef to the value in this map that corresponds to key key.
QCborValueRef has the exact same API as https://, with one important difference: if you assign new values to it, this map will be updated with that new value.
If the map did not have a key equal to key, one is inserted and this function returns a reference to the new value, which will be a https:// with an undefined value. For that reason, it is not possible with this function to tell apart the situation where the key was not present from the situation where the key was mapped to an undefined value.
If the map contains more than one key equal to key, it is undefined which one the return will reference. https:// does not allow inserting duplicate keys, but it is possible to create such a map by decoding a CBOR stream with them. They are usually not permitted and having duplicate keys is usually an indication of a problem in the sender.
See Also▲
See also https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(const QCborValue &), https://(qint64), https://(QLatin1String), https://(const QString &)


