25 m_bare = m_full = m_server = m_username = m_serverRaw = m_resource =
EmptyString;
30 const std::string::size_type at = jid.find(
'@' );
31 const std::string::size_type slash = jid.find(
'/', at == std::string::npos ? 0 : at );
33 if( at != std::string::npos && !( m_valid =
prep::nodeprep( jid.substr( 0, at ), m_username ) ) )
36 m_serverRaw = jid.substr( at == std::string::npos ? 0 : at + 1, slash - at - 1 );
40 if( slash != std::string::npos
74 if( !m_resource.empty() )
75 m_full +=
'/' + m_resource;
80 if( !m_username.empty() )
81 m_bare = m_username +
'@';
89 std::string escaped = node;
107 std::string unescaped = node;
void replaceAll(std::string &target, const std::string &find, const std::string &replace)
bool setServer(const std::string &server)
bool setResource(const std::string &resource)
bool nameprep(const std::string &domain, std::string &out)
bool setJID(const std::string &jid)
const std::string & bare() const
The namespace for the gloox library.
bool setUsername(const std::string &username)
static std::string unescapeNode(const std::string &node)
bool nodeprep(const std::string &node, std::string &out)
bool resourceprep(const std::string &resource, std::string &out)
static std::string escapeNode(const std::string &node)
const std::string EmptyString