|
|
Donner
C++20 SVG rendering library
|
Options to modify the parsing behavior. More...
#include "donner/base/parser/LengthParser.h"
Public Member Functions | |
| Options () | |
| Construct a default options struct. | |
Public Attributes | |
| bool | unitOptional = false |
| If set, the unit specifier is optional, enabling non-zero numbers to be parsed without a suffix, such as "100". | |
| bool | limitUnitToPercentage = false |
| If true, limits the parser to a <percentage>, or <number> if unitOptional is set. | |
Options to modify the parsing behavior.
| bool donner::parser::LengthParser::Options::unitOptional = false |
If set, the unit specifier is optional, enabling non-zero numbers to be parsed without a suffix, such as "100".
When true, this is equivalent to parsing a [ <length-percentage> | <number> ]. If the unit specifier is not found, the Length returned will have Unit::None.
This should be true when parsing presentation attributes, see https://www.w3.org/TR/SVG/types.html#syntax.