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

Rule-related parsing routines, including parsing individual rules, lists of rules, and stylesheets. More...

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

Static Public Member Functions

static std::vector< RuleParseStylesheet (std::string_view str)
 Parse a CSS stylesheet into a list of rules, per https://www.w3.org/TR/css-syntax-3/#parse-stylesheet.
 
static std::vector< RuleParseListOfRules (std::string_view str)
 Parse a list of rules, per https://www.w3.org/TR/css-syntax-3/#parse-list-of-rules.
 
static std::optional< RuleParseRule (std::string_view str)
 Parse a rule, per https://www.w3.org/TR/css-syntax-3/#parse-rule.
 

Detailed Description

Rule-related parsing routines, including parsing individual rules, lists of rules, and stylesheets.

Member Function Documentation

◆ ParseListOfRules()

std::vector< Rule > donner::css::parser::RuleParser::ParseListOfRules ( std::string_view str)
static

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

Parameters
strInput list of rules string.
Returns
Parsed list of rules.

◆ ParseRule()

std::optional< Rule > donner::css::parser::RuleParser::ParseRule ( std::string_view str)
static

Parse a rule, per https://www.w3.org/TR/css-syntax-3/#parse-rule.

Parameters
strInput rule string.
Returns
Parsed rule, or std::nullopt if there was no rule.

◆ ParseStylesheet()

std::vector< Rule > donner::css::parser::RuleParser::ParseStylesheet ( std::string_view str)
static

Parse a CSS stylesheet into a list of rules, per https://www.w3.org/TR/css-syntax-3/#parse-stylesheet.

NOTE: This does not parse selectors, in most cases you should use StylesheetParser instead which handles selectors and returns a Stylesheet object to match against.

Parameters
strInput stylesheet string.
Returns
Parsed stylesheet as a list of rules.

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