Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QCborError Class Reference

\inmodule QtCore \inheaderfile QtCborCommon \reentrant More...

#include <qcborcommon.h>

+ Collaboration diagram for QCborError:

Public Types

enum  Code : int {
  UnknownError = 1 , AdvancePastEnd = 3 , InputOutputError = 4 , GarbageAtEnd = 256 ,
  EndOfFile , UnexpectedBreak , UnknownType , IllegalType ,
  IllegalNumber , IllegalSimpleType , InvalidUtf8String = 516 , DataTooLarge = 1024 ,
  NestingTooDeep , UnsupportedType , NoError = 0
}
 This enum contains the possible error condition codes. More...
 

Public Member Functions

 operator Code () const
 \variable QCborError::c
 
QString toString () const
 Returns a text string that matches the error code in this QCborError object.
 

Public Attributes

Code c
 

Detailed Description

\inmodule QtCore \inheaderfile QtCborCommon \reentrant

Since
5.12

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

See also
QCborStreamReader, QCborValue, QCborParserError, {Parsing and displaying CBOR data}, {Serialization Converter}, {Saving and Loading a Game}

Definition at line 62 of file qcborcommon.h.

Member Enumeration Documentation

◆ Code

enum QCborError::Code : int

This enum contains the possible error condition codes.

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

Enumerator
UnknownError 
AdvancePastEnd 
InputOutputError 
GarbageAtEnd 
EndOfFile 
UnexpectedBreak 
UnknownType 
IllegalType 
IllegalNumber 
IllegalSimpleType 
InvalidUtf8String 
DataTooLarge 
NestingTooDeep 
UnsupportedType 
NoError 

Definition at line 66 of file qcborcommon.h.

Member Function Documentation

◆ operator Code()

QCborError::operator Code ( ) const
inline

\variable QCborError::c

Returns the error code that this QCborError object stores.

Definition at line 89 of file qcborcommon.h.

◆ toString()

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

Definition at line 239 of file qcborcommon.cpp.

References AdvancePastEnd, DataTooLarge, EndOfFile, QString::fromLatin1(), GarbageAtEnd, IllegalNumber, IllegalSimpleType, IllegalType, InputOutputError, InvalidUtf8String, NestingTooDeep, NoError, QStringLiteral, UnexpectedBreak, UnknownError, UnknownType, and UnsupportedType.

Referenced by QCborParserError::errorString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ c

Code QCborError::c

Definition at line 88 of file qcborcommon.h.


The documentation for this class was generated from the following files: