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)


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.

References JID::setJID().

~JID  )  [virtual]
 

Virtual destructor.

Definition at line 30 of file jid.cpp.


Member Function Documentation

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(), RosterManager::handlePresence(), RosterManager::handleSubscription(), RosterManager::RosterManager(), and RosterManager::unsubscribe().

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 Stanza::createPresenceStanza().

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 Stanza::createMessageStanza(), Stanza::createPresenceStanza(), Stanza::createSubscriptionStanza(), Disco::getDiscoInfo(), Disco::getDiscoItems(), LastActivity::handleIq(), Disco::handleIq(), LastActivity::query(), Registration::removeAccount(), and RosterManager::subscribe().

int operator== const JID right  ) 
 

Compares two JIDs.

Parameters:
right The second JID.

Definition at line 111 of file jid.cpp.

References JID::m_resource, JID::m_server, and JID::m_username.

std::string resource  )  const [inline]
 

Returns the prepped resource.

Returns:
The current resource.

Definition at line 108 of file jid.h.

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(), and ClientBase::header().

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

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.

References Prep::nameprep(), Prep::nodeprep(), and Prep::resourceprep().

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

void setResource const std::string &  resource  ) 
 

Sets the resource.

Parameters:
resource The new resource.

Definition at line 80 of file jid.cpp.

References Prep::resourceprep().

Referenced by Client::Client().

void setServer const std::string &  server  ) 
 

Sets the server.

Parameters:
server The new server.

Definition at line 74 of file jid.cpp.

References Prep::nameprep().

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

void setUsername const std::string &  username  ) 
 

Sets the username.

Parameters:
username The new username.

Definition at line 69 of file jid.cpp.

References Prep::nodeprep().

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 ClientBase::startSASL().


The documentation for this class was generated from the following files:
Generated on Mon Jan 16 16:19:58 2006 for gloox by  doxygen 1.4.6