15#include <private/qcborvalue_p.h>
262template<
typename String>
264 String
key,
bool *keyExists)
269 const auto it = std::lower_bound(
271 [&](
const QJsonPrivate::ConstKeyIterator::value_type &e,
const String &
key) {
275 *keyExists = (
it !=
end) &&
o->stringEqualsElement((*it).key(),
key);
297 return valueImpl(
key);
306 return valueImpl(
key);
398 bool keyExists =
false;
455 bool keyExists =
false;
477 return {
this,
pos / 2};
512void QJsonObject::removeImpl(T
key)
545 return takeImpl(
key);
554 return takeImpl(
key);
593 return containsImpl(
key);
602 return containsImpl(
key);
609bool QJsonObject::containsImpl(T
key)
const
630 return !rhs.o->elements.size();
632 return !lhs.o->elements.size();
633 if (lhs.o->elements.size() != rhs.o->elements.size())
637 if (lhs.o->valueAt(
i) != rhs.o->valueAt(
i))
659 removeAt(
it.item.index * 2);
685 return findImpl(
key);
694 return findImpl(
key);
703 bool keyExists =
false;
708 return {
this,
index / 2};
746 return constFindImpl(
key);
755 return constFindImpl(
key);
764 bool keyExists =
false;
768 return {
this,
index / 2};
1371#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
1398 if (
val.isUndefined()) {
1428#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
1433 dbg <<
"QJsonObject()";
1438 dbg.nospace() <<
"QJsonObject("
1445#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
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
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.
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.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QJsonObject &object, size_t seed)
bool comparesEqual(const QJsonObject &lhs, const QJsonObject &rhs) noexcept
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]