ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ZenitUI::ZMarkup::Attrs Class Reference

Pre-parsed, type-safe attribute bag passed to factories registered via Registry::tag(). More...

#include <ZMarkupDocs.hpp>

Public Member Functions

template<typename T>
const T & get (std::string_view name) const
 Return the typed value of a declared attribute (or its declared default).
bool has (std::string_view name) const
 true if the declared attribute was explicitly present in the markup element.
const std::string & text () const
 Quoted text content of the element.

Static Public Member Functions

static Attrs fromElement (const TagDoc &doc, const Element &el)
 Build an Attrs bag by parsing el according to doc (defaults come solely from doc).

Detailed Description

Pre-parsed, type-safe attribute bag passed to factories registered via Registry::tag().

Reading an undeclared attribute or requesting the wrong type throws std::logic_error, preventing factories from silently drifting out of sync with their TagDoc.


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