Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::parser::ValueParser Class Reference

Parse a CSS value, per https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values. More...

#include "donner/css/parser/ValueParser.h"

Static Public Member Functions

static std::vector< ComponentValueParse (std::string_view str)
 Parse a CSS value, per https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values.
 

Detailed Description

Parse a CSS value, per https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values.

This is used when parsing CSS-like attributes within XML/HTML, such as SVG presentation attributes.

Member Function Documentation

◆ Parse()

std::vector< ComponentValue > donner::css::parser::ValueParser::Parse ( std::string_view str)
static

Parse a CSS value, per https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values.

This is used when parsing CSS-like attributes within XML/HTML, such as SVG presentation attributes.

For example, in SVG the following provide the same style:

<circle r="10" style="fill:red" />

and:

<circle r="10" fill="red" />

This function would parse the string "red" and return a list of component values representing the value.

Parameters
strInput value string.
Returns
Parsed value as a list of component values.

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