FromBase64Result Class▲
-
Header: FromBase64Result
-
Since: Qt 5.15
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
-
qmake: QT += core
-
Group: FromBase64Result is part of tools
Detailed Description▲
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 &
amp;);
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);
See Also▲
See also QByteArray::fromBase64
Member Function Documentation▲
[explicit] 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▲
Returns the decoded byte array.
Member Variable Documentation▲
QByteArray FromBase64Result::decoded▲
Contains the decoded byte array.
QByteArray::Base64DecodingStatus FromBase64Result::decodingStatus▲
Contains whether the decoding was successful, expressed as a value of type QByteArray::Base64DecodingStatus.
Related Non-Members▲
size_t qHash(const QByteArray::FromBase64Result &key, size_t seed = 0)▲
Returns the hash value for key, using seed to seed the calculation.
bool operator!=(const FromBase64Result &lhs, const FromBase64Result &rhs)▲
Returns true if lhs and rhs are different, otherwise returns false.
bool operator==(const FromBase64Result &lhs, const FromBase64Result &rhs)▲
Returns true if lhs and rhs are equal, otherwise returns 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.