1 #ifndef INCLUDED_U5E_BASIC_GRAPHEME_ITERATOR 2 #define INCLUDED_U5E_BASIC_GRAPHEME_ITERATOR 4 #include <u5e/basic_grapheme.hpp> 5 #include <u5e/props/grapheme_cluster_break.hpp> 15 template <
typename UnderlyingEncodedStringView>
16 class basic_grapheme_iterator {
57 if (va == g_c_b_vt::CR &&
61 }
else if (va == g_c_b_vt::CR ||
63 va == g_c_b_vt::CONTROL) {
66 }
else if (vb == g_c_b_vt::CR ||
68 vb == g_c_b_vt::CONTROL) {
71 }
else if (va == g_c_b_vt::L &&
75 vb == g_c_b_vt::LVT)) {
78 }
else if ((va == g_c_b_vt::LV ||
84 }
else if ((va == g_c_b_vt::LVT ||
89 }
else if (vb == g_c_b_vt::EXTEND ||
90 vb == g_c_b_vt::ZWJ) {
93 }
else if (vb == g_c_b_vt::SPACINGMARK) {
96 }
else if (va == g_c_b_vt::PREPEND) {
99 }
else if ( ( (va == g_c_b_vt::E_BASE ||
100 va == g_c_b_vt::E_BASE_GAZ) &&
101 vb == g_c_b_vt::E_MODIFIER) ||
102 ( va == g_c_b_vt::EXTEND &&
103 vb == g_c_b_vt::E_MODIFIER )) {
109 }
else if (va == g_c_b_vt::ZWJ &&
110 (vb == g_c_b_vt::GLUE_AFTER_ZWJ ||
111 vb == g_c_b_vt::E_BASE_GAZ)) {
114 }
else if (va == g_c_b_vt::REGIONAL_INDICATOR &&
115 vb == g_c_b_vt::REGIONAL_INDICATOR) {
241 basic_grapheme_iterator copy(*
this);
286 return !(*
this == other);
294 return !(*
this == other);
Grapheme Cluster Break property for a codepoint.
basic_grapheme_iterator(const_codepoint_iterator b, const_codepoint_iterator e, const_codepoint_iterator w)
start at a specific point find the start and the end of the grapheme
bool is_grapheme_boundary(codepoint a, codepoint b)
bool operator!=(const_codepoint_iterator other)
const_codepoint_iterator end_of_grapheme_
basic_grapheme_iterator(const_codepoint_iterator b, const_codepoint_iterator e)
start at the beginning of the text
const_codepoint_iterator end_
Native representation of a codepoint.
bool operator==(const_codepoint_iterator other)
basic_grapheme_iterator(const_codepoint_iterator b, const_codepoint_iterator e, const_codepoint_iterator w, const_codepoint_iterator we)
start at a specific point - precalculated start and end of grapheme
constexpr codepoint & operator=(const codepoint &x)=default
basic_grapheme_iterator(const basic_grapheme_iterator ©)
copy constructor
static prop_value_type resolve(codepoint c)
bool operator==(basic_grapheme_iterator other)
basic_grapheme_iterator operator++()
void find_start_of_grapheme()
void find_end_of_grapheme()
basic_grapheme< UnderlyingEncodedStringView > grapheme
bool operator!=(basic_grapheme_iterator other)
const_codepoint_iterator where_
const_codepoint_iterator begin_
UnderlyingEncodedStringView::const_iterator const_codepoint_iterator
Represents a single grapheme cluster.
codepoint property handling
basic_grapheme_iterator operator++(int i)