cwidget  0.5.17
Public Member Functions | List of all members
cwidget::chstring Class Reference

A string class which stores attributes along with characters. More...

#include <curses++.h>

Inheritance diagram for cwidget::chstring:

Public Member Functions

 chstring (const std::basic_string< chtype > &s)
 
 chstring (const std::string &s)
 
 chstring (const std::string &s, const style &st)
 
 chstring (const chstring &s)
 
 chstring (const chstring &s, const style &st)
 Apply the given style to the given chstring, and set ourselves to the result.
 
 chstring (const chstring &s, size_t loc, size_t n=npos)
 
 chstring (size_t n, chtype c)
 
chstringoperator= (const std::string &s)
 Assign the characters of s to this, setting all attributes to A_NORMAL. More...
 
void apply_style (const style &st)
 Change the attributes of this string by using the given style. More...
 

Detailed Description

A string class which stores attributes along with characters.

This has to derive from basic_string in order to implement operator= (which can't be a global function – it has to be a nonstatic member)

Member Function Documentation

◆ apply_style()

void cwidget::chstring::apply_style ( const style st)

Change the attributes of this string by using the given style.

References cwidget::style::apply_to(), and cwidget::style::get_attrs().

Referenced by chstring().

◆ operator=()

chstring & cwidget::chstring::operator= ( const std::string &  s)

Assign the characters of s to this, setting all attributes to A_NORMAL.

References cwidget::style::get_attrs(), cwidget::get_style(), cwidget::config::init_colors(), and cwidget::wchstring::width().


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