gloox  1.0.28
Functions
gloox::prep Namespace Reference

Functions

bool nodeprep (const std::string &node, std::string &out)
 
bool nameprep (const std::string &domain, std::string &out)
 
bool resourceprep (const std::string &resource, std::string &out)
 
bool saslprep (const std::string &input, std::string &out)
 
bool idna (const std::string &domain, std::string &out)
 

Detailed Description

This namespace offers 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 you 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 Schröter js@ca.nosp@m.maya.nosp@m..net
Since
0.2

Function Documentation

◆ idna()

bool idna ( const std::string &  domain,
std::string &  out 
)

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

Parameters
domainThe string to convert.
outThe converted string. In case of an error this string is not touched. If LibIDN is not available the string is returned unchanged.
Returns
True if prepping was successful, false otherwise or if LibIDN is not available.

Definition at line 107 of file prep.cpp.

◆ nameprep()

bool nameprep ( const std::string &  domain,
std::string &  out 
)

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

Parameters
domainThe string to apply the profile to.
outThe prepped string. In case of an error this string is not touched. If LibIDN is not available the string is returned unchanged.
Returns
True if prepping was successful, false otherwise or if LibIDN is not available.

Definition at line 71 of file prep.cpp.

◆ nodeprep()

bool nodeprep ( const std::string &  node,
std::string &  out 
)

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

Parameters
nodeThe string to apply the profile to.
outThe prepped string. In case of an error this string is not touched. If LibIDN is not available the string is returned unchanged.
Returns
True if prepping was successful, false otherwise or if LibIDN is not available.

Definition at line 59 of file prep.cpp.

◆ resourceprep()

bool resourceprep ( const std::string &  resource,
std::string &  out 
)

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

Parameters
resourceThe string to apply the profile to.
outThe prepped string. In case of an error this string is not touched. If LibIDN is not available the string is returned unchanged.
Returns
True if prepping was successful, false otherwise or if LibIDN is not available.

Definition at line 83 of file prep.cpp.

◆ saslprep()

bool saslprep ( const std::string &  input,
std::string &  out 
)

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

Parameters
inputThe string to apply the profile to.
outThe prepped string. In case of an error this string is not touched. If LibIDN is not available the string is returned unchanged.
Returns
True if prepping was successful, false otherwise or if LibIDN is not available.

Definition at line 95 of file prep.cpp.