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

A CSS function, such as rgb(255, 0, 0), parsed into a function name and a list of parameter values. More...

#include "donner/css/ComponentValue.h"

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

Public Member Functions

 Function (RcString name, const parser::FileOffset &sourceOffset)
 Construct a new Function object with a name and an empty parameter list.
 
bool operator== (const Function &other) const
 Equality operator.
 

Public Attributes

RcString name
 Function name, such as "rgb".
 
std::vector< ComponentValuevalues
 List of parameter values.
 
parser::FileOffset sourceOffset
 Offset of the function name in the source string.
 

Friends

std::ostream & operator<< (std::ostream &os, const Function &func)
 Output a human-readable representation of the function to a stream.
 

Detailed Description

A CSS function, such as rgb(255, 0, 0), parsed into a function name and a list of parameter values.

Compared to Token::Function, this has the next level of parsing, where the function's parameters have been extracted as a list of ComponentValue. Token::Function would only include "rgb(" part of the function.

Constructor & Destructor Documentation

◆ Function()

donner::css::Function::Function ( RcString name,
const parser::FileOffset & sourceOffset )

Construct a new Function object with a name and an empty parameter list.

To supply parameters, modify the values vector after construction.

Parameters
nameFunction name.
sourceOffsetOffset of the function name in the source string.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Function & func )
friend

Output a human-readable representation of the function to a stream.

Parameters
osOutput stream.
funcFunction to output.

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