tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
tetengo::text::grapheme Class Reference

A grapheme. More...

#include <grapheme_splitter.hpp>

+ Inheritance diagram for tetengo::text::grapheme:
+ Collaboration diagram for tetengo::text::grapheme:

Public Member Functions

constexpr grapheme (std::size_t offset, std::size_t width)
 Creates a grapheme.
 
constexpr std::size_t offset () const
 Returns the offset in the UTF-8 string.
 
constexpr std::size_t width () const
 Returns the width when using a monospace font.
 

Friends

constexpr bool operator== (const grapheme &one, const grapheme &another)
 Returns true when one grapheme is equal to another.
 

Detailed Description

A grapheme.

Constructor & Destructor Documentation

◆ grapheme()

tetengo::text::grapheme::grapheme ( std::size_t offset,
std::size_t width )
inlineconstexpr

Creates a grapheme.

Parameters
offsetAn offset in the UTF-8 string.
widthA width when using a monospace font.

Member Function Documentation

◆ offset()

std::size_t tetengo::text::grapheme::offset ( ) const
inlinenodiscardconstexpr

Returns the offset in the UTF-8 string.

Returns
The offset.

◆ width()

std::size_t tetengo::text::grapheme::width ( ) const
inlinenodiscardconstexpr

Returns the width when using a monospace font.

Returns
The width.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const grapheme & one,
const grapheme & another )
friend

Returns true when one grapheme is equal to another.

Parameters
oneOne grapheme.
anotherAnother grapheme.
Return values
trueWhen one is equal to another.
falseOtherwise.

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