Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::Rule Struct Reference

Holds a CSS rule which can either be a standard QualifiedRule, an AtRule, or an InvalidRule if there was a parse error. More...

#include "donner/css/Rule.h"

Public Types

using Type = std::variant<AtRule, QualifiedRule, InvalidRule>
 Variant for the different rule types.
 

Public Member Functions

 Rule (Type &&value)
 Construct a new rule object from any type within the Type variant.
 
 ~Rule ()=default
 Destructor.
 
 Rule (const Rule &other)=default
 Copy constructor.
 
 Rule (Rule &&other) noexcept=default
 Move constructor.
 
Ruleoperator= (const Rule &other)=default
 Copy assignment operator.
 
Ruleoperator= (Rule &&other) noexcept=default
 Move assignment operator.
 
bool operator== (const Rule &other) const =default
 Equality operator.
 

Public Attributes

Type value
 Rule value.
 

Friends

std::ostream & operator<< (std::ostream &os, const Rule &rule)
 Ostream output operator.
 

Detailed Description

Holds a CSS rule which can either be a standard QualifiedRule, an AtRule, or an InvalidRule if there was a parse error.

Examples:

  • QualifiedRule: a > b { color: red }
  • AtRule: @media (min-width: 600px) { a > b { color: red } }
  • InvalidRule, in this case since @charset needs to end with a semicolon: @charset \"123\\"

Constructor & Destructor Documentation

◆ Rule()

donner::css::Rule::Rule ( Type && value)
inline

Construct a new rule object from any type within the Type variant.

Parameters
valueRule value.

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