|
|
Donner
C++20 SVG rendering library
|
An+B microsyntax value, which is parsed by parser::AnbMicrosyntaxParser. More...
#include "donner/css/details/AnbValue.h"
Public Member Functions | |
| int | evaluate (int index) const noexcept |
| Evaluate whether the given child index matches this An+B value. | |
| bool | operator== (const AnbValue &other) const noexcept=default |
| Equality operator. | |
Public Attributes | |
| int | a = 0 |
| The 'a' value in the An+B microsyntax. | |
| int | b = 0 |
| The 'b' value in the An+B microsyntax. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const AnbValue &value) |
| Print to an output stream. | |
An+B microsyntax value, which is parsed by parser::AnbMicrosyntaxParser.
For example, the arguments of :nth-child(4n+2) are parsed as an AnbValue with a = 4, and b = 2.
|
inlinenoexcept |
Evaluate whether the given child index matches this An+B value.
For example, if this AnbValue represents 4n+2, then evaluate(2) would return true, but evaluate(3) would return false.
| index | A 1-based child index; evaluate(1) is the first child. If index is negative, evaluate returns false. |