jid.h

00001 /*
00002   Copyright (c) 2005-2006 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 
00014 
00015 #ifndef JID_H__
00016 #define JID_H__
00017 
00018 #include "macros.h"
00019 
00020 #include <string>
00021 
00022 namespace gloox
00023 {
00030   class GLOOX_API JID
00031   {
00032     public:
00033 
00037       JID();
00038 
00043       JID( const std::string& jid );
00044 
00048       virtual ~JID();
00049 
00054       void setJID( const std::string& jid );
00055 
00060       std::string full() const;
00061 
00066       std::string bare() const;
00067 
00072       void setUsername( const std::string& username );
00073 
00078       void setServer( const std::string& server );
00079 
00084       void setResource( const std::string& resource );
00085 
00090       std::string username() const { return m_username; };
00091 
00096       std::string server() const { return m_server; };
00097 
00102       std::string serverRaw() const { return m_serverRaw; };
00103 
00108       std::string resource() const { return m_resource; };
00109 
00114       bool empty() const { return m_server.empty(); };
00115 
00120       int operator==( const JID& right ) const;
00121 
00126       int operator!=( const JID& right ) const;
00127 
00128     private:
00129       std::string m_resource;
00130       std::string m_username;
00131       std::string m_server;
00132       std::string m_serverRaw;
00133   };
00134 
00135 }
00136 
00137 #endif // JID_H__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1