6.0.0-rc4Source

QCborError Class

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

Header#include <QCborError>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes
Since5.12

List of all members, including inherited members

Public Types

enumCode

Public Functions

Codecode() const
operator Code() const
QStringtoString() const

Public Variables

Codec

Detailed Description

A QCborError converts to its Code, so it can be compared with an enumerator:

if (reader.lastError() != QCborError::NoError)
    qWarning() << reader.lastError().toString();

See also QCborStreamReader::lastError() and QCborParserError.

Differences from Qt

None.

Member Type Documentation

enum QCborError::Code

The errors of CBOR.

ConstantDescription
QCborError::NoErrorThere was no error.
QCborError::UnknownErrorSomething went wrong that has no code of its own.
QCborError::AdvancePastEndThe reader was asked to read past the end of a container.
QCborError::InputOutputErrorThe device could not be read.
QCborError::GarbageAtEndThere is data after the end of the CBOR stream.
QCborError::EndOfFileThe data ends before the element does; more data may come.
QCborError::UnexpectedBreakA break byte that ends no container of unknown length.
QCborError::UnknownTypeA type of CBOR that is not defined.
QCborError::IllegalTypeAn item where its type is not allowed, such as a chunk of another type in a string.
QCborError::IllegalNumberA number that is not encoded properly.
QCborError::IllegalSimpleTypeA simple type below 32 that is encoded in two bytes.
QCborError::InvalidUtf8StringA text string that is not valid UTF-8.
QCborError::DataTooLargeA string or container larger than this program can hold.
QCborError::NestingTooDeepContainers nested more deeply than the limit allows.
QCborError::UnsupportedTypeAn item that the operation does not support.

Member Function Documentation

[constexpr] Code QCborError::code() const

Returns the code of the error.

[constexpr] QCborError::operator Code() const

Returns the code of the error, so that a QCborError can be compared with a Code.

QString QCborError::toString() const

Returns a text that describes the error, in English.

Member Variable Documentation

Code QCborError::c

The code of the error.