jabberd14 1.6.2
Public Member Functions | Static Public Member Functions
xmppd::preparation_cache Class Reference
Inheritance diagram for xmppd::preparation_cache:
xmppd::xhash< std::pair< Glib::ustring, time_t > >

Public Member Functions

 preparation_cache (const ::Stringprep_profile *profile)
Glib::ustring get_prepped (const Glib::ustring &original)
void clean_cache ()

Static Public Member Functions

static Glib::ustring prepare_node (const Glib::ustring &original)
static Glib::ustring prepare_domain (const Glib::ustring &original)
static Glib::ustring prepare_resource (const Glib::ustring &original)

Detailed Description

The preparation_cache class caches string prep results and is used to speed up preparation of jabberid address parts

The parent class xhash uses the original string as keys and the value is a pair of the prepared string (empty string if prepared string equals the original string) and the the time when the cache entry has been last used.


Constructor & Destructor Documentation

xmppd::preparation_cache::preparation_cache ( const ::Stringprep_profile *  profile)

create a new string prep cache instance

Parameters:
profilethe stringprep profile to use (stringprep_xmpp_nodeprep, stringprep_nameprep, or stringprep_xmpp_resourceprep)

Member Function Documentation

void xmppd::preparation_cache::clean_cache ( )

clean the preparation cache

Referenced by get_prepped().

Glib::ustring xmppd::preparation_cache::get_prepped ( const Glib::ustring &  original)

get the prepared version of the original string

Parameters:
originalthe string to prepare
Returns:
the prepared string
Exceptions:
std::invalid_argumentif the string cannot be prepared

References clean_cache().

Referenced by prepare_domain(), prepare_node(), and prepare_resource().

Glib::ustring xmppd::preparation_cache::prepare_domain ( const Glib::ustring &  original) [static]

prepare a domain

Parameters:
originalthe string to prepare as a domain
Returns:
the prepared string
Exceptions:
std::invalid_argumentif domain cannot be prepared

References get_prepped().

Referenced by xmppd::jabberid::set_domain().

Glib::ustring xmppd::preparation_cache::prepare_node ( const Glib::ustring &  original) [static]

prepare a node

Parameters:
originalthe string to prepare as a node
Returns:
the prepared string
Exceptions:
std::invalid_argumentif node cannot be prepared

References get_prepped().

Referenced by xmppd::jabberid::set_node().

Glib::ustring xmppd::preparation_cache::prepare_resource ( const Glib::ustring &  original) [static]

prepare a resource

Parameters:
originalthe string to prepare as a resource
Returns:
the prepared string
Exceptions:
std::invalid_argumentif the resource cannot be prepared

References get_prepped().

Referenced by xmppd::jabberid::set_resource().


The documentation for this class was generated from the following file: