QCborError 結構

QCborError 類保持I當剖析或驗證 CBOR 流時發現的錯誤條件。 更多...

頭: #include <QtCborCommon>
qmake: QT += core
Since: Qt 5.12

This struct was introduced in Qt 5.12.

注意: 在此結構中的所有函數均 可重入 .

公共類型

enum 代碼 { NoError, UnknownError, AdvancePastEnd, InputOutputError, GarbageAtEnd, …, UnsupportedType }

公共函數

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

詳細描述

另請參閱 QCborStreamReader , QCborValue ,和 QCborParserError .

成員類型文檔編製

enum QCborError:: 代碼

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 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.