|
|
Donner
C++20 SVG rendering library
|
Parses a list of values conforming to the SVG comma-or-space list syntax. More...
#include "donner/svg/parser/ListParser.h"
Static Public Member Functions | |
| template<ListParserItemCallback Fn> | |
| static std::optional< ParseError > | Parse (std::string_view value, Fn fn) |
Parses the SVG comma-or-space separated list from the given std::string_view. | |
Parses a list of values conforming to the SVG comma-or-space list syntax.
This parser adheres to the rules for SVG lists, which allow items to be separated by commas, whitespace, or a mix of both. It calls a provided function for each individual item found in the list.
Grammar allows:
Invalid syntax (returns false):
Example Usage:
|
inlinestatic |
Parses the SVG comma-or-space separated list from the given std::string_view.
| Fn | Type of the function to call for each list item, with signature void(std::string_view). |
| value | The string_view containing the list to parse. |
| fn | The function to call for each parsed item. |