xmppd::ns_decl_list Class Reference

#include <jabberdlib.h>

Public Member Functions

 ns_decl_list ()
 ns_decl_list (const xmlnode node)
void update (const std::string &prefix, const std::string &ns_iri)
void delete_last (const std::string &prefix)
char const * get_nsprefix (const std::string &iri) const
char const * get_nsprefix (const std::string &iri, bool accept_default_prefix) const
char const * get_nsiri (const std::string &prefix) const
bool check_prefix (const std::string &prefix, const std::string &ns_iri) const

Detailed Description

This class represents and manages a list of bindings from namespace prefixes to namespace IRIs


Constructor & Destructor Documentation

xmppd::ns_decl_list::ns_decl_list (  ) 

Create an empty namespace declaration list

References NS_XML, NS_XMLNS, and update().

xmppd::ns_decl_list::ns_decl_list ( const xmlnode  node  ) 

create a namespace declaration list from the namespaces defined on a node

References NS_XML, NS_XMLNS, update(), xmlnode_get_data(), xmlnode_get_firstattrib(), xmlnode_get_localname(), xmlnode_get_namespace(), and xmlnode_get_nextsibling().


Member Function Documentation

bool xmppd::ns_decl_list::check_prefix ( const std::string &  prefix,
const std::string &  ns_iri 
) const

check if a namespace is already declared as we need it

Parameters:
prefix the prefix we want to check
ns_iri the IRI we check if the prefix maps to it
Returns:
true if the namespace prefix is already declared as we need it

References get_nsiri().

Referenced by get_nsprefix().

void xmppd::ns_decl_list::delete_last ( const std::string &  prefix  ) 

delete the last declaration of a prefix

Parameters:
prefix the prefix, that should get undeclared
char const * xmppd::ns_decl_list::get_nsiri ( const std::string &  prefix  )  const

get the namespace IRI, that is currently bound to a namespace prefix

Parameters:
prefix the namespace prefix to check
Returns:
the namespace IRI the prefix is bound to, NULL if the prefix is not declared
Exceptions:
std::invalid_argument if prefix is not bound to a namespace

Referenced by check_prefix().

char const * xmppd::ns_decl_list::get_nsprefix ( const std::string &  iri,
bool  accept_default_prefix 
) const

get the latest prefix, that is bould to a namespace IRI

Parameters:
iri the namespace IRI to search for
accept_default_prefix if set to false, the method will only search for a non-default prefix
Returns:
the latest prefix, that is bould to this namespace IRI
Exceptions:
std::invalid_argument if namespace is not declared

References check_prefix().

char const * xmppd::ns_decl_list::get_nsprefix ( const std::string &  iri  )  const

get the latest prefix, that is bould to a namespace IRI

Parameters:
iri the namespace IRI to search for
Returns:
the latest prefix, that is bould to this namespace IRI
Exceptions:
std::invalid_argument if namespace is not declared

Referenced by dialback_in_read(), dialback_out_read(), expat_startElement(), and xmlnode_put_expat_attribs().

void xmppd::ns_decl_list::update ( const std::string &  prefix,
const std::string &  ns_iri 
)

add a declared prefix to the list of namespace prefix declarations

Parameters:
prefix namespace prefix to add
ns_iri namespace IRI to add

Referenced by mio_write_root(), and ns_decl_list().


The documentation for this class was generated from the following files:
Generated on Fri Sep 3 06:00:16 2010 for jabberd14 by  doxygen 1.6.3