|
|
Donner
C++20 SVG rendering library
|
Manages XML namespace state for a document. More...
#include "donner/base/xml/components/XMLNamespaceContext.h"
Public Member Functions | |
| XMLNamespaceContext (Registry ®istry) | |
| Constructor, this should only be called once to construct on the given Registry, with registry.ctx().emplace<XMLNamespaceContext>(registry). | |
| void | addNamespaceOverride (Entity entity, const XMLQualifiedName &name, const RcString &uri) |
| Add a namespace override for the given entity. | |
| void | removeNamespaceOverride (Entity entity, const XMLQualifiedName &name) |
| Removes a namespace override for the given entity. | |
| std::optional< RcString > | getNamespaceUri (Registry ®istry, Entity entity, const RcString &prefix) const |
| Get the URI for the given namespace prefix. | |
Manages XML namespace state for a document.
Access via the Registry::ctx API:
|
inlineexplicit |
Constructor, this should only be called once to construct on the given Registry, with registry.ctx().emplace<XMLNamespaceContext>(registry).
To use this class, access it via the Registry::ctx API.
| registry | Underlying registry for the document. |
|
inline |
Add a namespace override for the given entity.
If the attribute has changed this may be called again with the same name but different URI.
| entity | Entity to add the namespace override for. |
| name | Namespace attribute to override. |
| uri | Namespace URI to use for the prefix. |
|
inline |
Removes a namespace override for the given entity.
| entity | Entity to remove the namespace override for. |
| name | Namespace attribute to remove. |