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

An element as RuleIndex::collectCandidates reads it. More...

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

Concept definition

template<typename T>
concept donner::svg::components::RuleIndexElement = requires(const T& element, void (*visit)(std::string_view)) {
{ element.id() } -> std::convertible_to<std::string_view>;
{ element.typeName() } -> std::convertible_to<std::string_view>;
element.forEachClassName(visit);
element.forEachAttributeLocalName(visit);
}
An element as RuleIndex::collectCandidates reads it.
Definition RuleIndex.h:58

Detailed Description

An element as RuleIndex::collectCandidates reads it.

Each accessor is called only when the index has keys of that kind, so an element type can compute them on demand:

  • std::string_view id() const: the element's id, or empty.
  • forEachClassName(visit): calls visit(std::string_view) per class list entry.
  • forEachAttributeLocalName(visit): calls visit(std::string_view) per attribute.
  • std::string_view typeName() const: the local tag name, in any case.

The views only need to stay valid for the duration of the call.