QXmpp Version: 1.10.0
Public Member Functions | Static Public Member Functions | List of all members
QXmppUri Class Reference

Public Member Functions

 QXmppUri ()
 
QString toString ()
 
QString jid () const
 
void setJid (const QString &jid)
 
std::any query () const
 
void setQuery (QXmpp::Uri::Command &&q)
 Sets a "command" query.
 
void setQuery (QXmpp::Uri::Invite &&q)
 Sets a MUC invite query.
 
void setQuery (QXmpp::Uri::Join &&q)
 Sets a MUC join query.
 
void setQuery (QXmpp::Uri::Login &&q)
 Sets a login query.
 
void setQuery (QXmpp::Uri::Message &&q)
 Sets a message query.
 
void setQuery (QXmpp::Uri::Unregister &&q)
 Sets a unregister query.
 
void setQuery (QXmpp::Uri::Register &&q)
 Sets a register query.
 
void setQuery (QXmpp::Uri::Remove &&q)
 Sets a remove query.
 
void setQuery (QXmpp::Uri::Roster &&q)
 Sets a roster query.
 
void setQuery (QXmpp::Uri::Subscribe &&q)
 Sets a subscribe query.
 
void setQuery (QXmpp::Uri::TrustMessage &&q)
 Sets a trust message query.
 
void setQuery (QXmpp::Uri::CustomQuery &&q)
 Sets a query with custom name and key-value pairs.
 
void resetQuery ()
 Removes any query from the URI.
 

Static Public Member Functions

static std::variant< QXmppUri, QXmppErrorfromString (const QString &)
 

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.nosp@m.@exa.nosp@m.mple..nosp@m.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

Since
QXmpp 1.8

Constructor & Destructor Documentation

◆ QXmppUri()

QXmppUri::QXmppUri ( )

Creates an empty XMPP URI

Member Function Documentation

◆ fromString()

std::variant< QXmppUri, QXmppError > QXmppUri::fromString ( const QString &  input)
static

Parses an XMPP URI.

Returns
Parsed URI or an error if the string could not be parsed.

◆ jid()

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.

◆ query()

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.

◆ setJid()

void QXmppUri::setJid ( const QString &  jid)

Sets the JID this URI links to.

◆ toString()

QString QXmppUri::toString ( )

Serializes the URI to a string.


The documentation for this class was generated from the following files: