QCborError Class
The QCborError class holds the error condition found while parsing or validating a CBOR stream. More…
| Header | #include <QCborError> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Since | 5.12 |
List of all members, including inherited members
Public Types
| enum | Code |
Public Functions
| Code | code() const |
| operator Code() const | |
| QString | toString() const |
Public Variables
| Code | c |
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.
| Constant | Description |
|---|---|
QCborError::NoError | There was no error. |
QCborError::UnknownError | Something went wrong that has no code of its own. |
QCborError::AdvancePastEnd | The reader was asked to read past the end of a container. |
QCborError::InputOutputError | The device could not be read. |
QCborError::GarbageAtEnd | There is data after the end of the CBOR stream. |
QCborError::EndOfFile | The data ends before the element does; more data may come. |
QCborError::UnexpectedBreak | A break byte that ends no container of unknown length. |
QCborError::UnknownType | A type of CBOR that is not defined. |
QCborError::IllegalType | An item where its type is not allowed, such as a chunk of another type in a string. |
QCborError::IllegalNumber | A number that is not encoded properly. |
QCborError::IllegalSimpleType | A simple type below 32 that is encoded in two bytes. |
QCborError::InvalidUtf8String | A text string that is not valid UTF-8. |
QCborError::DataTooLarge | A string or container larger than this program can hold. |
QCborError::NestingTooDeep | Containers nested more deeply than the limit allows. |
QCborError::UnsupportedType | An item that the operation does not support. |
Member Function Documentation
Code QCborError::code() const
Returns the code of the error.
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.