QCborError 结构

QCborError 类保持I当剖析或验证 CBOR 流时发现的错误条件。 更多...

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

注意: 在此结构中的所有函数均 可重入 .

公共类型

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

公共函数

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

详细描述

另请参阅 QCborStreamReader , QCborValue , QCborParserError , Parsing and displaying CBOR data , 序列化转换器 ,和 保存和加载游戏 .

成员类型文档编制

enum QCborError:: Code

This enum contains the possible error condition codes.

常量 描述
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 出现。
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 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).

成员函数文档编制

QString QCborError:: toString () const

Returns a text string that matches the error code in this QCborError 对象。

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

另请参阅 QCborError::Code .

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

Returns the error code that this QCborError object stores.