Terminal++ 3.1.0.4
A C++ library for interacting with ANSI terminal windows
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
terminalpp::glyph Struct Reference

A structure that carries around the character attributes of an ANSI element. More...

#include <glyph.hpp>

Public Member Functions

constexpr glyph (byte const character=detail::ascii::space, character_set const charset=character_set()) noexcept
 Default Constructor.
 
constexpr glyph (byte const (&text)[2]) noexcept
 Constructs a UTF-8 glyph from a char sequence.
 
constexpr glyph (byte const (&text)[3]) noexcept
 Constructs a UTF-8 glyph from a char sequence.
 
constexpr glyph (byte const (&text)[4]) noexcept
 Constructs a UTF-8 glyph from a char sequence.
 
constexpr glyph (char8_t const (&text)[2]) noexcept
 Constructs a UTF-8 glyph from a char sequence.
 
constexpr glyph (char8_t const (&text)[3]) noexcept
 Constructs a UTF-8 glyph from a char sequence.
 
constexpr glyph (char8_t const (&text)[4]) noexcept
 Constructs a UTF-8 glyph from a char sequence.
 
template<class T = void>
constexpr glyph (char const *ustr) noexcept
 Constructs a UTF-8 glyph from a char sequence.
 

Public Attributes

union { 
 
   byte   character_ 
 
   byte   ucharacter_ [3] 
 
};  
 
character_set charset_
 

Friends

TERMINALPP_EXPORT constexpr friend auto operator<=> (glyph const &lhs, glyph const &rhs) noexcept
 Relational operators for glyphs.
 
TERMINALPP_EXPORT constexpr friend bool operator== (glyph const &lhs, glyph const &rhs) noexcept
 Equality operator.
 
constexpr friend bool operator< (glyph const &lhs, glyph const &rhs) noexcept
 Less-than operator.
 
std::size_t hash_value (glyph const &gly) noexcept
 Hash function.
 

Detailed Description

A structure that carries around the character attributes of an ANSI element.

Constructor & Destructor Documentation

◆ glyph() [1/2]

constexpr terminalpp::glyph::glyph ( byte const  character = detail::ascii::space,
character_set const  charset = character_set() 
)
inlineconstexprnoexcept

Default Constructor.

Note: the default glyph is chosen as a space character US ASCII character set. That is, it is blank.

◆ glyph() [2/2]

template<class T = void>
constexpr terminalpp::glyph::glyph ( char const ustr)
inlineexplicitconstexprnoexcept

Constructs a UTF-8 glyph from a char sequence.

This constructor is specifically for unicode characters stored as UTF-8. For example:
glyph g(u8"\U00002501");
A structure representing an ANSI graphics effect (e.g. intensity, underlining)
Definition effect.hpp:27
A structure that carries around the character attributes of an ANSI element.
Definition glyph.hpp:19
The result of passing in a sequence that is not a UTF-8 string is undefined.

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