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:
profile the stringprep profile to use (stringprep_xmpp_nodeprep, stringprep_nameprep, or stringprep_xmpp_resourceprep)


Member Function Documentation

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

get the prepared version of the original string

Parameters:
original the string to prepare
Returns:
the prepared string
Exceptions:
std::invalid_argument if the string cannot be prepared

References clean_cache().

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

void xmppd::preparation_cache::clean_cache (  ) 

clean the preparation cache

Referenced by get_prepped().

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

prepare a node

Parameters:
original the string to prepare as a node
Returns:
the prepared string
Exceptions:
std::invalid_argument if node cannot be prepared

References get_prepped().

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

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

prepare a domain

Parameters:
original the string to prepare as a domain
Returns:
the prepared string
Exceptions:
std::invalid_argument if domain cannot be prepared

References get_prepped().

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

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

prepare a resource

Parameters:
original the string to prepare as a resource
Returns:
the prepared string
Exceptions:
std::invalid_argument if 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:

Generated on Wed Sep 10 01:59:48 2008 for jabberd14 by  doxygen 1.5.5