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

Parsed representation of one markup node. More...

#include <ZMarkup.hpp>

Public Member Functions

std::string attr (std::string_view k, std::string_view d="") const
 Return the value of attribute k, or d if absent.
bool has (std::string_view k) const
 true if the element has attribute k (regardless of value).
float attrFloat (std::string_view k, float d=0.0f) const
 Return attribute k parsed as float, or d on failure.
bool attrBool (std::string_view k, bool d=false) const
 Return attribute k as bool ("true", "1", "yes").

Public Attributes

std::string tag
std::vector< std::string > classes
std::string id
std::string ref
std::string text
std::vector< std::pair< std::string, std::string > > attrs
std::vector< SourceSpan > attrSpans
 Parallel to attrs (source location of each attribute key).
SourceSpan span {}
 Source location of the element tag.
std::vector< ZStyleDiagnostic > parseErrors
 Lexical/syntax diagnostics recorded while parsing.
std::vector< Element > children

Detailed Description

Parsed representation of one markup node.


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