Orcus
|
#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 |
std::vector< xmlns_id_t > | get_all_namespaces () const |
void | dump (std::ostream &os) const |
Friends | |
class | xmlns_repository |
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.
xmlns_id_t orcus::xmlns_context::get | ( | const pstring & | key | ) | const |
Get the currnet namespace identifier for a specified namespace alias.
key | namespace alias to get the current namespace identifier for. |
pstring orcus::xmlns_context::get_alias | ( | xmlns_id_t | ns_id | ) | const |
Get an alias currently associated with a given namespace identifier.
ns_id | namespace identifier. |
size_t orcus::xmlns_context::get_index | ( | xmlns_id_t | ns_id | ) | const |
Get a unique index value associated with a specified identifier. An index value is guaranteed to be unique regardless of contexts.
ns_id | a namespace identifier to obtain index for. |
std::string orcus::xmlns_context::get_short_name | ( | xmlns_id_t | ns_id | ) | const |
Get a 'short' name associated with a specified identifier. A short name is a string value conveniently short enough for display purposes, but still guaranteed to be unique to the identifier it is associated with.
Note that the xmlns_repository class has method of the same name, and that method works identically to this method.
ns_id | a namespace identifier to obtain short name for. |