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

Immutable case-sensitive names in sorted order, sharing independently charged token trees. More...

#include "donner/svg/components/style/CustomPropertyMap.h"

Classes

struct  Change
 One winning local declaration. The last change wins when a name appears more than once. More...
struct  Entry
 A present computed value. More...

Public Types

enum class  Action {
  Set ,
  Initial ,
  Inherit ,
  Unset
}
 Replacement applied to an inherited custom property. More...

Public Member Functions

const TokenSequence * find (std::string_view name) const
 Find one value by its exact name.
std::span< const Entry > entries () const
 Borrow the sorted entries for the lifetime of this map.
 CustomPropertyMap (const CustomPropertyMap &)=delete
CustomPropertyMap & operator= (const CustomPropertyMap &)=delete

Static Public Member Functions

static std::optional< std::shared_ptr< const CustomPropertyMap > > Overlay (std::shared_ptr< RetainedStyleBytes > account, std::shared_ptr< const CustomPropertyMap > parent, std::span< const Change > changes)
 Overlay local declarations without modifying the inherited map or its tokens.

Static Public Attributes

static constexpr std::size_t kMaximumEntries = 65'536
 Maximum number of names in one map or overlay input.

Detailed Description

Immutable case-sensitive names in sorted order, sharing independently charged token trees.


Class Documentation

◆ donner::svg::components::CustomPropertyMap::Change

struct donner::svg::components::CustomPropertyMap::Change

One winning local declaration. The last change wins when a name appears more than once.

Class Members
Action action
RcString name
shared_ptr< const TokenSequence > value

◆ donner::svg::components::CustomPropertyMap::Entry

struct donner::svg::components::CustomPropertyMap::Entry

A present computed value.

Class Members
RcString name
shared_ptr< const TokenSequence > value

Member Enumeration Documentation

◆ Action

Replacement applied to an inherited custom property.

Enumerator
Set 

Replace with the supplied tokens, or remove the name when the value is invalid.

Initial 

The guaranteed-invalid value, even if a parent has the name.

Inherit 

Keep the parent's value.

Unset 

Untyped custom properties inherit.

Member Function Documentation

◆ find()

const TokenSequence * donner::svg::components::CustomPropertyMap::find ( std::string_view name) const
nodiscard

Find one value by its exact name.

Parameters
nameCase-sensitive custom property name.
Returns
A borrowed sequence, or null for an absent or guaranteed-invalid value.

◆ Overlay()

std::optional< std::shared_ptr< const CustomPropertyMap > > donner::svg::components::CustomPropertyMap::Overlay ( std::shared_ptr< RetainedStyleBytes > account,
std::shared_ptr< const CustomPropertyMap > parent,
std::span< const Change > changes )
staticnodiscard

Overlay local declarations without modifying the inherited map or its tokens.

Parameters
accountAccount for the new map and its names.
parentInherited values, potentially owned by another document.
changesLocal declarations in order.
Returns
Nullopt on refusal. An engaged null pointer represents an empty map.

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