W3cubDocs

/Qt

QCborError Struct

The QCborError class holds the error condition found while parsing or validating a CBOR stream. More...

Header: #include <QtCborCommon>
CMake: find_package(Qt6 COMPONENTS Core REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 5.12

Note: All functions in this struct are reentrant.

Public Types

enum Code { NoError, UnknownError, AdvancePastEnd, InputOutputError, GarbageAtEnd, …, UnsupportedType }

Public Functions

QString toString() const
QCborError::Code operator QCborError::Code() const

Detailed Description

See also QCborStreamReader, QCborValue, and QCborParserError.

Member Type Documentation

enum QCborError::Code

This enum contains the possible error condition codes.

Constant Value Description
QCborError::NoError 0 No error was detected.
QCborError::UnknownError 1 An unknown error occurred and no further details are available.
QCborError::AdvancePastEnd 3 QCborStreamReader::next() was called but there are no more elements in the current context.
QCborError::InputOutputError 4 An I/O error with the QIODevice occurred.
QCborError::GarbageAtEnd 256 Data was found in the input stream after the last element.
QCborError::EndOfFile 257 The end of the input stream was unexpectedly reached while processing an element.
QCborError::UnexpectedBreak 258 The CBOR stream contains a Break where it is not allowed (data is corrupt and the error is not recoverable).
QCborError::UnknownType 259 The CBOR stream contains an unknown/unparsable Type (data is corrupt and the and the error is not recoverable).
QCborError::IllegalType 260 The CBOR stream contains a known type in a position it is not allowed to exist (data is corrupt and the error is not recoverable).
QCborError::IllegalNumber 261 The CBOR stream appears to be encoding a number larger than 64-bit (data is corrupt and the error is not recoverable).
QCborError::IllegalSimpleType 262 The CBOR stream contains a Simple Type encoded incorrectly (data is corrupt and the error is not recoverable).
QCborError::InvalidUtf8String 516 The CBOR stream contains a text string that does not decode properly as UTF-8 (data is corrupt and the error is not recoverable).
QCborError::DataTooLarge 1024 CBOR string, map or array is too big and cannot be parsed by Qt (internal limitation, but the error is not recoverable).
QCborError::NestingTooDeep 1025 Too many levels of arrays or maps encountered while processing the input (internal limitation, but the error is not recoverable).
QCborError::UnsupportedType 1026 The CBOR stream contains a known type that the implementation does not support (internal limitation, but the error is not recoverable).

Member Function Documentation

QString QCborError::toString() const

Returns a text string that matches the error code in this QCborError object.

Note: the string is not translated. Applications whose interface allow users to parse CBOR streams need to provide their own, translated strings.

See also QCborError::Code.

QCborError::Code QCborError::operator QCborError::Code() const

Returns the error code that this QCborError object stores.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qcborerror.html