Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::svg::parser::AttributeParser Class Reference

Parses XML attributes and sets applies them to SVGElements. More...

#include "donner/svg/parser/AttributeParser.h"

Static Public Member Functions

static std::optional< ParseDiagnosticParseAndSetAttribute (SVGParserContext &context, SVGElement &element, const xml::XMLQualifiedNameRef &name, std::string_view value) noexcept
 Parse an XML attribute and set it on the given element.
static std::optional< ParseDiagnosticApplyParsedAttribute (SVGElement &element, const xml::XMLQualifiedNameRef &name, std::string_view value)
 Apply an XML attribute read by the SVG parser without writing back to source.
static void RemoveParsedAttribute (SVGElement &element, const xml::XMLQualifiedNameRef &name)
 Remove an XML attribute from the SVG projection without writing back to source.

Detailed Description

Parses XML attributes and sets applies them to SVGElements.

Member Function Documentation

◆ ApplyParsedAttribute()

std::optional< ParseDiagnostic > donner::svg::parser::AttributeParser::ApplyParsedAttribute ( SVGElement & element,
const xml::XMLQualifiedNameRef & name,
std::string_view value )
static

Apply an XML attribute read by the SVG parser without writing back to source.

Parameters
elementThe element to set the attribute on.
nameThe name of the attribute, as specified in the document's XML.
valueThe value of the attribute.

◆ ParseAndSetAttribute()

std::optional< ParseDiagnostic > donner::svg::parser::AttributeParser::ParseAndSetAttribute ( SVGParserContext & context,
SVGElement & element,
const xml::XMLQualifiedNameRef & name,
std::string_view value )
staticnoexcept

Parse an XML attribute and set it on the given element.

Parameters
contextThe parser context, used to store XML document metadata and store warnings.
elementThe element to set the attribute on.
nameThe name of the attribute, as specified in the document's XML.
valueThe value of the attribute.

◆ RemoveParsedAttribute()

void donner::svg::parser::AttributeParser::RemoveParsedAttribute ( SVGElement & element,
const xml::XMLQualifiedNameRef & name )
static

Remove an XML attribute from the SVG projection without writing back to source.

Parameters
elementThe element to remove the attribute from.
nameThe name of the attribute, as specified in the document's XML.

The documentation for this class was generated from the following file: