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 String &jid)
 JabberID (const String *jid)
 JabberID (const char *node, const char *domain, const char *resource=0)
 JabberID (const JabberID &src)
bool valid () const
const Stringnode () const
const Stringbare () const
const Stringdomain () const
void domain (const char *d)
const Stringresource () const
bool isFull () const
void clear ()
bool match (const JabberID &src) const
JabberIDoperator= (const JabberID &src)
JabberIDoperator= (const String &src)
JabberIDoperator= (const String *src)
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 const JabberIDempty ()
static bool valid (const String &value)

Static Public Attributes

static Regexp s_regExpValid

Detailed Description

A Jabber ID.

This class holds a Jabber ID


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 String jid) [inline]

Constructor. Constructs a JID from a given string

Parameters:
jidThe JID string
JabberID ( const String jid) [inline]

Constructor. Constructs a JID from a given string

Parameters:
jidThe JID string

References TelEngine::c_safe().

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
JabberID ( const JabberID src) [inline]

Copy constructor

Parameters:
srcSource Jabber ID

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 clear ( ) [inline]

Clear content

Reimplemented from String.

References String::clear().

const String& domain ( ) const [inline]

Get the domain part of the JID

Returns:
The domain part of the JID
void domain ( const char *  d) [inline]

Set the domain part of the JID.

Parameters:
dThe new domain part of the JID.
static const JabberID& empty ( ) [static]

Get an empty JabberID

Returns:
A global empty JabberID

Reimplemented from String.

Referenced by JBEngine::setExiting().

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 JabberID src) const [inline]

Inequality operator

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

Inequality operator

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

Reimplemented from String.

JabberID& operator= ( const JabberID src)

Assignement operator from JabberID

Parameters:
srcThe JID to copy from
Returns:
This object
JabberID& operator= ( const String src) [inline]

Assignement operator from String

Parameters:
srcThe string
Returns:
This object

Reimplemented from String.

JabberID& operator= ( const String src) [inline]

Assignement operator from String pointer

Parameters:
srcThe string
Returns:
This object

Reimplemented from String.

References TelEngine::c_safe().

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().

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==().

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 *  jid)

Set the data

Parameters:
jidThe JID string to assign

Referenced by JBStream::setLocal().

void set ( const char *  node,
const char *  domain,
const char *  resource = 0 
)

Set the data

Parameters:
nodeThe node
domainThe domain
resourceThe resource
bool valid ( ) const [inline]

Check if this is a valid JID

Returns:
True if this JID is a valid one

References TelEngine::null().

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: