Orcus
Public Member Functions | Friends | List of all members
orcus::xmlns_context Class Reference

#include <xml_namespace.hpp>

Public Member Functions

 xmlns_context (const xmlns_context &r)
 
xmlns_id_t push (const pstring &key, const pstring &uri)
 
void pop (const pstring &key)
 
xmlns_id_t get (const pstring &key) const
 
size_t get_index (xmlns_id_t ns_id) const
 
std::string get_short_name (xmlns_id_t ns_id) const
 
pstring get_alias (xmlns_id_t ns_id) const
 
void get_all_namespaces (std::vector< xmlns_id_t > &nslist) const
 
void dump (std::ostream &os) const
 

Friends

class xmlns_repository
 

Detailed Description

XML namespace context. A new context should be used for each xml stream since the namespace keys themselves are not interned. Don't hold an instance of this class any longer than the life cycle of the xml stream it is used in.

An empty key value is associated with a default namespace.

Member Function Documentation

pstring orcus::xmlns_context::get_alias ( xmlns_id_t  ns_id) const

Get an alias currently associated with a given namespace identifier.

Parameters
ns_idnamespace identifier.
Returns
alias name currently associted with the given namespace identifier, or an empty string if the given namespace is currently not associated with any aliases.