JID Class Reference

An abstraction of a JID. More...

#include <jid.h>

List of all members.

Public Member Functions

 JID ()
 JID (const std::string &jid)
virtual ~JID ()
void setJID (const std::string &jid)
std::string full () const
std::string bare () const
void setUsername (const std::string &username)
void setServer (const std::string &server)
void setResource (const std::string &resource)
std::string username () const
std::string server () const
std::string serverRaw () const
std::string resource () const
bool empty () const
int operator== (const JID &right) const
int operator!= (const JID &right) const


Detailed Description

An abstraction of a JID.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.4

Definition at line 30 of file jid.h.


Constructor & Destructor Documentation

JID (  ) 

Constructs an empty JID.

Definition at line 21 of file jid.cpp.

JID ( const std::string &  jid  ) 

Constructs a new JID from a string.

Parameters:
jid The string containing the JID.

Definition at line 25 of file jid.cpp.

~JID (  )  [virtual]

Virtual destructor.

Definition at line 30 of file jid.cpp.


Member Function Documentation

void setJID ( const std::string &  jid  ) 

Sets the JID from a string.

Parameters:
jid The string containing the JID.

Definition at line 34 of file jid.cpp.

Referenced by Search::handleIqID(), Stanza::init(), and JID::JID().

std::string full (  )  const

Returns the full (prepped) JID (user@host/resource).

Returns:
The full JID.

Definition at line 85 of file jid.cpp.

Referenced by Registration::changePassword(), Registration::createAccount(), Stanza::createIqStanza(), Stanza::createMessageStanza(), Stanza::createPresenceStanza(), Stanza::createSubscriptionStanza(), Registration::fetchRegistrationFields(), Search::fetchSearchFields(), Disco::getDiscoInfo(), Disco::getDiscoItems(), LastActivity::handleIq(), InBandBytestreamManager::handleIq(), Disco::handleIq(), MessageSession::handleMessage(), MessageSession::MessageSession(), LastActivity::query(), MessageEventFilter::raiseMessageEvent(), Registration::removeAccount(), InBandBytestreamManager::requestInBandBytestream(), Search::search(), MessageSession::send(), InBandBytestream::sendBlock(), ChatStateFilter::setChatState(), RosterManager::subscribe(), and MessageSession::~MessageSession().

std::string bare (  )  const

Returns the bare (prepped) JID (user@host).

Returns:
The bare JID.

Definition at line 101 of file jid.cpp.

Referenced by RosterManager::ackSubscriptionRequest(), VCardManager::fetchVCard(), RosterManager::getRosterItem(), MessageSession::handleMessage(), RosterManager::handlePresence(), RosterManager::handleSubscription(), RosterManager::RosterManager(), ClientBase::startSASL(), and RosterManager::unsubscribe().

void setUsername ( const std::string &  username  ) 

Sets the username.

Parameters:
username The new username.

Definition at line 69 of file jid.cpp.

Referenced by Client::Client(), and Client::setUsername().

void setServer ( const std::string &  server  ) 

Sets the server.

Parameters:
server The new server.

Definition at line 74 of file jid.cpp.

Referenced by Client::Client(), and Component::Component().

void setResource ( const std::string &  resource  ) 

Sets the resource.

Parameters:
resource The new resource.

Definition at line 80 of file jid.cpp.

Referenced by Client::Client().

std::string username (  )  const [inline]

Returns the prepped username.

Returns:
The current username.

Definition at line 90 of file jid.h.

Referenced by NonSaslAuth::handleIqID(), ClientBase::processSASLChallenge(), and ClientBase::startSASL().

std::string server (  )  const [inline]

Returns the prepped server name.

Returns:
The current server.

Definition at line 96 of file jid.h.

Referenced by FlexibleOffline::checkSupport(), NonSaslAuth::doAuth(), FlexibleOffline::fetchHeaders(), FlexibleOffline::getMsgCount(), ClientBase::header(), and ClientBase::processSASLChallenge().

std::string serverRaw (  )  const [inline]

Returns the raw (unprepped) server name.

Returns:
The raw server name.

Definition at line 102 of file jid.h.

Referenced by Client::Client().

std::string resource (  )  const [inline]

Returns the prepped resource.

Returns:
The current resource.

Definition at line 108 of file jid.h.

Referenced by NonSaslAuth::handleIqID(), MessageSession::handleMessage(), and RosterManager::handlePresence().

bool empty (  )  const [inline]

A JID is empty as long as no server is set.

Returns:
True if the JID is empty, false otherwise.

Definition at line 114 of file jid.h.

Referenced by Registration::changePassword(), Registration::createAccount(), Stanza::createPresenceStanza(), Registration::fetchRegistrationFields(), Search::fetchSearchFields(), Registration::removeAccount(), and Search::search().

int operator== ( const JID right  )  const

Compares two JIDs.

Parameters:
right The second JID.

Definition at line 111 of file jid.cpp.

int operator!= ( const JID right  )  const

Compares two JIDs.

Parameters:
right The second JID.

Definition at line 118 of file jid.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 1 14:20:24 2007 for gloox by  doxygen 1.5.1