Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::base::parser::LengthParser::Options Struct Reference

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.
 

Detailed Description

Options to modify the parsing behavior.

Member Data Documentation

◆ unitOptional

bool donner::base::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.


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