FromBase64Result 類

class QByteArray ::FromBase64Result

The QByteArray::FromBase64Result 類保持調用結果為 QByteArray::fromBase64Encoding . 更多...

該類在 Qt 5.15 引入。

公共函數

bool operator bool () const
const QByteArray & operator* () const

公共變量

QByteArray decoded
QByteArray::Base64DecodingStatus decodingStatus
uint qHash (const QByteArray::FromBase64Result & key , uint seed = 0)
bool operator!= (const QByteArray::FromBase64Result & lhs , const QByteArray::FromBase64Result & rhs )
bool operator== (const QByteArray::FromBase64Result & lhs , const QByteArray::FromBase64Result & rhs )

詳細描述

Objects of this class can be used to check whether the conversion was successful, and if so, retrieve the decoded QByteArray . The conversion operators defined for QByteArray::FromBase64Result make its usage straightforward:

void process(const QByteArray &);
if (auto result = QByteArray::fromBase64Encoding(encodedData))
    process(*result);
					

Alternatively, it is possible to access the conversion status and the decoded data directly:

auto result = QByteArray::fromBase64Encoding(encodedData);
if (result.decodingStatus == QByteArray::Base64DecodingStatus::Ok)
    process(result.decoded);
					

另請參閱 QByteArray::fromBase64 .

成員函數文檔編製

bool FromBase64Result:: operator bool () const

Returns whether the decoding was successful. This is equivalent to checking whether the decodingStatus member is equal to QByteArray::Base64DecodingStatus::Ok.

const QByteArray &FromBase64Result:: operator* () const

返迴解碼字節數組。

成員變量文檔編製

QByteArray FromBase64Result:: decoded

包含解碼字節數組。

QByteArray::Base64DecodingStatus FromBase64Result:: decodingStatus

Contains whether the decoding was successful, expressed as a value of type QByteArray::Base64DecodingStatus.

相關非成員

uint qHash (const QByteArray::FromBase64Result & key , uint seed = 0)

返迴哈希值為 key ,使用 seed 做計算種子。

bool operator!= (const QByteArray::FromBase64Result & lhs , const QByteArray::FromBase64Result & rhs )

返迴 true if lhs and rhs 不同,否則返迴 false .

bool operator== (const QByteArray::FromBase64Result & lhs , const QByteArray::FromBase64Result & rhs )

返迴 true if lhs and rhs 相等,否則返迴 false .

lhs and rhs are equal if and only if they contain the same decoding status and, if the status is QByteArray::Base64DecodingStatus::Ok, if and only if they contain the same decoded data.