QXmppBitsOfBinaryData Class

Header: #include <QXmppBitsOfBinaryData>
Since: QXmpp 1.2
Inherited By:

QXmppBitsOfBinaryIq

Public Functions

QXmppBitsOfBinaryData()
QXmppBitsOfBinaryData(const QXmppBitsOfBinaryData &)
QXmppBitsOfBinaryData(QXmppBitsOfBinaryData &&)
~QXmppBitsOfBinaryData()
QXmppBitsOfBinaryContentId cid() const
QMimeType contentType() const
QByteArray data() const
int maxAge() const
void setCid(const QXmppBitsOfBinaryContentId &cid)
void setContentType(const QMimeType &contentType)
void setData(const QByteArray &data)
void setMaxAge(int maxAge)
QXmppBitsOfBinaryData &operator=(QXmppBitsOfBinaryData &&)
QXmppBitsOfBinaryData &operator=(const QXmppBitsOfBinaryData &)
bool operator==(const QXmppBitsOfBinaryData &other) const

Static Public Members

(since QXmpp 1.5) QXmppBitsOfBinaryData fromByteArray(QByteArray data)
bool isBitsOfBinaryData(const QDomElement &element)

Detailed Description

QXmppBitsOfBinaryData represents a data element for XEP-0231: Bits of Binary. It can be used as an extension in other stanzas.

data.

See also QXmppBitsOfBinaryIq and QXmppBitsOfBinaryDataList.

Member Function Documentation

QXmppBitsOfBinaryData::QXmppBitsOfBinaryData()

Default constructor

QXmppBitsOfBinaryData::QXmppBitsOfBinaryData(const QXmppBitsOfBinaryData &)

Default copy-constructor

QXmppBitsOfBinaryData::QXmppBitsOfBinaryData(QXmppBitsOfBinaryData &&)

Default move-constructor

[noexcept] QXmppBitsOfBinaryData::~QXmppBitsOfBinaryData()

Default destructor

QXmppBitsOfBinaryContentId QXmppBitsOfBinaryData::cid() const

Returns the content id of the data

See also setCid().

QMimeType QXmppBitsOfBinaryData::contentType() const

Returns the content type of the data

Note: This is the advertised content type and may differ from the actual content type of the data.

See also setContentType().

QByteArray QXmppBitsOfBinaryData::data() const

Returns the included data in binary form

See also setData().

[static, since QXmpp 1.5] QXmppBitsOfBinaryData QXmppBitsOfBinaryData::fromByteArray(QByteArray data)

Creates bits of binary data from a QByteArray.

This hashes the data to generate a content ID. The MIME type is not set.

Note: This blocks while hashing the data. You may want to run this via QtConcurrent or a QThreadPool to run this on for large amounts of data.

data.

This function was introduced in QXmpp 1.5.

[static] bool QXmppBitsOfBinaryData::isBitsOfBinaryData(const QDomElement &element)

Returns true if element is a XEP-0231: Bits of Binary data element.

int QXmppBitsOfBinaryData::maxAge() const

Returns the time in seconds the data should be cached

A value of 0 means that the data should not be cached, while a value of -1 means that nothing was set.

The default value is -1.

See also setMaxAge().

void QXmppBitsOfBinaryData::setCid(const QXmppBitsOfBinaryContentId &cid)

Sets the content id of the data

cid.

See also cid().

void QXmppBitsOfBinaryData::setContentType(const QMimeType &contentType)

Sets the content type of the data

contentType.

See also contentType().

void QXmppBitsOfBinaryData::setData(const QByteArray &data)

Sets the data in binary form

See also data().

void QXmppBitsOfBinaryData::setMaxAge(int maxAge)

Sets the time in seconds the data should be cached

A value of 0 means that the data should not be cached, while a value of -1 means that nothing was set.

The default value is -1.

maxAge.

See also maxAge().

QXmppBitsOfBinaryData &QXmppBitsOfBinaryData::operator=(QXmppBitsOfBinaryData &&)

Default move-assignment operator

QXmppBitsOfBinaryData &QXmppBitsOfBinaryData::operator=(const QXmppBitsOfBinaryData &)

Default assignment operator

bool QXmppBitsOfBinaryData::operator==(const QXmppBitsOfBinaryData &other) const

Returns true if cid, maxAge, contentType and data of this object and other are equal.