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

A CSS simple block, such as a rule block or a parenthesized expression. More...

#include "donner/css/ComponentValue.h"

Collaboration diagram for donner::css::SimpleBlock:
[legend]

Public Member Functions

 SimpleBlock (TokenIndex associatedToken, const parser::FileOffset &sourceOffset)
 Construct a new SimpleBlock object with an opening token and an empty list of component values.
 
bool operator== (const SimpleBlock &other) const
 Equality operator.
 

Public Attributes

TokenIndex associatedToken
 The token that starts the simple block.
 
std::vector< ComponentValuevalues
 List of component values inside the simple block.
 
parser::FileOffset sourceOffset
 Offset of the opening token in the source string.
 

Friends

std::ostream & operator<< (std::ostream &os, const SimpleBlock &block)
 Output a human-readable representation of the simple block to a stream.
 

Detailed Description

A CSS simple block, such as a rule block or a parenthesized expression.

A SimpleBlock may start with either '{', '(' or '[', and ends when the matching closing token is found.

For example, the following is a valid simple block: { color: red; }, and so is this within a selector: [href^="https://"].

Constructor & Destructor Documentation

◆ SimpleBlock()

donner::css::SimpleBlock::SimpleBlock ( TokenIndex associatedToken,
const parser::FileOffset & sourceOffset )
explicit

Construct a new SimpleBlock object with an opening token and an empty list of component values.

To supply component values, modify the values vector after construction.

Parameters
associatedTokenThe token that starts the simple block.
sourceOffsetOffset of the opening token in the source string.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const SimpleBlock & block )
friend

Output a human-readable representation of the simple block to a stream.

Parameters
osOutput stream.
blockSimple block to output.

Member Data Documentation

◆ associatedToken

TokenIndex donner::css::SimpleBlock::associatedToken

The token that starts the simple block.

This is either '{', '[' or '(', which corresponds to Token::CurlyBracket, Token::SquareBracket, and Token::Parenthesis respectively.


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