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

#include <qjsonvalue.h>

+ Collaboration diagram for QJsonValueConstRef:

Public Member Functions

 QJsonValueConstRef (const QJsonValueConstRef &)=default
 
QJsonValueConstRefoperator= (const QJsonValueConstRef &)=delete
 
 operator QJsonValue () const
 
Q_CORE_EXPORT QVariant toVariant () const
 
QJsonValue::Type type () const
 
bool isNull () const
 
bool isBool () const
 
bool isDouble () const
 
bool isString () const
 
bool isArray () const
 
bool isObject () const
 
bool isUndefined () const
 
bool toBool (bool defaultValue=false) const
 
int toInt (int defaultValue=0) const
 
qint64 toInteger (qint64 defaultValue=0) const
 
double toDouble (double defaultValue=0) const
 
QString toString (const QString &defaultValue={}) const
 
Q_CORE_EXPORT QJsonArray toArray () const
 
Q_CORE_EXPORT QJsonObject toObject () const
 
const QJsonValue operator[] (QStringView key) const
 
const QJsonValue operator[] (QLatin1StringView key) const
 
const QJsonValue operator[] (qsizetype i) const
 
bool operator== (const QJsonValue &other) const
 
bool operator!= (const QJsonValue &other) const
 

Protected Member Functions

QString objectKey () const
 
constexpr QJsonValueConstRef (QCborContainerPrivate *d, size_t index, bool is_object)
 
 QJsonValueConstRef (QJsonArray *array, qsizetype idx)
 
 QJsonValueConstRef (QJsonObject *object, qsizetype idx)
 
void rebind (QJsonValueConstRef other)
 

Static Protected Member Functions

static Q_CORE_EXPORT QJsonValue::Type concreteType (QJsonValueConstRef self) noexcept Q_DECL_PURE_FUNCTION
 
static Q_CORE_EXPORT bool concreteBool (QJsonValueConstRef self, bool defaultValue) noexcept Q_DECL_PURE_FUNCTION
 
static Q_CORE_EXPORT qint64 concreteInt (QJsonValueConstRef self, qint64 defaultValue, bool clamp) noexcept Q_DECL_PURE_FUNCTION
 
static Q_CORE_EXPORT double concreteDouble (QJsonValueConstRef self, double defaultValue) noexcept Q_DECL_PURE_FUNCTION
 
static Q_CORE_EXPORT QString concreteString (QJsonValueConstRef self, const QString &defaultValue)
 
static Q_CORE_EXPORT QJsonValue concrete (QJsonValueConstRef self) noexcept
 
static Q_CORE_EXPORT QString objectKey (QJsonValueConstRef self)
 

Protected Attributes

QCborContainerPrivated = nullptr
 
size_t is_object: 1
 
size_t index: std::numeric_limits<size_t>::digits - 1
 

Friends

class QJsonArray
 
class QJsonObject
 
class QJsonPrivate::Value
 

Detailed Description

Definition at line 117 of file qjsonvalue.h.

Constructor & Destructor Documentation

◆ QJsonValueConstRef() [1/4]

QJsonValueConstRef::QJsonValueConstRef ( const QJsonValueConstRef )
default

◆ QJsonValueConstRef() [2/4]

constexpr QJsonValueConstRef::QJsonValueConstRef ( QCborContainerPrivate d,
size_t  index,
bool  is_object 
)
inlineconstexprprotected

Definition at line 194 of file qjsonvalue.h.

◆ QJsonValueConstRef() [3/4]

QJsonValueConstRef::QJsonValueConstRef ( QJsonArray array,
qsizetype  idx 
)
inlineprotected

Definition at line 237 of file qjsonarray.h.

◆ QJsonValueConstRef() [4/4]

QJsonValueConstRef::QJsonValueConstRef ( QJsonObject object,
qsizetype  idx 
)
inlineprotected

Definition at line 273 of file qjsonobject.h.

Member Function Documentation

◆ concrete()

QJsonValue QJsonValueConstRef::concrete ( QJsonValueConstRef  self)
staticprotectednoexcept

Definition at line 1004 of file qjsonvalue.cpp.

References QJsonPrivate::Value::container(), d, QJsonPrivate::Value::fromTrustedCbor(), and QJsonPrivate::Value::indexHelper().

Referenced by toArray(), toObject(), and toVariant().

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

◆ concreteBool()

bool QJsonValueConstRef::concreteBool ( QJsonValueConstRef  self,
bool  defaultValue 
)
staticprotectednoexcept

Definition at line 959 of file qjsonvalue.cpp.

References e, QJsonPrivate::Value::elementHelper(), QCborValue::False, and QCborValue::True.

+ Here is the call graph for this function:

◆ concreteDouble()

double QJsonValueConstRef::concreteDouble ( QJsonValueConstRef  self,
double  defaultValue 
)
staticprotectednoexcept

Definition at line 985 of file qjsonvalue.cpp.

References QCborValue::Double, e, QJsonPrivate::Value::elementHelper(), and QCborValue::Integer.

+ Here is the call graph for this function:

◆ concreteInt()

qint64 QJsonValueConstRef::concreteInt ( QJsonValueConstRef  self,
qint64  defaultValue,
bool  clamp 
)
staticprotectednoexcept

Definition at line 969 of file qjsonvalue.cpp.

References QCborValue::Double, e, QJsonPrivate::Value::elementHelper(), and QCborValue::Integer.

+ Here is the call graph for this function:

◆ concreteString()

QString QJsonValueConstRef::concreteString ( QJsonValueConstRef  self,
const QString defaultValue 
)
staticprotected

Definition at line 995 of file qjsonvalue.cpp.

References QList< T >::at(), QJsonPrivate::Value::container(), d, QCborContainerPrivate::elements, QJsonPrivate::Value::indexHelper(), QCborValue::String, QCborContainerPrivate::stringAt(), and QtCbor::Element::type.

+ Here is the call graph for this function:

◆ concreteType()

QJsonValue::Type QJsonValueConstRef::concreteType ( QJsonValueConstRef  self)
staticprotectednoexcept

Definition at line 954 of file qjsonvalue.cpp.

References convertFromCborType(), and QJsonPrivate::Value::elementHelper().

+ Here is the call graph for this function:

◆ isArray()

bool QJsonValueConstRef::isArray ( ) const
inline

Definition at line 130 of file qjsonvalue.h.

References QJsonValue::Array.

Referenced by QT_BEGIN_NAMESPACE::checkDocument().

+ Here is the caller graph for this function:

◆ isBool()

bool QJsonValueConstRef::isBool ( ) const
inline

Definition at line 127 of file qjsonvalue.h.

References QJsonValue::Bool.

◆ isDouble()

bool QJsonValueConstRef::isDouble ( ) const
inline

Definition at line 128 of file qjsonvalue.h.

References QJsonValue::Double.

Referenced by QT_BEGIN_NAMESPACE::checkLocation().

+ Here is the caller graph for this function:

◆ isNull()

bool QJsonValueConstRef::isNull ( ) const
inline

Definition at line 126 of file qjsonvalue.h.

References QJsonValue::Null.

◆ isObject()

bool QJsonValueConstRef::isObject ( ) const
inline

Definition at line 131 of file qjsonvalue.h.

References QJsonValue::Object.

Referenced by QT_BEGIN_NAMESPACE::checkDocument(), and QT_BEGIN_NAMESPACE::checkLocation().

+ Here is the caller graph for this function:

◆ isString()

bool QJsonValueConstRef::isString ( ) const
inline

Definition at line 129 of file qjsonvalue.h.

References QJsonValue::String.

◆ isUndefined()

bool QJsonValueConstRef::isUndefined ( ) const
inline

Definition at line 132 of file qjsonvalue.h.

References QJsonValue::Undefined.

◆ objectKey() [1/2]

QString QJsonValueConstRef::objectKey ( ) const
inlineprotected

Definition at line 168 of file qjsonvalue.h.

References objectKey().

Referenced by objectKey().

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

◆ objectKey() [2/2]

QString QJsonValueConstRef::objectKey ( QJsonValueConstRef  self)
staticprotected

Definition at line 1011 of file qjsonvalue.cpp.

References QJsonPrivate::Value::container(), d, elements, QJsonPrivate::Value::indexHelper(), Q_ASSERT, and QCborContainerPrivate::stringAt().

+ Here is the call graph for this function:

◆ operator QJsonValue()

QJsonValueConstRef::operator QJsonValue ( ) const
inline

Definition at line 122 of file qjsonvalue.h.

◆ operator!=()

bool QJsonValueConstRef::operator!= ( const QJsonValue other) const
inline

Definition at line 152 of file qjsonvalue.h.

References other().

+ Here is the call graph for this function:

◆ operator=()

QJsonValueConstRef & QJsonValueConstRef::operator= ( const QJsonValueConstRef )
delete

◆ operator==()

bool QJsonValueConstRef::operator== ( const QJsonValue other) const
inline

Definition at line 151 of file qjsonvalue.h.

References other().

+ Here is the call graph for this function:

◆ operator[]() [1/3]

const QJsonValue QJsonValueConstRef::operator[] ( QLatin1StringView  key) const
inline

Definition at line 148 of file qjsonvalue.h.

◆ operator[]() [2/3]

const QJsonValue QJsonValueConstRef::operator[] ( qsizetype  i) const
inline

Definition at line 149 of file qjsonvalue.h.

References i.

◆ operator[]() [3/3]

const QJsonValue QJsonValueConstRef::operator[] ( QStringView  key) const
inline

Definition at line 147 of file qjsonvalue.h.

◆ rebind()

void QJsonValueConstRef::rebind ( QJsonValueConstRef  other)
inlineprotected

Definition at line 202 of file qjsonvalue.h.

References d, and other().

+ Here is the call graph for this function:

◆ toArray()

QJsonArray QJsonValueConstRef::toArray ( ) const

Definition at line 944 of file qjsonvalue.cpp.

References concrete(), and QJsonValue::toArray().

Referenced by QT_BEGIN_NAMESPACE::checkDocument().

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

◆ toBool()

bool QJsonValueConstRef::toBool ( bool  defaultValue = false) const
inline

Definition at line 134 of file qjsonvalue.h.

◆ toDouble()

double QJsonValueConstRef::toDouble ( double  defaultValue = 0) const
inline

Definition at line 140 of file qjsonvalue.h.

Referenced by loadAndroidStyle().

+ Here is the caller graph for this function:

◆ toInt()

int QJsonValueConstRef::toInt ( int  defaultValue = 0) const
inline

Definition at line 136 of file qjsonvalue.h.

◆ toInteger()

qint64 QJsonValueConstRef::toInteger ( qint64  defaultValue = 0) const
inline

Definition at line 138 of file qjsonvalue.h.

◆ toObject()

QJsonObject QJsonValueConstRef::toObject ( ) const

Definition at line 949 of file qjsonvalue.cpp.

References concrete(), and QJsonValue::toObject().

Referenced by QT_BEGIN_NAMESPACE::checkDocument(), QT_BEGIN_NAMESPACE::checkLocation(), and loadAndroidStyle().

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

◆ toString()

QString QJsonValueConstRef::toString ( const QString defaultValue = {}) const
inline

Definition at line 142 of file qjsonvalue.h.

Referenced by loadAndroidStyle().

+ Here is the caller graph for this function:

◆ toVariant()

QVariant QJsonValueConstRef::toVariant ( ) const

Definition at line 939 of file qjsonvalue.cpp.

References concrete(), and QJsonValue::toVariant().

+ Here is the call graph for this function:

◆ type()

QJsonValue::Type QJsonValueConstRef::type ( ) const
inline

Definition at line 125 of file qjsonvalue.h.

Friends And Related Symbol Documentation

◆ QJsonArray

friend class QJsonArray
friend

Definition at line 213 of file qjsonvalue.h.

◆ QJsonObject

friend class QJsonObject
friend

Definition at line 214 of file qjsonvalue.h.

◆ QJsonPrivate::Value

friend class QJsonPrivate::Value
friend

Definition at line 215 of file qjsonvalue.h.

Member Data Documentation

◆ d

QCborContainerPrivate* QJsonValueConstRef::d = nullptr
protected

Definition at line 208 of file qjsonvalue.h.

Referenced by concreteString(), and objectKey().

◆ index

size_t QJsonValueConstRef::index
protected

Definition at line 210 of file qjsonvalue.h.

◆ is_object

size_t QJsonValueConstRef::is_object
protected

Definition at line 209 of file qjsonvalue.h.


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