tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
character_width.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_TEXT_GRAPHEMESPLITTING_CHARACTERWIDTH_HPP)
8#define TETENGO_TEXT_GRAPHEMESPLITTING_CHARACTERWIDTH_HPP
9
10#include <cstddef>
11
12#include <boost/core/noncopyable.hpp>
13
14
16{
20 class character_width : private boost::noncopyable
21 {
22 public:
23 // types
24
26 enum class class_type
27 {
28 ambiguous,
29 fullwidth,
30 halfwidth,
31 narrow,
32 wide,
33 neutral,
34 };
35
37 enum class emoji_type
38 {
39 emoji,
40 normal,
41 };
42
43
44 // constructors and destructor
45
50
51
52 // functions
53
62 [[nodiscard]] std::size_t width_of(class_type class_, emoji_type emoji) const;
63
64
65 private:
66 // virtual functions
67
68 virtual std::size_t width_of_impl(class_type class_, emoji_type emoji) const = 0;
69 };
70
71
72}
73
74
75#endif
A character width.
Definition character_width.hpp:21
std::size_t width_of(class_type class_, emoji_type emoji) const
Returns the width.
class_type
A class.
Definition character_width.hpp:27
virtual ~character_width()
Destroys the character width.
emoji_type
An emoji.
Definition character_width.hpp:38
A grapheme splitting library.