240QString QCborError::toString()
const
244 static_assert(
int(NoError) ==
int(CborNoError));
248 static_assert(
int(UnknownError) ==
int(CborUnknownError));
249 return QStringLiteral(
"Unknown error");
251 static_assert(
int(AdvancePastEnd) ==
int(CborErrorAdvancePastEOF));
252 return QStringLiteral(
"Read past end of buffer (more bytes needed)");
253 case InputOutputError:
254 static_assert(
int(InputOutputError) ==
int(CborErrorIO));
255 return QStringLiteral(
"Input/Output error");
257 static_assert(
int(GarbageAtEnd) ==
int(CborErrorGarbageAtEnd));
258 return QStringLiteral(
"Data found after the end of the stream");
260 static_assert(
int(EndOfFile) ==
int(CborErrorUnexpectedEOF));
261 return QStringLiteral(
"Unexpected end of input data (more bytes needed)");
262 case UnexpectedBreak:
263 static_assert(
int(UnexpectedBreak) ==
int(CborErrorUnexpectedBreak));
264 return QStringLiteral(
"Invalid CBOR stream: unexpected 'break' byte");
266 static_assert(
int(UnknownType) ==
int(CborErrorUnknownType));
267 return QStringLiteral(
"Invalid CBOR stream: unknown type");
269 static_assert(
int(IllegalType) ==
int(CborErrorIllegalType));
270 return QStringLiteral(
"Invalid CBOR stream: illegal type found");
272 static_assert(
int(IllegalNumber) ==
int(CborErrorIllegalNumber));
273 return QStringLiteral(
"Invalid CBOR stream: illegal number encoding (future extension)");
274 case IllegalSimpleType:
275 static_assert(
int(IllegalSimpleType) ==
int(CborErrorIllegalSimpleType));
276 return QStringLiteral(
"Invalid CBOR stream: illegal simple type");
277 case InvalidUtf8String:
278 static_assert(
int(InvalidUtf8String) ==
int(CborErrorInvalidUtf8TextString));
279 return QStringLiteral(
"Invalid CBOR stream: invalid UTF-8 text string");
281 static_assert(
int(DataTooLarge) ==
int(CborErrorDataTooLarge));
282 return QStringLiteral(
"Internal limitation: data set too large");
284 static_assert(
int(NestingTooDeep) ==
int(CborErrorNestingTooDeep));
285 return QStringLiteral(
"Internal limitation: data nesting too deep");
286 case UnsupportedType:
287 static_assert(
int(UnsupportedType) ==
int(CborErrorUnsupportedType));
288 return QStringLiteral(
"Internal limitation: unsupported type");
292 CborError err = CborError(
int(c));
293 return QString::fromLatin1(cbor_error_string(err));