|
|
Donner
C++20 SVG rendering library
|
A declaration is a CSS name/value pair, such as color: red;. More...
#include "donner/css/Declaration.h"
Public Member Functions | |
| Declaration (RcString name, std::vector< ComponentValue > values={}, const FileOffset &sourceOffset=FileOffset::Offset(0), bool important=false) | |
| Construct a new Declaration object. | |
| ~Declaration ()=default | |
| Destructor. | |
| Declaration (const Declaration &other)=default | |
| Copy constructor. | |
| Declaration (Declaration &&other) noexcept=default | |
| Move constructor. | |
| Declaration & | operator= (const Declaration &other)=default |
| Copy assignment operator. | |
| Declaration & | operator= (Declaration &&other) noexcept=default |
| Move assignment operator. | |
| bool | operator== (const Declaration &other) const =default |
| Equality operator. | |
Public Attributes | |
| RcString | name |
| Name of the declaration. | |
| std::vector< ComponentValue > | values |
| List of component values for the declaration. | |
| FileOffset | sourceOffset |
| Offset of the declaration name in the source string. | |
| bool | important = false |
| Whether the declaration ends with !important. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Declaration &declaration) |
| Output a human-readable representation of the declaration to a stream. | |
A declaration is a CSS name/value pair, such as color: red;.
The name is a CSS identifier, and the value is a list of component values which can be parsed into higher-level constructs, such as a transform: transform: translate(10px, 20px);.
The important flag is set if the declaration ends with !important, and the tokens for !important are not included in the values list.
|
inline |
Construct a new Declaration object.
| name | Name of the declaration. |
| values | List of component values for the declaration. |
| sourceOffset | Offset of the declaration name in the source string. |
| important | Whether the declaration ends with !important. |
|
friend |
Output a human-readable representation of the declaration to a stream.
| os | Output stream. |
| declaration | Declaration to output. |