6.0.0-rc4Source

QCborValueConstRef Class

The QCborValueConstRef class is a reference to a value in a QCborArray or QCborMap that cannot be changed. More…

Header#include <QCborValueConstRef>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes
Since6.4
Inherited byQCborValueRef

List of all members, including inherited members

Public Functions

QCborValueConstRef(const QCborValueConstRef &other)
operator QCborValue() const
QCborValueconcrete() const
QCborValue::Typetype() const
boolisInteger() const
boolisByteArray() const
boolisString() const
boolisArray() const
boolisMap() const
boolisTag() const
boolisFalse() const
boolisTrue() const
boolisBool() const
boolisNull() const
boolisUndefined() const
boolisDouble() const
boolisDateTime() const
boolisUrl() const
boolisRegularExpression() const
boolisUuid() const
boolisInvalid() const
boolisContainer() const
boolisSimpleType() const
boolisSimpleType(QCborSimpleType st) const
QCborSimpleTypetoSimpleType(QCborSimpleType defaultValue = QCborSimpleType::Undefined) const
qint64toInteger(qint64 defaultValue = 0) const
booltoBool(bool defaultValue = false) const
doubletoDouble(double defaultValue = 0) const
QCborTagtag(QCborTag defaultValue = QCborTag(~0ULL)) const
QCborValuetaggedValue(const QCborValue &defaultValue = QCborValue()) const
QByteArraytoByteArray(const QByteArray &defaultValue = {}) const
QStringtoString(const QString &defaultValue = {}) const
QDateTimetoDateTime(const QDateTime &defaultValue = {}) const
QUrltoUrl(const QUrl &defaultValue = {}) const
QRegularExpressiontoRegularExpression(const QRegularExpression &defaultValue = {}) const
QUuidtoUuid(const QUuid &defaultValue = {}) const
QCborArraytoArray() const
QCborArraytoArray(const QCborArray &defaultValue) const
QCborMaptoMap() const
QCborMaptoMap(const QCborMap &defaultValue) const
QVarianttoVariant() const
QJsonValuetoJsonValue() const
QByteArraytoCbor(QCborValue::EncodingOptions opt = QCborValue::NoTransformation) const
voidtoCbor(QCborStreamWriter &writer, QCborValue::EncodingOptions opt = QCborValue::NoTransformation) const
QStringtoDiagnosticNotation(QCborValue::DiagnosticNotationOptions opt = QCborValue::Compact) const
intcompare(const QCborValue &other) const
const QCborValueoperator[](const QString &key) const
const QCborValueoperator[](QLatin1StringView key) const
const QCborValueoperator[](qint64 key) const

Detailed Description

The const iterators of the containers and the keys of a map give such a reference. It reads as a QCborValue does; converting it gives a copy.

See also QCborValueRef.

Differences from Qt

The reference points to the value in the container: it is invalid once the container gets or loses elements.

Member Function Documentation

QCborValueConstRef::QCborValueConstRef(const QCborValueConstRef &other)

Constructs a reference to the value that other refers to.

int QCborValueConstRef::compare(const QCborValue &other) const

Compares the value with other; see QCborValue::compare().

QCborValue QCborValueConstRef::concrete() const

Returns a copy of the value that the reference refers to.

bool QCborValueConstRef::isArray() const

Returns true if the value is an array.

bool QCborValueConstRef::isBool() const

Returns true if the value is false or true.

bool QCborValueConstRef::isByteArray() const

Returns true if the value is a byte array.

bool QCborValueConstRef::isContainer() const

Returns true if the value is an array or a map.

bool QCborValueConstRef::isDateTime() const

Returns true if the value is a date and time.

bool QCborValueConstRef::isDouble() const

Returns true if the value is a floating-point number.

bool QCborValueConstRef::isFalse() const

Returns true if the value is false.

bool QCborValueConstRef::isInteger() const

Returns true if the value is an integer.

bool QCborValueConstRef::isInvalid() const

Returns true if the value is invalid.

bool QCborValueConstRef::isMap() const

Returns true if the value is a map.

bool QCborValueConstRef::isNull() const

Returns true if the value is null.

bool QCborValueConstRef::isRegularExpression() const

Returns true if the value is a regular expression.

bool QCborValueConstRef::isSimpleType() const

Returns true if the value is a simple type.

bool QCborValueConstRef::isSimpleType(QCborSimpleType st) const

This is an overloaded function.

Returns true if the value is the simple type st.

bool QCborValueConstRef::isString() const

Returns true if the value is a string.

bool QCborValueConstRef::isTag() const

Returns true if the value is a tag, also one of the extended types.

bool QCborValueConstRef::isTrue() const

Returns true if the value is true.

bool QCborValueConstRef::isUndefined() const

Returns true if the value is undefined.

bool QCborValueConstRef::isUrl() const

Returns true if the value is a URL.

bool QCborValueConstRef::isUuid() const

Returns true if the value is a UUID.

QCborValueConstRef::operator QCborValue() const

Returns a copy of the value that the reference refers to.

See also concrete().

const QCborValue QCborValueConstRef::operator[](const QString &key) const

Returns the value of key in the map that the reference refers to, or undefined.

const QCborValue QCborValueConstRef::operator[](QLatin1StringView key) const

This is an overloaded function.

Returns the value of key in the map that the reference refers to, or undefined.

const QCborValue QCborValueConstRef::operator[](qint64 key) const

This is an overloaded function.

Returns the element or value at key in the array or map that the reference refers to, or undefined.

QCborTag QCborValueConstRef::tag(QCborTag defaultValue = QCborTag(~0ULL)) const

Returns the tag of the value, or defaultValue if it is not a tag.

QCborValue QCborValueConstRef::taggedValue(const QCborValue &defaultValue = QCborValue()) const

Returns the value that the tag of the value applies to, or defaultValue if it is not a tag.

QCborArray QCborValueConstRef::toArray() const

Returns the array of the value, or an empty array if it is not an array.

QCborArray QCborValueConstRef::toArray(const QCborArray &defaultValue) const

This is an overloaded function.

Returns the array of the value, or defaultValue if it is not an array.

bool QCborValueConstRef::toBool(bool defaultValue = false) const

Returns the boolean of the value, or defaultValue if it is not a boolean.

QByteArray QCborValueConstRef::toByteArray(const QByteArray &defaultValue = {}) const

Returns the byte array of the value, or defaultValue if it is not a byte array.

QByteArray QCborValueConstRef::toCbor(QCborValue::EncodingOptions opt = QCborValue::NoTransformation) const

Returns the value encoded in CBOR with the options opt.

void QCborValueConstRef::toCbor(QCborStreamWriter &writer, QCborValue::EncodingOptions opt = QCborValue::NoTransformation) const

This is an overloaded function.

Writes the value to writer with the options opt.

QDateTime QCborValueConstRef::toDateTime(const QDateTime &defaultValue = {}) const

Returns the date and time of the value, or defaultValue if it is not a date and time.

QString QCborValueConstRef::toDiagnosticNotation(QCborValue::DiagnosticNotationOptions opt = QCborValue::Compact) const

Returns the value in the diagnostic notation of CBOR, with the options opt.

double QCborValueConstRef::toDouble(double defaultValue = 0) const

Returns the value as a floating-point number, also an integer, or defaultValue if it is no number.

qint64 QCborValueConstRef::toInteger(qint64 defaultValue = 0) const

Returns the integer of the value, or defaultValue if it is not an integer.

QJsonValue QCborValueConstRef::toJsonValue() const

Returns the value as a QJsonValue; see QCborValue::toJsonValue().

QCborMap QCborValueConstRef::toMap() const

Returns the map of the value, or an empty map if it is not a map.

QCborMap QCborValueConstRef::toMap(const QCborMap &defaultValue) const

This is an overloaded function.

Returns the map of the value, or defaultValue if it is not a map.

QRegularExpression QCborValueConstRef::toRegularExpression(const QRegularExpression &defaultValue = {}) const

Returns the regular expression of the value, or defaultValue if it is not one.

QCborSimpleType QCborValueConstRef::toSimpleType(QCborSimpleType defaultValue = QCborSimpleType::Undefined) const

Returns the simple type of the value, or defaultValue if it is not a simple type.

QString QCborValueConstRef::toString(const QString &defaultValue = {}) const

Returns the string of the value, or defaultValue if it is not a string.

QUrl QCborValueConstRef::toUrl(const QUrl &defaultValue = {}) const

Returns the URL of the value, or defaultValue if it is not a URL.

QUuid QCborValueConstRef::toUuid(const QUuid &defaultValue = {}) const

Returns the UUID of the value, or defaultValue if it is not a UUID.

QVariant QCborValueConstRef::toVariant() const

Returns the value as a QVariant; see QCborValue::toVariant().

QCborValue::Type QCborValueConstRef::type() const

Returns the type of the value that the reference refers to.