8 #include "QXmppError.h" 9 #include "QXmppGlobal.h" 10 #include "QXmppHash.h" 16 #include <QCryptographicHash> 24 struct HashingResult {
27 HashingResult(Result result, std::unique_ptr<QIODevice> data)
28 : result(
std::move(result)), data(
std::move(data))
33 std::unique_ptr<QIODevice> data;
36 struct HashVerificationResult {
37 struct NoStrongHashes { };
38 struct NotMatching { };
40 using Result = std::variant<NoStrongHashes, NotMatching, Verified, Cancelled, QXmppError>;
42 HashVerificationResult(Result result, std::unique_ptr<QIODevice> data)
43 : result(
std::move(result)), data(
std::move(data))
48 std::unique_ptr<QIODevice> data;
51 using HashingResultPtr = std::shared_ptr<HashingResult>;
52 using HashVerificationResultPtr = std::shared_ptr<HashVerificationResult>;
58 QXMPP_EXPORT QFuture<HashingResultPtr> calculateHashes(std::unique_ptr<QIODevice> data, std::vector<HashAlgorithm> hashes);
59 QFuture<HashVerificationResultPtr> verifyHashes(std::unique_ptr<QIODevice> data, std::vector<QXmppHash> hashes);
63 #endif // QXMPPHASHING_H HashAlgorithm
Definition: QXmppHash.h:20
Definition: QXmppError.h:17
Definition: QXmppHash.h:39
Definition: QXmppTask.h:646
Definition: Algorithms.h:14
std::variant< T, QXmppError > Result
Definition: QXmppGlobal.h:209