15#include <private/qcborvalue_p.h>
257template<
typename String>
259 String
key,
bool *keyExists)
264 const auto it = std::lower_bound(
267 return o->stringCompareElement(
e.key(),
key) < 0;
270 *keyExists = (
it !=
end) &&
o->stringEqualsElement((*it).key(),
key);
292 return valueImpl(
key);
301 return valueImpl(
key);
393 bool keyExists =
false;
450 bool keyExists =
false;
472 return {
this,
pos / 2};
507void QJsonObject::removeImpl(T
key)
540 return takeImpl(
key);
549 return takeImpl(
key);
588 return containsImpl(
key);
597 return containsImpl(
key);
604bool QJsonObject::containsImpl(T
key)
const
623 return !
other.o->elements.size();
642 return !(*
this ==
other);
654 removeAt(
it.item.index * 2);
680 return findImpl(
key);
689 return findImpl(
key);
698 bool keyExists =
false;
703 return {
this,
index / 2};
741 return constFindImpl(
key);
750 return constFindImpl(
key);
759 bool keyExists =
false;
763 return {
this,
index / 2};
1360#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
1387 if (
val.isUndefined()) {
1417#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
1422 dbg <<
"QJsonObject()";
1427 dbg.nospace() <<
"QJsonObject("
1434#ifndef QT_NO_DATASTREAM
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
QString stringAt(qsizetype idx) const
void insertAt(qsizetype idx, const QCborValue &value, ContainerDisposition disp=CopyContainer)
static QCborContainerPrivate * detach(QCborContainerPrivate *d, qsizetype reserved)
void removeAt(qsizetype idx)
void replaceAt(qsizetype idx, const QCborValue &value, ContainerDisposition disp=CopyContainer)
QList< QtCbor::Element > elements
QCborValue extractAt(qsizetype idx)
QCborValue valueAt(qsizetype idx) const
QVariantMap toVariantMap() const
Converts the CBOR values to QVariant using QCborValue::toVariant() and "stringifies" all the CBOR key...
QVariantHash toVariantHash() const
Converts the CBOR values to QVariant using QCborValue::toVariant() and "stringifies" all the CBOR key...
static QCborMap fromJsonObject(const QJsonObject &o)
Converts all JSON items found in the obj object to CBOR using QCborValue::fromJson(),...
static QCborValue fromJsonValue(const QJsonValue &v)
Converts the JSON value contained in v into its corresponding CBOR value and returns it.
\inmodule QtCore\reentrant
T * data() const noexcept
Returns a pointer to the shared data object.
friend class const_iterator
\inmodule QtCore\reentrant
QByteArray toJson(JsonFormat format=Indented) const
QJsonObject object() const
Returns the QJsonObject contained in the document.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
QVariantMap toVariantMap() const
Converts this object to a QVariantMap.
QJsonValue operator[](const QString &key) const
Returns a QJsonValue representing the value for the key key.
QJsonValue take(const QString &key)
Removes key from the object.
~QJsonObject()
Destroys the object.
iterator erase(iterator it)
Removes the (key, value) pair pointed to by the iterator it from the map, and returns an iterator to ...
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
iterator find(const QString &key)
Returns an iterator pointing to the item with key key in the map.
qsizetype size() const
Returns the number of (key, value) pairs stored in the object.
void remove(const QString &key)
Removes key from the object.
QStringList keys() const
Returns a list of all keys in this object.
friend class QJsonValueRef
bool operator==(const QJsonObject &other) const
Returns true if other is equal to this object.
const_iterator constFind(const QString &key) const
Returns a const iterator pointing to the item with key key in the map.
iterator insert(const QString &key, const QJsonValue &value)
Inserts a new item with the key key and a value of value.
static QJsonObject fromVariantMap(const QVariantMap &map)
Converts the variant map map to a QJsonObject.
QJsonObject()
Constructs an empty JSON object.
QJsonValue value(const QString &key) const
Returns a QJsonValue representing the value for the key key.
QJsonObject & operator=(const QJsonObject &other) noexcept
Assigns other to this object.
bool contains(const QString &key) const
Returns true if the object contains key key.
QVariantHash toVariantHash() const
Converts this object to a QVariantHash.
bool isEmpty() const
Returns true if the object is empty.
bool operator!=(const QJsonObject &other) const
Returns true if other is not equal to this object.
static QJsonObject fromVariantHash(const QVariantHash &map)
Converts the variant hash hash to a QJsonObject.
static QJsonValue fromTrustedCbor(const QCborValue &v)
static QJsonObject toJsonObject(const QVariantMap &map)
static void objectToJson(const QCborContainerPrivate *o, QByteArray &json, int indent, bool compact=false)
\inmodule QtCore \reentrant
\inmodule QtCore\reentrant
static QJsonValue fromVariant(const QVariant &variant)
Converts variant to a QJsonValue and returns it.
qsizetype size() const noexcept
bool isEmpty() const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
QHash< int, QWidget * > hash
[35multi]
QMap< QString, QString > map
[6]
QSet< QString >::iterator it
ObjectIterator< const QtCbor::Element, QList< QtCbor::Element >::const_iterator > ConstKeyIterator
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QJsonObject &object, size_t seed)
QDataStream & operator>>(QDataStream &stream, QJsonObject &object)
QDebug operator<<(QDebug dbg, const QJsonObject &o)
static qsizetype indexOf(const QExplicitlySharedDataPointer< QCborContainerPrivate > &o, String key, bool *keyExists)
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static const QTextHtmlElement elements[Html_NumElements]