QCborValueConstRef Class
The QCborValueConstRef class is a reference to a value in a QCborArray or QCborMap that cannot be changed. More…
| Header | #include <QCborValueConstRef> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Since | 6.4 |
| Inherited by | QCborValueRef |
List of all members, including inherited members
Public Functions
| QCborValueConstRef(const QCborValueConstRef &other) | |
| operator QCborValue() const | |
| QCborValue | concrete() const |
| QCborValue::Type | type() const |
| bool | isInteger() const |
| bool | isByteArray() const |
| bool | isString() const |
| bool | isArray() const |
| bool | isMap() const |
| bool | isTag() const |
| bool | isFalse() const |
| bool | isTrue() const |
| bool | isBool() const |
| bool | isNull() const |
| bool | isUndefined() const |
| bool | isDouble() const |
| bool | isDateTime() const |
| bool | isUrl() const |
| bool | isRegularExpression() const |
| bool | isUuid() const |
| bool | isInvalid() const |
| bool | isContainer() const |
| bool | isSimpleType() const |
| bool | isSimpleType(QCborSimpleType st) const |
| QCborSimpleType | toSimpleType(QCborSimpleType defaultValue = QCborSimpleType::Undefined) const |
| qint64 | toInteger(qint64 defaultValue = 0) const |
| bool | toBool(bool defaultValue = false) const |
| double | toDouble(double defaultValue = 0) const |
| QCborTag | tag(QCborTag defaultValue = QCborTag(~0ULL)) const |
| QCborValue | taggedValue(const QCborValue &defaultValue = QCborValue()) const |
| QByteArray | toByteArray(const QByteArray &defaultValue = {}) const |
| QString | toString(const QString &defaultValue = {}) const |
| QDateTime | toDateTime(const QDateTime &defaultValue = {}) const |
| QUrl | toUrl(const QUrl &defaultValue = {}) const |
| QRegularExpression | toRegularExpression(const QRegularExpression &defaultValue = {}) const |
| QUuid | toUuid(const QUuid &defaultValue = {}) const |
| QCborArray | toArray() const |
| QCborArray | toArray(const QCborArray &defaultValue) const |
| QCborMap | toMap() const |
| QCborMap | toMap(const QCborMap &defaultValue) const |
| QVariant | toVariant() const |
| QJsonValue | toJsonValue() const |
| QByteArray | toCbor(QCborValue::EncodingOptions opt = QCborValue::NoTransformation) const |
| void | toCbor(QCborStreamWriter &writer, QCborValue::EncodingOptions opt = QCborValue::NoTransformation) const |
| QString | toDiagnosticNotation(QCborValue::DiagnosticNotationOptions opt = QCborValue::Compact) const |
| int | compare(const QCborValue &other) const |
| const QCborValue | operator[](const QString &key) const |
| const QCborValue | operator[](QLatin1StringView key) const |
| const QCborValue | operator[](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.