Files
biboumi/louloulibs/xmpp/jid.hpp
T
louiz’ af42073830 Style fix
Move all constructors at the top of classes
2016-05-04 14:16:40 +02:00

45 lines
1011 B
C++

#ifndef JID_INCLUDED
# define JID_INCLUDED
#include <string>
/**
* Parse a JID into its different subart
*/
class Jid
{
public:
explicit Jid(const std::string& jid);
Jid(const Jid&) = delete;
Jid(Jid&&) = delete;
Jid& operator=(const Jid&) = delete;
Jid& operator=(Jid&&) = delete;
std::string domain;
std::string local;
std::string resource;
std::string bare() const
{
return this->local + "@" + this->domain;
}
std::string full() const
{
return this->local + "@" + this->domain + "/" + this->resource;
}
};
/**
* Prepare the given UTF-8 string according to the XMPP node stringprep
* identifier profile. This is used to send properly-formed JID to the XMPP
* server.
*
* If the stringprep library is not found, we return an empty string. When
* this function is used, the result must always be checked for an empty
* value, and if this is the case it must not be used as a JID.
*/
std::string jidprep(const std::string& original);
#endif // JID_INCLUDED