tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
grapheme_segment.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_TEXT_GRAPHEMESPLITTING_GRAPHEMESEGMENT_HPP)
8#define TETENGO_TEXT_GRAPHEMESPLITTING_GRAPHEMESEGMENT_HPP
9
10#include <cstddef>
11#include <memory>
12#include <vector>
13
14#include <boost/core/noncopyable.hpp>
15
16
18{
22 class grapheme_segment : private boost::noncopyable
23 {
24 public:
25 // types
26
29 {
30 cr,
31 lf,
32 control,
33 extend,
34 zwj,
35 regional,
36 prepend,
38 l,
39 v,
40 t,
41 lv,
42 lvt,
43 other,
44 };
45
46
47 // static functions
48
54 static const grapheme_segment& instance();
55
56
57 // constructors and destructor
58
63
64
65 // functions
66
98 std::vector<std::size_t> segment_offsets(const std::vector<break_property_type>& break_properties) const;
99
100
101 private:
102 // types
103
104 class impl;
105
106
107 // variables
108
109 const std::unique_ptr<impl> m_p_impl;
110
111
112 // constructors
113
115 };
116
117
118}
119
120
121#endif
A grapheme segment.
Definition grapheme_segment.hpp:23
static const grapheme_segment & instance()
Returns the instance.
~grapheme_segment()
Destroys the grapheme segment.
break_property_type
A break peoperty type.
Definition grapheme_segment.hpp:29
std::vector< std::size_t > segment_offsets(const std::vector< break_property_type > &break_properties) const
Returns the grapheme offsets.
A grapheme splitting library.