3#include "terminalpp/character_set.hpp" 
    4#include "terminalpp/core.hpp" 
    5#include "terminalpp/detail/ascii.hpp" 
    7#include <boost/container_hash/hash.hpp> 
   28        byte const character = detail::ascii::space,
 
   30      : character_(
character), charset_(charset)
 
 
   38      : ucharacter_{
text[0]}, charset_(terminalpp::charset::utf8)
 
 
   46      : ucharacter_{
text[0], 
text[1]}, charset_(terminalpp::charset::utf8)
 
 
   55        charset_(terminalpp::charset::utf8)
 
 
   63      : ucharacter_{
text[0]}, charset_(terminalpp::charset::utf8)
 
 
   71      : ucharacter_{
text[0], 
text[1]}, charset_(terminalpp::charset::utf8)
 
 
   80        charset_(terminalpp::charset::utf8)
 
 
   95    template <
class T = 
void>  
 
   99      : ucharacter_{0}, charset_(terminalpp::charset::utf8)
 
  101        for (
size_t index = 0; index < 
sizeof(ucharacter_); ++index)
 
  103            ucharacter_[index] = 
static_cast<byte>(
ustr[index]);
 
  105            if (!(ucharacter_[index] & 0x80))
 
 
  119        if (
lhs < 
rhs) 
return std::strong_ordering::less;     
 
  120        if (
rhs < 
lhs) 
return std::strong_ordering::greater;  
 
  121        return std::strong_ordering::equal;
 
 
  131        if (
lhs.charset_ == 
rhs.charset_)
 
  133            if (
lhs.charset_ == terminalpp::charset::utf8)
 
  139                for (
auto lch = begin(
lhs.ucharacter_),
 
  140                          rch = begin(
rhs.ucharacter_);
 
  141                     lch != end(
lhs.ucharacter_);
 
  154                return lhs.character_ == 
rhs.character_;
 
 
  167        if (
lhs.charset_ < 
rhs.charset_)
 
  172        if (
lhs.charset_ == 
rhs.charset_)
 
  174            if (
lhs.charset_ == terminalpp::charset::utf8)
 
  181                for (
auto begin1 = begin(
lhs.ucharacter_),
 
  197            return lhs.character_ < 
rhs.character_;
 
 
  208        std::size_t 
seed = 0;
 
  209        boost::hash_combine(
seed, 
gly.charset_);
 
  211        if (
gly.charset_ == terminalpp::charset::utf8)
 
  213            for (
auto ch : 
gly.ucharacter_)
 
  215                boost::hash_combine(
seed, 
ch);
 
  220            boost::hash_combine(
seed, 
gly.character_);
 
 
  232    character_set charset_;
 
 
  239bool is_printable(glyph 
const &gly) 
noexcept;
 
  246std::ostream &operator<<(std::ostream &out, glyph 
const &gly);
 
  253struct hash<terminalpp::glyph>
 
  256    using result_type = std::size_t;
 
  258    [[nodiscard]] result_type operator()(
 
  261        return hash_value(elem);
 
 
A structure that represents a character set.
Definition character_set.hpp:44
 
A structure representing an ANSI graphics effect (e.g. intensity, underlining)
Definition effect.hpp:27
 
constexpr effect() noexcept
Initialises the intensity to the default (normal) value.
Definition effect.hpp:31
 
A structure that carries around the character attributes of an ANSI element.
Definition glyph.hpp:19
 
friend std::size_t hash_value(glyph const &gly) noexcept
Hash function.
Definition glyph.hpp:206
 
constexpr glyph(byte const (&text)[4]) noexcept
Constructs a UTF-8 glyph from a char sequence.
Definition glyph.hpp:53
 
constexpr glyph(char8_t const (&text)[4]) noexcept
Constructs a UTF-8 glyph from a char sequence.
Definition glyph.hpp:78
 
constexpr glyph(char8_t const (&text)[2]) noexcept
Constructs a UTF-8 glyph from a char sequence.
Definition glyph.hpp:62
 
constexpr friend bool operator<(glyph const &lhs, glyph const &rhs) noexcept
Less-than operator.
Definition glyph.hpp:164
 
constexpr glyph(byte const (&text)[2]) noexcept
Constructs a UTF-8 glyph from a char sequence.
Definition glyph.hpp:37
 
constexpr glyph(char8_t const (&text)[3]) noexcept
Constructs a UTF-8 glyph from a char sequence.
Definition glyph.hpp:70
 
constexpr glyph(char const *ustr) noexcept
Constructs a UTF-8 glyph from a char sequence.
Definition glyph.hpp:98
 
constexpr glyph(byte const character=detail::ascii::space, character_set const charset=character_set()) noexcept
Default Constructor.
Definition glyph.hpp:27
 
constexpr glyph(byte const (&text)[3]) noexcept
Constructs a UTF-8 glyph from a char sequence.
Definition glyph.hpp:45
 
TERMINALPP_EXPORT constexpr friend bool operator==(glyph const &lhs, glyph const &rhs) noexcept
Equality operator.
Definition glyph.hpp:128
 
TERMINALPP_EXPORT constexpr friend auto operator<=>(glyph const &lhs, glyph const &rhs) noexcept
Relational operators for glyphs.
Definition glyph.hpp:116