QXmpp  Version: 1.5.5
QXmppBitsOfBinaryContentId.h
1 // SPDX-FileCopyrightText: 2019 Linus Jahn <lnj@kaidan.im>
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 
5 #ifndef QXMPPBITSOFBINARYCONTENTID_H
6 #define QXMPPBITSOFBINARYCONTENTID_H
7 
8 #include "QXmppGlobal.h"
9 
10 #include <QCryptographicHash>
11 #include <QSharedDataPointer>
12 
13 class QXmppBitsOfBinaryContentIdPrivate;
14 
15 class QXMPP_EXPORT QXmppBitsOfBinaryContentId
16 {
17 public:
18  static QXmppBitsOfBinaryContentId fromCidUrl(const QString &input);
19  static QXmppBitsOfBinaryContentId fromContentId(const QString &input);
20 
25 
28 
29  QString toContentId() const;
30  QString toCidUrl() const;
31 
32  QByteArray hash() const;
33  void setHash(const QByteArray &hash);
34 
35  QCryptographicHash::Algorithm algorithm() const;
36  void setAlgorithm(QCryptographicHash::Algorithm algo);
37 
38  bool isValid() const;
39 
40  static bool isBitsOfBinaryContentId(const QString &uri, bool checkIsCidUrl = false);
41 
42  bool operator==(const QXmppBitsOfBinaryContentId &other) const;
43 
44 private:
45  QSharedDataPointer<QXmppBitsOfBinaryContentIdPrivate> d;
46 };
47 
48 #endif // QXMPPBITSOFBINARYCONTENTID_H
Definition: QXmppBitsOfBinaryContentId.h:16
QXmppBitsOfBinaryContentId & operator=(const QXmppBitsOfBinaryContentId &other)
Default assignment operator.
~QXmppBitsOfBinaryContentId()
Default destructor.
QXmppBitsOfBinaryContentId(const QXmppBitsOfBinaryContentId &cid)
Default copy-constructor.
QXmppBitsOfBinaryContentId & operator=(QXmppBitsOfBinaryContentId &&)
Default move-assignment operator.
QXmppBitsOfBinaryContentId(QXmppBitsOfBinaryContentId &&)
Default move-constructor.