u5e
UnicodeTextC++Library
basic_grapheme.hpp
1 #ifndef INCLUDED_U5E_BASIC_GRAPHEME
2 #define INCLUDED_U5E_BASIC_GRAPHEME
3 
4 namespace u5e {
5  /**
6  * \brief Represents a single grapheme cluster
7  *
8  * It works by holding start and end values for an underlying
9  * encodedstring_view-like object.
10  *
11  * \tparam UnderlyingEncodedStringView a basic_encodedstring
12  * instantiation.
13  */
14  template <typename UnderlyingEncodedStringView>
16  public:
17  /**
18  * const_codepoint_iterator allows you to traverse the codepoints
19  * inside this grapheme.
20  */
21  typedef typename UnderlyingEncodedStringView::const_iterator
23 
24  private:
25  /**
26  * represents where the grapheme starts
27  */
29 
30  /**
31  * represents where the grapheme ends
32  */
34 
35  public:
36  /**
37  * Default constructor is only valid if the underlying type allows it
38  */
40 
41  /**
42  * Construct it with the iterators representing the begin and the
43  * end of the grapheme.
44  */
47  :d_begin(b), d_end(e) {};
48 
49  /**
50  * get the beginning of the codepoints
51  */
53  return d_begin;
54  }
55 
56  /**
57  * get the end of the codepoints
58  */
60  return d_end;
61  }
62  };
63 }
64 
65 #endif
main u5e namespace
UnderlyingEncodedStringView::const_iterator const_codepoint_iterator
const_codepoint_iterator codepoint_end()
basic_grapheme(const_codepoint_iterator b, const_codepoint_iterator e)
Represents a single grapheme cluster.
const_codepoint_iterator codepoint_begin()