The QXmppUtils class contains static utility functions.
More...
#include <QXmppUtils.h>
The QXmppUtils class contains static utility functions.
◆ datetimeFromString()
QDateTime QXmppUtils::datetimeFromString |
( |
QStringView |
str | ) |
|
|
static |
◆ datetimeToString()
QString QXmppUtils::datetimeToString |
( |
const QDateTime & |
dt | ) |
|
|
static |
Serializes a date-time to a string according to XEP-0082: XMPP Date and Time Profiles.
◆ generateRandomBytes()
QByteArray QXmppUtils::generateRandomBytes |
( |
int |
length | ) |
|
|
static |
Returns a random byte array of the specified size.
- Parameters
-
◆ generateRandomInteger()
int QXmppUtils::generateRandomInteger |
( |
int |
N | ) |
|
|
static |
Generates a random integer x between 0 and N-1.
- Parameters
-
◆ generateStanzaHash()
QString QXmppUtils::generateStanzaHash |
( |
int |
length = 36 | ) |
|
|
static |
Returns a random alphanumerical string of the specified size.
Since QXmpp 1.3 this will generate a UUID, if the specified length
is 36 which is also the new default value. The returned string is still 36 characters long, but will contain dashes (as specified in the UUID format).
- Note
- It is recommended to use UUIDs for cases where IDs must be unique and are possibly stored permanently. This can be done using QXmppUtils::generateStanzaUuid(). However, since that function is only available since QXmpp 1.3, you may also want to continue to use this function because of compatibility reasons.
- Parameters
-
◆ generateStanzaUuid()
QString QXmppUtils::generateStanzaUuid |
( |
| ) |
|
|
static |
Creates a new stanza id in the UUID format.
- Since
- QXmpp 1.3
◆ timezoneOffsetFromString()
int QXmppUtils::timezoneOffsetFromString |
( |
const QString & |
str | ) |
|
|
static |
Parses a timezone offset (in seconds) from a string according to XEP-0082: XMPP Date and Time Profiles.
◆ timezoneOffsetToString()
QString QXmppUtils::timezoneOffsetToString |
( |
int |
secs | ) |
|
|
static |
Serializes a timezone offset (in seconds) to a string according to XEP-0082: XMPP Date and Time Profiles.
The documentation for this class was generated from the following files: