|
|
Donner
C++20 SVG rendering library
|
Stores XML attribute values. More...
#include "donner/base/xml/components/AttributesComponent.h"
Public Member Functions | |
| AttributesComponent ()=default | |
| Constructor. | |
| AttributesComponent (const AttributesComponent &)=delete | |
| AttributesComponent & | operator= (const AttributesComponent &)=delete |
| AttributesComponent (AttributesComponent &&)=default | |
| Move constructor. | |
| AttributesComponent & | operator= (AttributesComponent &&)=default |
| Move assignment operator. | |
| ~AttributesComponent ()=default | |
| Destructor. | |
| bool | hasAttribute (const xml::XMLQualifiedNameRef &name) const |
| Returns true if the element has an attribute with the given name. | |
| std::optional< RcString > | getAttribute (const xml::XMLQualifiedNameRef &name) const |
| Get the value of an attribute, if it exists. | |
| SmallVector< xml::XMLQualifiedNameRef, 10 > | attributes () const |
| Get a list of all attributes. | |
| SmallVector< xml::XMLQualifiedNameRef, 1 > | findMatchingAttributes (const xml::XMLQualifiedNameRef &matcher) const |
| Find attributes matching the given name matcher. | |
| void | setAttribute (Registry ®istry, const xml::XMLQualifiedNameRef &name, const RcString &value) |
| Set the value of a generic XML attribute, which may be either a presentation attribute or custom user-provided attribute. | |
| void | removeAttribute (Registry ®istry, const xml::XMLQualifiedNameRef &name) |
| Remove an attribute from the element. | |
| bool | hasNamespaceOverrides () const |
| Returns true if the element has any namespace overrides. | |
Stores XML attribute values.
|
inline |
Get a list of all attributes.
| name | Name of the attribute to get. |
| SmallVector< xml::XMLQualifiedNameRef, 1 > donner::components::AttributesComponent::findMatchingAttributes | ( | const xml::XMLQualifiedNameRef & | matcher | ) | const |
Find attributes matching the given name matcher.
| matcher | Matcher to use to find attributes. If XMLQualifiedNameRef::namespacePrefix is "*", the matcher will match any namespace with the given attribute name. |
|
inline |
Get the value of an attribute, if it exists.
| name | Name of the attribute to get. |
|
inline |
Returns true if the element has an attribute with the given name.
| name | Name of the attribute to check. |
| void donner::components::AttributesComponent::removeAttribute | ( | Registry & | registry, |
| const xml::XMLQualifiedNameRef & | name ) |
Remove an attribute from the element.
| registry | Registry to use for the operation. |
| name | Name of the attribute to remove. |
| void donner::components::AttributesComponent::setAttribute | ( | Registry & | registry, |
| const xml::XMLQualifiedNameRef & | name, | ||
| const RcString & | value ) |
Set the value of a generic XML attribute, which may be either a presentation attribute or custom user-provided attribute.
This API only stores the underlying strings for the attribute name and value, and does not parse them. To parse, use the upper-layer API: SVGElement::setAttribute.
| registry | Registry to use for the operation. |
| name | Name of the attribute to set. |
| value | New value to set. |