Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
PropertyParsing.h File Reference
Include dependency graph for PropertyParsing.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::svg::parser::UnparsedProperty
 Represents an unparsed property, which is a CSS property that is element-specific and needs to be matched with the actual element before it can be parsed and applied. More...
 
struct  donner::svg::parser::PropertyParseFnParams
 Parameters for a property parse function. More...
 

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
 
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.
 
namespace  donner::svg::parser
 Parsers for the SVG XML format, XMLParser, as well as individual parsers for SVG components, such as PathParser and TransformParser.
 

Enumerations

enum class  donner::svg::parser::PropertyParseBehavior {
  donner::svg::parser::Default ,
  donner::svg::parser::AllowUserUnits
}
 Set the parse behavior for numbers. More...
 

Functions

template<typename T , PropertyCascade kCascade, typename ParseCallbackFn >
std::optional< ParseErrordonner::svg::parser::Parse (const PropertyParseFnParams &params, ParseCallbackFn callbackFn, Property< T, kCascade > *destination)
 Parse a property value into a Property.
 
ParseResult< booldonner::svg::parser::ParseSpecialAttributes (PropertyParseFnParams &params, std::string_view name, std::optional< ElementType > type=std::nullopt, EntityHandle handle=EntityHandle())
 Parse special property attributes, currently used for transform.
 
std::optional< RcStringdonner::svg::parser::TryGetSingleIdent (std::span< const css::ComponentValue > components)
 If the components contain only a single ident, returns an RcString for that ident's contents.
 
ParseResult< std::optional< Lengthd > > donner::svg::parser::ParseLengthPercentageOrAuto (std::span< const css::ComponentValue > components, bool allowUserUnits)
 Parse a <length-percentage>, which may optionally be set to "auto", in which case this returns std::nullopt.
 
ParseResult< doubledonner::svg::parser::ParseAlphaValue (std::span< const css::ComponentValue > components)
 Parse an <alpha-value>, defined by CSS Color: https://www.w3.org/TR/css-color/#typedef-alpha-value.
 

Class Documentation

◆ donner::svg::parser::UnparsedProperty

struct donner::svg::parser::UnparsedProperty

Represents an unparsed property, which is a CSS property that is element-specific and needs to be matched with the actual element before it can be parsed and applied.

For example, the transform property.

Collaboration diagram for donner::svg::parser::UnparsedProperty:
[legend]
Class Members
Declaration declaration CSS declaration, e.g. "transform: translate(10px, 20px);". Contains the name and list of css::ComponentValue for the value.
Specificity specificity Specificity of the declaration.