8 #include "QXmppError.h" 9 #include "QXmppGlobal.h" 10 #include "QXmppHash.h" 16 #include <QCryptographicHash> 24 struct HashingResult {
25 using Result = std::variant<std::vector<QXmppHash>, Cancelled,
QXmppError>;
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:17
Definition: QXmppError.h:17
Definition: QXmppHash.h:36
Definition: Algorithms.h:12