Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::parser::PathParser Class Reference

Parse an SVG path "d"-string, see Path Data Syntax. More...

#include "donner/svg/parser/PathParser.h"

Static Public Member Functions

static ParseResult< PathParse (std::string_view d)
 Parse an SVG path "d"-string, see Path Data Syntax.

Static Public Attributes

static constexpr std::size_t kMaximumCommands = 128 * 1024
 Maximum number of path commands accepted from one untrusted d attribute.
static constexpr std::size_t kMaximumPoints = 256 * 1024
 Maximum number of points retained while parsing one untrusted d attribute.

Detailed Description

Parse an SVG path "d"-string, see Path Data Syntax.

Member Function Documentation

◆ Parse()

ParseResult< Path > donner::svg::parser::PathParser::Parse ( std::string_view d)
static

Parse an SVG path "d"-string, see Path Data Syntax.

Note that this parser may return both an error and a partial path, since path parsing will return anything that it has parsed before it encountered the error. The caller should use both ParseResult::hasResult() and ParseResult::hasError() to determine what has been returned.

Parameters
dString corresponding to the SVG <path d="..."> parameter.
Returns
Parsed Path and/or an error.

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