本页内容

QCborParserError Struct

QCborValue 使用 QCborParserError 来报告解析错误。更多内容...

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

注意:该结构体中的所有函数均为可重入函数。

公共函数

QString errorString() const

公共变量

QCborError error
qint64 offset

详细描述

QCborValue::fromCbor (const QByteArray &ba, QCborParserError *error)使用此类来报告解析器错误以及检测到错误的字节偏移量。

另请参阅 QCborValue 和QCborError 。

成员函数文档

QString QCborParserError::errorString() const

返回错误代码的字符串表示形式。该字符串不会被翻译。

另请参阅 QCborError::toString() 和QCborValue::fromCbor()。

成员变量文档

QCborError QCborParserError::error

该字段包含错误代码,用于指示检测到的解码问题。

另请参阅 QCborValue::fromCbor()。

qint64 QCborParserError::offset

该字段包含从数据开头算起的、检测到错误的位置偏移量。该偏移量应指向包含错误的项的开头,即使错误本身位于其他位置(例如,UTF-8解码问题)。

另请参阅 QCborValue::fromCbor()。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.