Yate
Public Member Functions | Static Public Member Functions | Static Public Attributes

JabberID Class Reference

A Jabber ID. More...

#include <xmpputils.h>

Inheritance diagram for JabberID:
String GenObject

List of all members.

Public Member Functions

 JabberID ()
 JabberID (const char *jid)
 JabberID (const char *node, const char *domain, const char *resource=0)
const Stringnode () const
const Stringbare () const
const Stringdomain () const
void domain (const char *d)
const Stringresource () const
bool isFull () const
bool match (const JabberID &src) const
bool operator== (const JabberID &src) const
bool operator== (const String &src) const
bool operator!= (const JabberID &src) const
bool operator!= (const String &src) const
void resource (const char *res)
void set (const char *jid)
void set (const char *node, const char *domain, const char *resource=0)

Static Public Member Functions

static bool valid (const String &value)

Static Public Attributes

static Regexp s_regExpValid

Detailed Description

A Jabber ID.

This class holds a Jabber ID in form "node@domain/resource" or "node@domain"


Constructor & Destructor Documentation

JabberID ( ) [inline]

Constructor

JabberID ( const char *  jid) [inline]

Constructor. Constructs a JID from a given string

Parameters:
jidThe JID string
JabberID ( const char *  node,
const char *  domain,
const char *  resource = 0 
) [inline]

Constructor. Constructs a JID from user, domain, resource

Parameters:
nodeThe node
domainThe domain
resourceThe resource

Member Function Documentation

const String& bare ( ) const [inline]

Get the bare JID: "node@domain"

Returns:
The bare JID

Referenced by JabberID::match(), and JabberID::operator==().

void domain ( const char *  d) [inline]

Set the domain part of the JID.

Parameters:
dThe new domain part of the JID.
const String& domain ( ) const [inline]

Get the domain part of the JID

Returns:
The domain part of the JID
bool isFull ( ) const [inline]

Check if this is a full JID

Returns:
True if this is a full JID
bool match ( const JabberID src) const [inline]

Try to match another JID to this one. If src has a resource compare it too (case sensitive). Otherwise compare just the bare JID (case insensitive)

Parameters:
srcThe JID to match
Returns:
True if matched

References JabberID::bare(), String::null(), and JabberID::resource().

const String& node ( ) const [inline]

Get the node part of the JID

Returns:
The node part of the JID
bool operator!= ( const String src) const [inline]

Inequality operator

Parameters:
srcThe string to compare with
Returns:
True if not equal

Reimplemented from String.

bool operator!= ( const JabberID src) const [inline]

Inequality operator

Parameters:
srcThe JID to compare with
Returns:
True if not equal
bool operator== ( const String src) const [inline]

Equality operator. Build a temporary JID and compare with it

Parameters:
srcThe string to compare with
Returns:
True if equal

Reimplemented from String.

References JabberID::operator==().

Referenced by JabberID::operator==().

bool operator== ( const JabberID src) const [inline]

Equality operator. Do a case senitive resource comparison and a case insensitive bare jid comparison

Parameters:
srcThe JID to compare with
Returns:
True if equal

References JabberID::bare(), and JabberID::resource().

const String& resource ( ) const [inline]

Get the resource part of the JID

Returns:
The resource part of the JID

Referenced by JabberID::match(), and JabberID::operator==().

void resource ( const char *  res) [inline]

Set the resource part of the JID

Parameters:
resThe new resource part of the JID
void set ( const char *  node,
const char *  domain,
const char *  resource = 0 
)

Set the data

Parameters:
nodeThe node
domainThe domain
resourceThe resource
void set ( const char *  jid)

Set the data

Parameters:
jidThe JID string to assign
static bool valid ( const String value) [static]

Check if the given string contains valid characters

Parameters:
valueThe string to check
Returns:
True if value is valid or 0. False if value is a non empty invalid string

Member Data Documentation

Keep the regexp used to check the validity of a string


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