Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 ()
 
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 appendNonAsciiString (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, QtCbor::Comparison mode) 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, QtCbor::Comparison mode) 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 qptrdiff addByteDataImpl (QByteArray &target, QByteArray::size_type &targetUsed, const char *block, qsizetype len)
 
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, QtCbor::Comparison mode) noexcept
 
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 98 of file qcborvalue_p.h.

Member Enumeration Documentation

◆ ContainerDisposition

Enumerator
CopyContainer 
MoveContainer 

Definition at line 104 of file qcborvalue_p.h.

Member Function Documentation

◆ addByteData()

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

Definition at line 143 of file qcborvalue_p.h.

References addByteDataImpl(), and usedData.

Referenced by appendAsciiString(), and replaceAt_complex().

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

◆ addByteDataImpl()

static qptrdiff QCborContainerPrivate::addByteDataImpl ( QByteArray & target,
QByteArray::size_type & targetUsed,
const char * block,
qsizetype len )
inlinestatic

Definition at line 116 of file qcborvalue_p.h.

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

Referenced by addByteData(), and compact().

+ 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 252 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 240 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 209 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 205 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 228 of file qcborvalue_p.h.

References appendByteData(), appendNonAsciiString(), QtPrivate::isAscii(), and QCborValue::String.

+ Here is the call graph for this function:

◆ append() [6/7]

void QCborContainerPrivate::append ( QStringView s)
inline

Definition at line 245 of file qcborvalue_p.h.

References appendAsciiString(), appendNonAsciiString(), and QtPrivate::isAscii().

+ Here is the call graph for this function:

◆ append() [7/7]

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

Definition at line 201 of file qcborvalue_p.h.

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

Referenced by QCborValue::QCborValue(), QCborValue::QCborValue(), QCborValue::QCborValue(), StashedContainer::~StashedContainer(), 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 220 of file qcborvalue_p.h.

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

+ 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 1054 of file qcborvalue.cpp.

References addByteData(), QList< T >::append(), elements, QtCbor::Element::flags, ptr(), qt_to_latin1_unchecked(), QCborValue::String, QtCbor::Element::type, and QtCbor::Element::value.

+ 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 213 of file qcborvalue_p.h.

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

+ Here is the caller graph for this function:

◆ appendNonAsciiString()

void QCborContainerPrivate::appendNonAsciiString ( QStringView s)

Definition at line 1068 of file qcborvalue.cpp.

References appendByteData(), and QCborValue::String.

Referenced by append(), and append().

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

◆ appendUtf8String()

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

Definition at line 224 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 257 of file qcborvalue_p.h.

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

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 161 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 148 of file qcborvalue_p.h.

References QtCbor::Element::flags, Q_ASSERT, and QtCbor::Element::value.

Referenced by byteArrayAt(), byteData(), compact(), 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 946 of file qcborvalue.cpp.

References d, 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 ( )

Definition at line 926 of file qcborvalue.cpp.

References addByteDataImpl(), byteData(), elements, and usedData.

Referenced by extractAt_complex(), and replaceAt_complex().

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

◆ compareElement()

int QCborContainerPrivate::compareElement ( qsizetype idx,
const QCborValue & value,
QtCbor::Comparison mode ) const
inline

Definition at line 386 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,
QtCbor::Comparison mode )
inlinestaticnoexcept

Definition at line 1336 of file qcborvalue.cpp.

References c2, and compareElementRecursive().

Referenced by 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 343 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 348 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 166 of file qcborvalue_p.h.

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

+ Here is the call graph for this function:

◆ deref()

void QCborContainerPrivate::deref ( )
inline

Definition at line 110 of file qcborvalue_p.h.

Referenced by extractAt(), findOrAddMapKey(), replaceAt(), and sortContainer().

+ Here is the caller graph for this function:

◆ detach()

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

Definition at line 969 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 328 of file qcborvalue_p.h.

References QtCbor::Element::container, QtCbor::Element::flags, QtCbor::Element::type, and QtCbor::Element::value.

Referenced by QCborValue::compare(), compareElement(), QCborValueConstRef::comparesEqual_helper(), and QCborValueConstRef::compareThreeWay_helper().

+ Here is the caller graph for this function:

◆ extractAt()

QCborValue QCborContainerPrivate::extractAt ( qsizetype idx)
inline

Definition at line 310 of file qcborvalue_p.h.

References QtCbor::Element::container, deref(), elements, extractAt_complex(), QtCbor::Element::flags, QCborValue::Invalid, makeValue(), MoveContainer, qSwap(), QList< T >::size(), QCborValue::Tag, QtCbor::Element::type, and QtCbor::Element::value.

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 1074 of file qcborvalue.cpp.

References appendByteData(), byteData(), compact(), data, QtCbor::Element::flags, makeValue(), Q_ASSERT, QByteArray::reserve(), QtCbor::Element::type, 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 419 of file qcborvalue_p.h.

References elements, QCborValue(), 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 400 of file qcborvalue_p.h.

References QList< T >::at(), compareElement(), elements, QtCbor::ForEquality, 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 429 of file qcborvalue_p.h.

References append(), detach(), elements, findCborMapKey(), i, Q_ASSERT, QCborValue(), 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 769 of file qcbormap.cpp.

References map.

◆ findOrAddMapKey() [3/4]

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

Definition at line 2485 of file qcborvalue.cpp.

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

+ 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 2501 of file qcborvalue.cpp.

References QCborValue::Array, assignContainer(), QtCbor::Element::container, convertArrayToMap(), deref(), QtCbor::Element::flags, QCborValue::Map, and QtCbor::Element::type.

+ 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 982 of file qcborvalue.cpp.

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

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 196 of file qcborvalue_p.h.

References 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 283 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 393 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 184 of file qcborvalue_p.h.

References byteData(), QtCbor::Element::container, deref(), elements, QtCbor::Element::flags, 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 998 of file qcborvalue.cpp.

References addByteData(), QList< T >::at(), clone(), compact(), QtCbor::Element::container, CopyContainer, d, elements, QtCbor::Element::flags, MoveContainer, Q_ASSERT, Q_UNLIKELY, QBasicAtomicInteger< T >::ref(), QSharedData::ref, QtCbor::Element::type, and QtCbor::Element::value.

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 175 of file qcborvalue_p.h.

References QtCbor::Element::container, replaceAt_complex(), and QtCbor::Element::type.

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 278 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 265 of file qcborvalue_p.h.

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

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,
QtCbor::Comparison mode ) const
inline

Definition at line 354 of file qcborvalue_p.h.

References byteData(), QtPrivate::compareStrings(), compareUtf8(), QtPrivate::equalStrings(), QtCbor::Element::flags, QtCbor::ForEquality, QCborValue::String, and QtCbor::Element::type.

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 372 of file qcborvalue_p.h.

References QtCbor::ForEquality, 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 378 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 294 of file qcborvalue_p.h.

References QList< T >::at(), elements, QCborValue::Invalid, makeValue(), and QCborValue::Tag.

Referenced by QCborArray::at(), QCborMap::keys(), 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 90 of file qcborvalue_p.h.

Member Data Documentation

◆ data

QByteArray QCborContainerPrivate::data

◆ elements

◆ usedData

QByteArray::size_type QCborContainerPrivate::usedData = 0

Definition at line 106 of file qcborvalue_p.h.

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


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