GCC Middle and Back End API Reference
text_art::styled_string Class Reference

#include <types.h>

Public Member Functions

 styled_string ()=default
 styled_string (style_manager &sm, const char *str)
 styled_string (cppchar_t cppchar, bool emoji=false)
 styled_string (styled_string &&)=default
styled_stringoperator= (styled_string &&)=default
 styled_string (const styled_string &)=delete
styled_stringoperator= (const styled_string &)=delete
styled_string copy () const
bool operator== (const styled_string &other) const
static styled_string static styled_string size_t size () const
styled_unichar operator[] (size_t idx) const
std::vector< styled_unichar >::const_iterator begin () const
std::vector< styled_unichar >::const_iterator end () const
int calc_canvas_width () const
void append (const styled_string &suffix)
void set_url (style_manager &sm, const char *url)

Static Public Member Functions

static styled_string from_fmt (style_manager &sm, printer_fn format_decoder, const char *fmt,...) ATTRIBUTE_GCC_PPDIAG(3
static styled_string static styled_string from_fmt_va (style_manager &sm, printer_fn format_decoder, const char *fmt, va_list *args) ATTRIBUTE_GCC_PPDIAG(3

Private Attributes

std::vector< styled_unicharm_chars

Constructor & Destructor Documentation

◆ styled_string() [1/5]

text_art::styled_string::styled_string ( )
explicitdefault

◆ styled_string() [2/5]

styled_string::styled_string ( style_manager & sm,
const char * str )
explicit
class text_art::styled_string.   
Construct a styled_string from STR.
STR is assumed to be UTF-8 encoded and 0-terminated.

Parse SGR formatting chars from being in-band (within in the sequence
of chars) to being out-of-band, as style elements.
We only support parsing the subset of SGR chars that can be emitted
by pretty-print.cc    

References m_chars.

◆ styled_string() [3/5]

styled_string::styled_string ( cppchar_t cppchar,
bool emoji = false )
explicit

◆ styled_string() [4/5]

text_art::styled_string::styled_string ( styled_string && )
default

References styled_string().

◆ styled_string() [5/5]

text_art::styled_string::styled_string ( const styled_string & )
delete

References styled_string().

Member Function Documentation

◆ append()

void styled_string::append ( const styled_string & suffix)

References begin(), end(), m_chars, and styled_string().

◆ begin()

std::vector< styled_unichar >::const_iterator text_art::styled_string::begin ( ) const
inline

References m_chars.

Referenced by append().

◆ calc_canvas_width()

int styled_string::calc_canvas_width ( ) const

References m_chars.

◆ copy()

styled_string text_art::styled_string::copy ( ) const
inline

References m_chars, and styled_string().

◆ end()

std::vector< styled_unichar >::const_iterator text_art::styled_string::end ( ) const
inline

References m_chars.

Referenced by append().

◆ from_fmt()

styled_string styled_string::from_fmt ( style_manager & sm,
printer_fn format_decoder,
const char * fmt,
... )
static

References ap, from_fmt_va(), and styled_string().

◆ from_fmt_va()

◆ operator=() [1/2]

styled_string & text_art::styled_string::operator= ( const styled_string & )
delete

References styled_string().

◆ operator=() [2/2]

styled_string & text_art::styled_string::operator= ( styled_string && )
default

References styled_string().

◆ operator==()

bool text_art::styled_string::operator== ( const styled_string & other) const
inline

References m_chars, and styled_string().

◆ operator[]()

styled_unichar text_art::styled_string::operator[] ( size_t idx) const
inline

References m_chars.

◆ set_url()

◆ size()

styled_string static styled_string size_t text_art::styled_string::size ( ) const
inline

References m_chars, and size().

Referenced by size().

Field Documentation

◆ m_chars

std::vector<styled_unichar> text_art::styled_string::m_chars
private

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