QByteArray::FromBase64Result Class
class QByteArray::FromBase64ResultQByteArray::FromBase64Result 类保存调用QByteArray::fromBase64Encoding 的结果。更多
公共函数
bool | operator bool() const |
const QByteArray & | operator*() const |
公共变量
QByteArray | decoded |
QByteArray::Base64DecodingStatus | decodingStatus |
相关非成员
size_t | qHash(const QByteArray::FromBase64Result &key, size_t seed = 0) |
bool | operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) |
bool | operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) |
详细描述
该类对象可用于检查转换是否成功,如果成功,则检索解码后的QByteArray 。为QByteArray::FromBase64Result 定义的转换运算符使其使用简单明了:
void process(const QByteArray &); if (auto result = QByteArray::fromBase64Encoding(encodedData)) process(*result);
此外,还可以直接访问转换状态和解码数据:
auto result = QByteArray::fromBase64Encoding(encodedData); if (result.decodingStatus == QByteArray::Base64DecodingStatus::Ok) process(result.decoded);
另请参阅 QByteArray::fromBase64 。
成员函数文档
[explicit noexcept]
bool FromBase64Result::operator bool() const
返回解码是否成功。这等同于检查decodingStatus
成员是否等于 QByteArray::Base64DecodingStatus::Ok。
[noexcept]
const QByteArray &FromBase64Result::operator*() const
返回解码后的字节数组。
成员变量文档
QByteArray FromBase64Result::decoded
包含解码后的字节数组。
QByteArray::Base64DecodingStatus FromBase64Result::decodingStatus
包含解码是否成功,以 QByteArray::Base64DecodingStatus 类型的值表示。
相关非成员
[noexcept]
size_t qHash(const QByteArray::FromBase64Result &key, size_t seed = 0)
返回key 的哈希值,使用seed 作为计算的种子。
[noexcept]
bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs)
如果lhs 和rhs 不同,则返回true
,否则返回false
。
[noexcept]
bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs)
如果lhs 和rhs 相等,则返回true
,否则返回false
。
lhs 只有当 和 包含相同的解码状态时,它们才相等;如果状态为 QByteArray::Base64DecodingStatus::Ok,则只有当它们包含相同的解码数据时,它们才相等。rhs
© 2025 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.