QXmppUtils Class Reference

The QXmppUtils class contains static utility functions. More...

`#include <QXmppUtils.h>`

## Static Public Member Functions

static QDateTime | datetimeFromString (const QString &str)
static QString | datetimeToString (const QDateTime &dt)
static int | timezoneOffsetFromString (const QString &str)
static QString | timezoneOffsetToString (int secs)
static QString | jidToDomain (const QString &jid)
| Returns the domain for the given jid.
static QString | jidToResource (const QString &jid)
| Returns the resource for the given jid.
static QString | jidToUser (const QString &jid)
| Returns the user for the given jid.
static QString | jidToBareJid (const QString &jid)
| Returns the bare jid (i.e. without resource) for the given jid.
static quint32 | generateCrc32 (const QByteArray &input)
| Calculates the CRC32 checksum for the given input.
static QByteArray | generateHmacMd5 (const QByteArray &key, const QByteArray &text)
| Generates the MD5 HMAC for the given key and text.
static QByteArray | generateHmacSha1 (const QByteArray &key, const QByteArray &text)
| Generates the SHA1 HMAC for the given key and text.
static int | generateRandomInteger (int N)
static QByteArray | generateRandomBytes (int length)
static QString | generateStanzaHash (int length=32)

## Detailed Description

The QXmppUtils class contains static utility functions.

## Member Function Documentation

## datetimeFromString()

QDateTime QXmppUtils::datetimeFromString | ( | const QString & | str | ) |

static

Parses a date-time from a string according to XEP-0082: XMPP Date and Time Profiles.

## 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

  length |

## generateRandomInteger()

int QXmppUtils::generateRandomInteger | ( | int | N | ) |

static

Generates a random integer x between 0 and N-1.

Parameters

  N |

## generateStanzaHash()

QString QXmppUtils::generateStanzaHash | ( | int | length = `32` | ) |

static

Returns a random alphanumerical string of the specified size.

Parameters

  length |

## 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:

- QXmppUtils.h
- QXmppUtils.cpp