Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QCborContainerPrivate Class Reference

#include <qcborvalue_p.h>

+ Inheritance diagram for QCborContainerPrivate:
+ Collaboration diagram for QCborContainerPrivate:

Public Types

enum  ContainerDisposition { CopyContainer , MoveContainer }
 

Public Member Functions

void deref ()
 
void compact (qsizetype reserved)
 
qptrdiff addByteData (const char *block, qsizetype len)
 
const QtCbor::ByteDatabyteData (QtCbor::Element e) const
 
const QtCbor::ByteDatabyteData (qsizetype idx) const
 
QCborContainerPrivatecontainerAt (qsizetype idx, QCborValue::Type type) const
 
void replaceAt_complex (QtCbor::Element &e, const QCborValue &value, ContainerDisposition disp)
 
void replaceAt_internal (QtCbor::Element &e, const QCborValue &value, ContainerDisposition disp)
 
void replaceAt (qsizetype idx, const QCborValue &value, ContainerDisposition disp=CopyContainer)
 
void insertAt (qsizetype idx, const QCborValue &value, ContainerDisposition disp=CopyContainer)
 
void append (QtCbor::Undefined)
 
void append (qint64 value)
 
void append (QCborTag tag)
 
void appendByteData (const char *data, qsizetype len, QCborValue::Type type, QtCbor::Element::ValueFlags extraFlags={})
 
void appendAsciiString (const QString &s)
 
void appendAsciiString (const char *str, qsizetype len)
 
void appendUtf8String (const char *str, qsizetype len)
 
void append (QLatin1StringView s)
 
void appendAsciiString (QStringView s)
 
void append (const QString &s)
 
void append (QStringView s)
 
void append (const QCborValue &v)
 
QByteArray byteArrayAt (qsizetype idx) const
 
QString stringAt (qsizetype idx) const
 
QCborValue valueAt (qsizetype idx) const
 
QCborValue extractAt_complex (QtCbor::Element e)
 
QCborValue extractAt (qsizetype idx)
 
template<typename String >
int stringCompareElement (const QtCbor::Element &e, String s) const
 
template<typename String >
bool stringEqualsElement (const QtCbor::Element &e, String s) const
 
template<typename String >
bool stringEqualsElement (qsizetype idx, String s) const
 
int compareElement (qsizetype idx, const QCborValue &value) const
 
void removeAt (qsizetype idx)
 
template<typename KeyType >
QCborValueConstRef findCborMapKey (KeyType key)
 
- Public Member Functions inherited from QSharedData
 QSharedData () noexcept
 Constructs a QSharedData object with a reference count of 0.
 
 QSharedData (const QSharedData &) noexcept
 Constructs a QSharedData object with reference count 0.
 
QSharedDataoperator= (const QSharedData &)=delete
 
 ~QSharedData ()=default
 

Static Public Member Functions

static QCborContainerPrivateclone (QCborContainerPrivate *d, qsizetype reserved=-1)
 
static QCborContainerPrivatedetach (QCborContainerPrivate *d, qsizetype reserved)
 
static QCborContainerPrivategrow (QCborContainerPrivate *d, qsizetype index)
 Prepare for an insertion at position index.
 
static void resetValue (QCborValue &v)
 
static QCborValue makeValue (QCborValue::Type type, qint64 n, QCborContainerPrivate *d=nullptr, ContainerDisposition disp=CopyContainer)
 
static QtCbor::Element elementFromValue (const QCborValue &value)
 
static int compareUtf8 (const QtCbor::ByteData *b, QLatin1StringView s)
 
static int compareUtf8 (const QtCbor::ByteData *b, QStringView s)
 
static int compareElement_helper (const QCborContainerPrivate *c1, QtCbor::Element e1, const QCborContainerPrivate *c2, QtCbor::Element e2)
 
template<typename KeyType >
static QCborValue findCborMapKey (const QCborValue &self, KeyType key)
 
template<typename KeyType >
static QCborValueRef findOrAddMapKey (QCborContainerPrivate *container, KeyType key)
 
template<typename KeyType >
static QCborValueRef findOrAddMapKey (QCborMap &map, KeyType key)
 
template<typename KeyType >
static QCborValueRef findOrAddMapKey (QCborValue &self, KeyType key)
 
template<typename KeyType >
static QCborValueRef findOrAddMapKey (QCborValueRef self, KeyType key)
 

Public Attributes

QByteArray::size_type usedData = 0
 
QByteArray data
 
QList< QtCbor::Elementelements
 
- Public Attributes inherited from QSharedData
QAtomicInt ref
 

Friends

class QExplicitlySharedDataPointer< QCborContainerPrivate >
 

Detailed Description

Definition at line 93 of file qcborvalue_p.h.

Member Enumeration Documentation

◆ ContainerDisposition

Enumerator
CopyContainer 
MoveContainer 

Definition at line 99 of file qcborvalue_p.h.

Member Function Documentation

◆ addByteData()

qptrdiff QCborContainerPrivate::addByteData ( const char *  block,
qsizetype  len 
)
inline

Definition at line 111 of file qcborvalue_p.h.

References increment(), QtCbor::ByteData::len, ptr(), and usedData.

Referenced by appendAsciiString(), and replaceAt_complex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ append() [1/7]

void QCborContainerPrivate::append ( const QCborValue v)
inline

Definition at line 241 of file qcborvalue_p.h.

References elements, insertAt(), and QList< T >::size().

+ Here is the call graph for this function:

◆ append() [2/7]

void QCborContainerPrivate::append ( const QString s)
inline

Definition at line 228 of file qcborvalue_p.h.

References append(), and qToStringViewIgnoringNull().

+ Here is the call graph for this function:

◆ append() [3/7]

void QCborContainerPrivate::append ( QCborTag  tag)
inline

Definition at line 198 of file qcborvalue_p.h.

References QList< T >::append(), elements, QCborValue::Tag, and tag.

+ Here is the call graph for this function:

◆ append() [4/7]

void QCborContainerPrivate::append ( qint64  value)
inline

Definition at line 194 of file qcborvalue_p.h.

References QList< T >::append(), elements, and QCborValue::Integer.

+ Here is the call graph for this function:

◆ append() [5/7]

void QCborContainerPrivate::append ( QLatin1StringView  s)
inline

Definition at line 217 of file qcborvalue_p.h.

References append(), appendByteData(), QtPrivate::isAscii(), QCborValue::String, and QtCbor::Element::StringIsAscii.

+ Here is the call graph for this function:

◆ append() [6/7]

void QCborContainerPrivate::append ( QStringView  s)
inline

Definition at line 233 of file qcborvalue_p.h.

References appendAsciiString(), appendByteData(), QtPrivate::isAscii(), QCborValue::String, and QtCbor::Element::StringIsUtf16.

+ Here is the call graph for this function:

◆ append() [7/7]

void QCborContainerPrivate::append ( QtCbor::Undefined  )
inline

Definition at line 190 of file qcborvalue_p.h.

References QList< T >::append(), and elements.

Referenced by QCborValue::QCborValue(), QCborValue::QCborValue(), QCborValue::QCborValue(), StashedContainer::~StashedContainer(), append(), append(), and findOrAddMapKey().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appendAsciiString() [1/3]

void QCborContainerPrivate::appendAsciiString ( const char *  str,
qsizetype  len 
)
inline

Definition at line 209 of file qcborvalue_p.h.

References appendByteData(), str, QCborValue::String, and QtCbor::Element::StringIsAscii.

+ Here is the call graph for this function:

◆ appendAsciiString() [2/3]

void QCborContainerPrivate::appendAsciiString ( const QString s)

Referenced by append().

+ Here is the caller graph for this function:

◆ appendAsciiString() [3/3]

Q_NEVER_INLINE void QCborContainerPrivate::appendAsciiString ( QStringView  s)

Definition at line 1030 of file qcborvalue.cpp.

References addByteData(), QList< T >::append(), e, elements, QtCbor::Element::HasByteData, ptr(), qt_to_latin1_unchecked(), QCborValue::String, and QtCbor::Element::StringIsAscii.

+ Here is the call graph for this function:

◆ appendByteData()

void QCborContainerPrivate::appendByteData ( const char *  data,
qsizetype  len,
QCborValue::Type  type,
QtCbor::Element::ValueFlags  extraFlags = {} 
)
inline

Definition at line 202 of file qcborvalue_p.h.

Referenced by QCborValue::QCborValue(), append(), append(), appendAsciiString(), appendUtf8String(), and extractAt_complex().

+ Here is the caller graph for this function:

◆ appendUtf8String()

void QCborContainerPrivate::appendUtf8String ( const char *  str,
qsizetype  len 
)
inline

Definition at line 213 of file qcborvalue_p.h.

References appendByteData(), str, and QCborValue::String.

+ Here is the call graph for this function:

◆ byteArrayAt()

QByteArray QCborContainerPrivate::byteArrayAt ( qsizetype  idx) const
inline

Definition at line 246 of file qcborvalue_p.h.

References QList< T >::at(), byteData(), e, and elements.

Referenced by QCborValue::toByteArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ byteData() [1/2]

const QtCbor::ByteData * QCborContainerPrivate::byteData ( qsizetype  idx) const
inline

Definition at line 150 of file qcborvalue_p.h.

References QList< T >::at(), byteData(), and elements.

+ Here is the call graph for this function:

◆ byteData() [2/2]

const QtCbor::ByteData * QCborContainerPrivate::byteData ( QtCbor::Element  e) const
inline

Definition at line 137 of file qcborvalue_p.h.

References e, QtCbor::Element::HasByteData, and Q_ASSERT.

Referenced by byteArrayAt(), byteData(), compareElementRecursive(), extractAt_complex(), replaceAt(), sortContainer(), stringAt(), stringCompareElement(), QCborValue::toDateTime(), QAnyStringViewUtils::toStringView(), QCborValue::toUrl(), and QCborValue::toUuid().

+ Here is the caller graph for this function:

◆ clone()

QCborContainerPrivate * QCborContainerPrivate::clone ( QCborContainerPrivate d,
qsizetype  reserved = -1 
)
static

Definition at line 935 of file qcborvalue.cpp.

References d, e, QtCbor::Element::IsContainer, and QExplicitlySharedDataPointer< T >::take().

Referenced by detach(), and replaceAt_complex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compact()

void QCborContainerPrivate::compact ( qsizetype  reserved)

Definition at line 925 of file qcborvalue.cpp.

References Q_UNUSED, and usedData.

Referenced by extractAt_complex().

+ Here is the caller graph for this function:

◆ compareElement()

int QCborContainerPrivate::compareElement ( qsizetype  idx,
const QCborValue value 
) const
inline

Definition at line 371 of file qcborvalue_p.h.

References QList< T >::at(), compareElement_helper(), elementFromValue(), and elements.

Referenced by QCborArray::contains(), and findCborMapKey().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compareElement_helper()

int QCborContainerPrivate::compareElement_helper ( const QCborContainerPrivate c1,
QtCbor::Element  e1,
const QCborContainerPrivate c2,
QtCbor::Element  e2 
)
inlinestatic

Definition at line 1213 of file qcborvalue.cpp.

References c2, and compareElementRecursive().

Referenced by compareContainer(), and compareElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compareUtf8() [1/2]

static int QCborContainerPrivate::compareUtf8 ( const QtCbor::ByteData b,
QLatin1StringView  s 
)
inlinestatic

Definition at line 332 of file qcborvalue_p.h.

References QUtf8::compareUtf8().

Referenced by sortContainer(), and stringCompareElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compareUtf8() [2/2]

static int QCborContainerPrivate::compareUtf8 ( const QtCbor::ByteData b,
QStringView  s 
)
inlinestatic

Definition at line 337 of file qcborvalue_p.h.

References QUtf8::compareUtf8().

+ Here is the call graph for this function:

◆ containerAt()

QCborContainerPrivate * QCborContainerPrivate::containerAt ( qsizetype  idx,
QCborValue::Type  type 
) const
inline

Definition at line 155 of file qcborvalue_p.h.

References QList< T >::at(), e, elements, and QtCbor::Element::IsContainer.

+ Here is the call graph for this function:

◆ deref()

void QCborContainerPrivate::deref ( )
inline

Definition at line 105 of file qcborvalue_p.h.

Referenced by sortContainer().

+ Here is the caller graph for this function:

◆ detach()

QCborContainerPrivate * QCborContainerPrivate::detach ( QCborContainerPrivate d,
qsizetype  reserved 
)
static

Definition at line 958 of file qcborvalue.cpp.

References clone(), and d.

Referenced by convertArrayToMap(), findOrAddMapKey(), and grow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elementFromValue()

static QtCbor::Element QCborContainerPrivate::elementFromValue ( const QCborValue value)
inlinestatic

Definition at line 317 of file qcborvalue_p.h.

References QList< T >::at(), QtCbor::Element::container, e, elements, and QtCbor::Element::IsContainer.

Referenced by QCborValue::compare(), and compareElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractAt()

QCborValue QCborContainerPrivate::extractAt ( qsizetype  idx)
inline

Definition at line 299 of file qcborvalue_p.h.

References e, elements, extractAt_complex(), QtCbor::Element::HasByteData, QCborValue::Invalid, QtCbor::Element::IsContainer, makeValue(), MoveContainer, qSwap(), and QCborValue::Tag.

Referenced by QCborArray::extract(), and QCborMap::extract().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractAt_complex()

QCborValue QCborContainerPrivate::extractAt_complex ( QtCbor::Element  e)

Definition at line 1044 of file qcborvalue.cpp.

References appendByteData(), byteData(), compact(), data, e, elements, QtCbor::Element::HasByteData, makeValue(), Q_ASSERT, QByteArray::reserve(), QList< T >::size(), and usedData.

Referenced by extractAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findCborMapKey() [1/2]

template<typename KeyType >
static QCborValue QCborContainerPrivate::findCborMapKey ( const QCborValue self,
KeyType  key 
)
inlinestatic

Definition at line 404 of file qcborvalue_p.h.

References elements, and QList< T >::size().

+ Here is the call graph for this function:

◆ findCborMapKey() [2/2]

template<typename KeyType >
QCborValueConstRef QCborContainerPrivate::findCborMapKey ( KeyType  key)
inline

Definition at line 385 of file qcborvalue_p.h.

References QList< T >::at(), compareElement(), e, elements, i, QCborValue::Integer, QList< T >::size(), and stringEqualsElement().

Referenced by QCborMap::constFind(), QCborMap::constFind(), QCborMap::constFind(), QCborMap::constFind(), findOrAddMapKey(), QCborValue::operator[](), QCborValue::operator[](), and QCborValue::operator[]().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findOrAddMapKey() [1/4]

template<typename KeyType >
static QCborValueRef QCborContainerPrivate::findOrAddMapKey ( QCborContainerPrivate container,
KeyType  key 
)
inlinestatic

Definition at line 414 of file qcborvalue_p.h.

References append(), detach(), elements, findCborMapKey(), i, Q_ASSERT, qMax(), and QList< T >::size().

Referenced by QCborMap::operator[](), QCborValue::operator[](), QCborMap::operator[](), QCborValue::operator[](), QCborMap::operator[](), and QCborValue::operator[]().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findOrAddMapKey() [2/4]

template<typename KeyType >
QCborValueRef QCborContainerPrivate::findOrAddMapKey ( QCborMap map,
KeyType  key 
)
inlinestatic

Definition at line 765 of file qcbormap.cpp.

References map.

◆ findOrAddMapKey() [3/4]

template<typename KeyType >
QCborValueRef QCborContainerPrivate::findOrAddMapKey ( QCborValue self,
KeyType  key 
)
inlinestatic

Definition at line 2276 of file qcborvalue.cpp.

References assignContainer(), convertArrayToMap(), and QCborValue::Map.

+ Here is the call graph for this function:

◆ findOrAddMapKey() [4/4]

template<typename KeyType >
QCborValueRef QCborContainerPrivate::findOrAddMapKey ( QCborValueRef  self,
KeyType  key 
)
static

Definition at line 2292 of file qcborvalue.cpp.

References QCborValue::Array, assignContainer(), convertArrayToMap(), e, QtCbor::Element::IsContainer, and QCborValue::Map.

+ Here is the call graph for this function:

◆ grow()

QCborContainerPrivate * QCborContainerPrivate::grow ( QCborContainerPrivate d,
qsizetype  index 
)
static

Prepare for an insertion at position index.

Detaches and ensures there are at least index entries in the array, padding with Undefined as needed.

Definition at line 971 of file qcborvalue.cpp.

References d, detach(), j, and Q_ASSERT.

Referenced by QCborArray::insert(), QCborArray::insert(), and maybeGrow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertAt()

void QCborContainerPrivate::insertAt ( qsizetype  idx,
const QCborValue value,
ContainerDisposition  disp = CopyContainer 
)
inline

Definition at line 185 of file qcborvalue_p.h.

References QList< T >::begin(), elements, QList< T >::insert(), and replaceAt_internal().

Referenced by append(), QCborArray::insert(), and QCborArray::insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeValue()

static QCborValue QCborContainerPrivate::makeValue ( QCborValue::Type  type,
qint64  n,
QCborContainerPrivate d = nullptr,
ContainerDisposition  disp = CopyContainer 
)
inlinestatic

Definition at line 272 of file qcborvalue_p.h.

References CopyContainer, and d.

Referenced by StashedContainer::~StashedContainer(), extractAt(), extractAt_complex(), QJsonPrivate::Parser::parse(), and valueAt().

+ Here is the caller graph for this function:

◆ removeAt()

void QCborContainerPrivate::removeAt ( qsizetype  idx)
inline

Definition at line 378 of file qcborvalue_p.h.

References elements, QList< T >::remove(), and replaceAt().

Referenced by QCborMap::erase(), QCborArray::extract(), QCborMap::extract(), and QCborArray::removeAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceAt()

void QCborContainerPrivate::replaceAt ( qsizetype  idx,
const QCborValue value,
ContainerDisposition  disp = CopyContainer 
)
inline

Definition at line 173 of file qcborvalue_p.h.

References byteData(), e, elements, QtCbor::Element::IsContainer, replaceAt_internal(), and usedData.

Referenced by removeAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceAt_complex()

void QCborContainerPrivate::replaceAt_complex ( QtCbor::Element e,
const QCborValue value,
ContainerDisposition  disp 
)

Definition at line 987 of file qcborvalue.cpp.

References addByteData(), clone(), CopyContainer, d, e, QtCbor::Element::IsContainer, MoveContainer, Q_ASSERT, and Q_UNLIKELY.

Referenced by replaceAt_internal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceAt_internal()

void QCborContainerPrivate::replaceAt_internal ( QtCbor::Element e,
const QCborValue value,
ContainerDisposition  disp 
)
inline

Definition at line 164 of file qcborvalue_p.h.

References e, and replaceAt_complex().

Referenced by insertAt(), and replaceAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetValue()

static void QCborContainerPrivate::resetValue ( QCborValue v)
inlinestatic

Definition at line 267 of file qcborvalue_p.h.

Referenced by QCborArray::insert().

+ Here is the caller graph for this function:

◆ stringAt()

QString QCborContainerPrivate::stringAt ( qsizetype  idx) const
inline

Definition at line 254 of file qcborvalue_p.h.

References QList< T >::at(), byteData(), e, elements, QtCbor::Element::StringIsAscii, and QtCbor::Element::StringIsUtf16.

Referenced by QJsonValueConstRef::concreteString(), QJsonObject::keys(), QJsonValueConstRef::objectKey(), and QCborValue::toString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stringCompareElement()

template<typename String >
int QCborContainerPrivate::stringCompareElement ( const QtCbor::Element e,
String  s 
) const
inline

Definition at line 343 of file qcborvalue_p.h.

References byteData(), QtPrivate::compareStrings(), compareUtf8(), e, QCborValue::String, and QtCbor::Element::StringIsUtf16.

Referenced by stringEqualsElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stringEqualsElement() [1/2]

template<typename String >
bool QCborContainerPrivate::stringEqualsElement ( const QtCbor::Element e,
String  s 
) const
inline

Definition at line 358 of file qcborvalue_p.h.

References e, and stringCompareElement().

Referenced by findCborMapKey(), and stringEqualsElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stringEqualsElement() [2/2]

template<typename String >
bool QCborContainerPrivate::stringEqualsElement ( qsizetype  idx,
String  s 
) const
inline

Definition at line 364 of file qcborvalue_p.h.

References QList< T >::at(), elements, and stringEqualsElement().

+ Here is the call graph for this function:

◆ valueAt()

QCborValue QCborContainerPrivate::valueAt ( qsizetype  idx) const
inline

Definition at line 283 of file qcborvalue_p.h.

References QList< T >::at(), e, elements, QtCbor::Element::HasByteData, QCborValue::Invalid, QtCbor::Element::IsContainer, makeValue(), and QCborValue::Tag.

Referenced by QCborArray::at(), QCborMap::keys(), QJsonObject::operator==(), QCborValueConstRef::operator[](), QCborValue::operator[](), QCborValueConstRef::operator[](), QCborValueConstRef::operator[](), and QCborValue::taggedValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QExplicitlySharedDataPointer< QCborContainerPrivate >

Definition at line 85 of file qcborvalue_p.h.

Member Data Documentation

◆ data

QByteArray QCborContainerPrivate::data

Definition at line 102 of file qcborvalue_p.h.

Referenced by extractAt_complex().

◆ elements

◆ usedData

QByteArray::size_type QCborContainerPrivate::usedData = 0

Definition at line 101 of file qcborvalue_p.h.

Referenced by addByteData(), compact(), extractAt_complex(), and replaceAt().


The documentation for this class was generated from the following files: