Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::ElementLike Concept Reference

Concept for types that can be matched against a selector, such as a donner::svg::SVGElement. More...

#include "donner/base/element/ElementLike.h"

Concept definition

template<typename T>
requires(const T t, const T otherT, const xml::XMLQualifiedNameRef attribName) {
{ t.operator==(otherT) } -> std::same_as<bool>;
{ t.parentElement() } -> std::same_as<std::optional<T>>;
{ t.firstChild() } -> std::same_as<std::optional<T>>;
{ t.lastChild() } -> std::same_as<std::optional<T>>;
{ t.previousSibling() } -> std::same_as<std::optional<T>>;
{ t.nextSibling() } -> std::same_as<std::optional<T>>;
{ t.tagName() } -> std::same_as<xml::XMLQualifiedNameRef>;
{ t.isKnownType() } -> std::same_as<bool>;
{ t.id() } -> std::same_as<RcString>;
{ t.className() } -> std::same_as<RcString>;
{ t.getAttribute(attribName) } -> std::same_as<std::optional<RcString>>;
{
t.findMatchingAttributes(attribName)
} -> std::same_as<SmallVector<xml::XMLQualifiedNameRef, 1>>;
}
Concept for types that can be matched against a selector, such as a donner::svg::SVGElement.
Definition ElementLike.h:19

Detailed Description

Concept for types that can be matched against a selector, such as a donner::svg::SVGElement.

The type must support tree traversal operations, such as parentElement() and previousSibling(), and type and class information to match against the respective selectors.