Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uni20::presentation::styled_text Class Reference

A sequence of styled text spans and semantic glyph tokens. More...

#include <presentation.hpp>

Public Member Functions

styled_text & append (semantic_glyph glyph, terminal::TerminalStyle style={})
 Append a semantic glyph token.
 
styled_text & append (std::string_view text, terminal::TerminalStyle style={})
 Append a text span.
 
styled_text & append (styled_text const &other)
 Append all spans from another styled text document.
 
bool empty () const noexcept
 Return whether this document has no spans.
 
std::vector< presentation_span > const & spans () const noexcept
 Return the stored presentation spans.
 

Detailed Description

A sequence of styled text spans and semantic glyph tokens.

Member Function Documentation

◆ append() [1/3]

styled_text & uni20::presentation::styled_text::append ( semantic_glyph  glyph,
terminal::TerminalStyle  style = {} 
)

Append a semantic glyph token.

Parameters
glyphSemantic glyph to render according to policy.
styleStyle metadata associated with the glyph.
Returns
Reference to this object for chaining.

◆ append() [2/3]

styled_text & uni20::presentation::styled_text::append ( std::string_view  text,
terminal::TerminalStyle  style = {} 
)

Append a text span.

Parameters
textText payload encoded as UTF-8.
styleStyle metadata associated with the span.
Returns
Reference to this object for chaining.

◆ append() [3/3]

styled_text & uni20::presentation::styled_text::append ( styled_text const &  other)

Append all spans from another styled text document.

Parameters
otherStyled text document to append.
Returns
Reference to this object for chaining.

◆ empty()

bool uni20::presentation::styled_text::empty ( ) const
noexcept

Return whether this document has no spans.

Returns
True when no spans have been appended.

◆ spans()

std::vector< presentation_span > const & uni20::presentation::styled_text::spans ( ) const
noexcept

Return the stored presentation spans.

Returns
Immutable span vector.

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