Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::parser::ClockValueParser Class Reference

Parses SMIL clock values from string representation. More...

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

Static Public Member Functions

static ParseResult< components::ClockValue > Parse (std::string_view str)
 Parse a clock value string.

Detailed Description

Parses SMIL clock values from string representation.

Supported formats per the SVG Animations spec:

  • Full clock: HH:MM:SS or HH:MM:SS.frac
  • Partial clock: MM:SS or MM:SS.frac
  • Timecount: digits with an optional . fraction and an optional metric, h, min, s or ms; without a metric the value is in seconds
  • indefinite

Clock components are decimal digits only; the seconds component may carry a . fraction with at least one digit on each side. For offsets, one optional + or - sign may precede the value, and XML whitespace (space, tab, CR, LF) is allowed around the value and between the sign and the value, e.g. - 01:00.

Beyond the strict SMIL grammar, a timecount may use an exponent (1e-3s) or a leading dot (.5s), the number forms of donner::parser::NumberParser.

Member Function Documentation

◆ Parse()

ParseResult< components::ClockValue > donner::svg::parser::ClockValueParser::Parse ( std::string_view str)
static

Parse a clock value string.

Parameters
strThe string to parse.
Returns
The parsed ClockValue, or an error.

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