QXmppUri Class
Represents an XMPP URI as defined in XEP-0147: XMPP URI Scheme Query Components. More...
| Header: | #include <QXmppUri.h> |
| Since: | QXmpp 1.8 |
Public Functions
| QXmppUri() | |
| QString | jid() const |
| std::any | query() const |
| void | resetQuery() |
| void | setJid(const QString &jid) |
| void | setQuery(QXmpp::Uri::Command &&q) |
| void | setQuery(QXmpp::Uri::CustomQuery &&q) |
| void | setQuery(QXmpp::Uri::Invite &&q) |
| void | setQuery(QXmpp::Uri::Join &&q) |
| void | setQuery(QXmpp::Uri::Login &&q) |
| void | setQuery(QXmpp::Uri::Message &&q) |
| void | setQuery(QXmpp::Uri::Register &&q) |
| void | setQuery(QXmpp::Uri::Remove &&q) |
| void | setQuery(QXmpp::Uri::Roster &&q) |
| void | setQuery(QXmpp::Uri::Subscribe &&q) |
| void | setQuery(QXmpp::Uri::TrustMessage &&q) |
| void | setQuery(QXmpp::Uri::Unregister &&q) |
| QString | toString() |
Static Public Members
| std::variant<QXmppUri, QXmppError> | fromString(const QString &input) |
Detailed Description
This class represents an XMPP URI as specified by RFC 5122 - Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP) and XEP-0147: XMPP URI Scheme Query Components.
A QUrlQuery is used by this class to represent a query (component) of an XMPP URI. A query conisists of query items which can be the query type or a key-value pair.
A query type is used to perform an action while the key-value pairs are used to define its behavior.
Example: xmpp:alice@example.org?message;subject=Hello;body=world
query (component): message;subject=Hello;body=world query items: message, subject=Hello, body=world query type: message key-value pair 1: subject=Hello key-value pair 2: body=world
Member Function Documentation
QXmppUri::QXmppUri()
Creates an empty XMPP URI
[static] std::variant<QXmppUri, QXmppError> QXmppUri::fromString(const QString &input)
Parses an XMPP URI from the string input.
Returns the parsed URI or an error if the string could not be parsed. Returns true on success.
QString QXmppUri::jid() const
Returns the JID this URI is about.
This can also be e.g. a MUC room in case of a Join action.
See also setJid().
std::any QXmppUri::query() const
Returns the query of the URI.
It may be empty (has_value() returns false). Possible URI types are available in the namespace QXmpp::Uri.
See also setQuery().
void QXmppUri::resetQuery()
Removes any query from the URI.
void QXmppUri::setJid(const QString &jid)
Sets the JID this URI links to.
jid.
See also jid().
void QXmppUri::setQuery(QXmpp::Uri::Command &&q)
Sets a "command" query.
q.
See also query().
void QXmppUri::setQuery(QXmpp::Uri::CustomQuery &&q)
Sets a query with custom name and key-value pairs.
void QXmppUri::setQuery(QXmpp::Uri::Invite &&q)
Sets a MUC invite query.
void QXmppUri::setQuery(QXmpp::Uri::Join &&q)
Sets a MUC join query.
void QXmppUri::setQuery(QXmpp::Uri::Login &&q)
Sets a login query.
void QXmppUri::setQuery(QXmpp::Uri::Message &&q)
Sets a message query.
void QXmppUri::setQuery(QXmpp::Uri::Register &&q)
Sets a register query.
void QXmppUri::setQuery(QXmpp::Uri::Remove &&q)
Sets a remove query.
void QXmppUri::setQuery(QXmpp::Uri::Roster &&q)
Sets a roster query.
void QXmppUri::setQuery(QXmpp::Uri::Subscribe &&q)
Sets a subscribe query.
void QXmppUri::setQuery(QXmpp::Uri::TrustMessage &&q)
Sets a trust message query.
void QXmppUri::setQuery(QXmpp::Uri::Unregister &&q)
Sets a unregister query.
QString QXmppUri::toString()
Serializes the URI to a string.