xmlns_repository

Defined in header: <orcus/xml_namespace.hpp>

class xmlns_repository

Central XML namespace repository that stores all namespaces that are used in the current session.

Warning

this class is not copyable, but is movable; however, the moved-from object will not be usable after the move.

Public Functions

xmlns_repository(const xmlns_repository&) = delete
xmlns_repository &operator=(const xmlns_repository&) = delete
xmlns_repository()
xmlns_repository(xmlns_repository &&other)
~xmlns_repository()
xmlns_repository &operator=(xmlns_repository&&)
void add_predefined_values(const xmlns_id_t *predefined_ns)

Add a set of predefined namespace values to the repository.

Parameters:

predefined_ns – predefined set of namespace values. This is a null-terminated array of xmlns_id_t. This xmlns_repository instance will assume that the instances of these xmlns_id_t values will be available throughout its life cycle; caller needs to ensure that they won’t get deleted before the corresponding xmlns_repository instance is deleted.

xmlns_context create_context()

Create a context object associated with this namespace repository.

Warning

Since this context object references values stored in the repo, make sure that it will not out-live the repository object itself.

Returns:

context object to use for a new XML stream.

xmlns_id_t get_identifier(size_t index) const

Get XML namespace identifier from its numerical index.

Parameters:

index – numeric index of namespace.

Returns:

valid namespace identifier, or XMLNS_UNKNOWN_ID if not found.

std::string get_short_name(xmlns_id_t ns_id) const

See xmlns_context::get_short_name() for the explanation of this method, which works identically to it.