Prep Class Reference

This class offers static functions to stringprep the individual parts of a JID. More...

#include <prep.h>

List of all members.

Static Public Member Functions

static std::string nodeprep (const std::string &node)
static std::string nameprep (const std::string &domain)
static std::string resourceprep (const std::string &resource)
static std::string idna (const std::string &domain)


Detailed Description

This class offers static functions to stringprep the individual parts of a JID.

You should not need to use these functions directly. All the necessary prepping is done for if you stick to the interfaces provided. If you write your own enhancements, check with the spec.

Note:
These functions depend on an installed LibIDN at compile time of gloox. If LibIDN is not installed these functions return the string they are given without any modification.
Author:
Jakob Schroeter <js@camaya.net>
Since:
0.2

Definition at line 38 of file prep.h.


Member Function Documentation

std::string nodeprep ( const std::string &  node  )  [static]

This function applies the Nodeprep profile of Stringprep to a string.

Parameters:
node The string to apply the profile to.
Returns:
Returns the prepped string. In case of an error an empty string is returned. If LibIDN is not available the string is returned unchanged.

Definition at line 35 of file prep.cpp.

Referenced by Registration::createAccount(), JID::setJID(), and JID::setUsername().

std::string nameprep ( const std::string &  domain  )  [static]

This function applies the Nameprep profile of Stringprep to a string.

Parameters:
domain The string to apply the profile to.
Returns:
Returns the prepped string. In case of an error an empty string is returned. If LibIDN is not available the string is returned unchanged.

Definition at line 67 of file prep.cpp.

Referenced by JID::setJID(), and JID::setServer().

std::string resourceprep ( const std::string &  resource  )  [static]

This function applies the Resourceprep profile of Stringprep to a std::string.

Parameters:
resource The string to apply the profile to.
Returns:
Returns the prepped string. In case of an error an empty string is returned. If LibIDN is not available the string is returned unchanged.

Definition at line 99 of file prep.cpp.

Referenced by JID::setJID(), and JID::setResource().

std::string idna ( const std::string &  domain  )  [static]

This function applies the idna() function to a string. I.e. it transform internationalized domain names into plain ASCII.

Parameters:
domain The string to convert.
Returns:
Returns the converted string. In case of an error an empty string is returned. If LibIDN is not available the string is returned unchanged.

Definition at line 131 of file prep.cpp.


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