QXmpp Version: 1.10.0
|
Public Member Functions | |
QXmppBitsOfBinaryContentId () | |
QXmppBitsOfBinaryContentId (const QXmppBitsOfBinaryContentId &cid) | |
Default copy-constructor. | |
QXmppBitsOfBinaryContentId (QXmppBitsOfBinaryContentId &&) | |
Default move-constructor. | |
~QXmppBitsOfBinaryContentId () | |
Default destructor. | |
QXmppBitsOfBinaryContentId & | operator= (const QXmppBitsOfBinaryContentId &other) |
Default assignment operator. | |
QXmppBitsOfBinaryContentId & | operator= (QXmppBitsOfBinaryContentId &&) |
Default move-assignment operator. | |
QString | toContentId () const |
QString | toCidUrl () const |
QByteArray | hash () const |
void | setHash (const QByteArray &hash) |
QCryptographicHash::Algorithm | algorithm () const |
void | setAlgorithm (QCryptographicHash::Algorithm algo) |
bool | isValid () const |
bool | operator== (const QXmppBitsOfBinaryContentId &other) const |
Static Public Member Functions | |
static QXmppBitsOfBinaryContentId | fromCidUrl (const QString &input) |
static QXmppBitsOfBinaryContentId | fromContentId (const QString &input) |
static bool | isBitsOfBinaryContentId (const QString &uri, bool checkIsCidUrl=false) |
QXmppBitsOfBinaryContentId represents a link to or an identifier of XEP-0231: Bits of Binary data.
Currently supported hash algorithms:
QXmppBitsOfBinaryContentId::QXmppBitsOfBinaryContentId | ( | ) |
Default contructor
QCryptographicHash::Algorithm QXmppBitsOfBinaryContentId::algorithm | ( | ) | const |
Returns the hash algorithm used to calculate the hash
value
The default value is QCryptographicHash::Sha1
.
|
static |
Parses a QXmppBitsOfBinaryContentId
from a XEP-0231: Bits of Binary cid:
URL
In case parsing failed, the returned QXmppBitsOfBinaryContentId
is empty.
|
static |
Parses a QXmppBitsOfBinaryContentId
from a XEP-0231: Bits of Binary content id
In case parsing failed, the returned QXmppBitsOfBinaryContentId
is empty.
cid:
URLs to be passed. Use QXmppBitsOfBinaryContentId::fromCidUrl
for that purpose.QByteArray QXmppBitsOfBinaryContentId::hash | ( | ) | const |
Returns the hash value in binary form
|
static |
Checks whether input
is a Bits of Binary content id or cid:
URL
input | The string to be checked. |
checkIsCidUrl | If true, it only accepts cid: URLs. |
input
is valid. bool QXmppBitsOfBinaryContentId::isValid | ( | ) | const |
Checks whether the content id is valid and can be serialized into a string.
Also checks the length of the hash.
bool QXmppBitsOfBinaryContentId::operator== | ( | const QXmppBitsOfBinaryContentId & | other | ) | const |
Returns true, if two QXmppBitsOfBinaryContentId
equal
void QXmppBitsOfBinaryContentId::setAlgorithm | ( | QCryptographicHash::Algorithm | algo | ) |
Sets the hash algorithm used to calculate the hash
value
The default value is QCryptographicHash::Sha1
.
void QXmppBitsOfBinaryContentId::setHash | ( | const QByteArray & | hash | ) |
Sets the hash value in binary form
QString QXmppBitsOfBinaryContentId::toCidUrl | ( | ) | const |
Returns a XEP-0231: Bits of Binary cid:
URL
QString QXmppBitsOfBinaryContentId::toContentId | ( | ) | const |
Returns a XEP-0231: Bits of Binary content id