This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle_byte_encoding.hpp
143 lines (107 loc) · 2.61 KB
/
single_byte_encoding.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#pragma once
/**
* Copyright (C) 2020 Tristan. All Rights Reserved.
* This file is licensed under the BSD 2-Clause license.
* See the COPYING file for licensing information.
*/
#include <vector>
#include "data/text/unicode.hpp"
#include "encoding.hpp"
namespace TextEncoding {
/**
* The Abstract SingleByte Encodings
*/
class AbstractSBEncoding : public Encoding {
private: // Private Properties
const std::vector<Unicode::CodePoint> &Indices;
public:
inline explicit AbstractSBEncoding(const std::vector<Unicode::CodePoint> &indices) : Indices(indices) {
}
inline ~AbstractSBEncoding() override {
}
[[nodiscard]] bool
Decode(const char *data, std::size_t size) override;
};
/* https://encoding.spec.whatwg.org/index-ibm866.txt */
struct IBM866 : public AbstractSBEncoding {
IBM866();
};
struct ISO8859_2 : public AbstractSBEncoding {
ISO8859_2();
};
struct ISO8859_3 : public AbstractSBEncoding {
ISO8859_3();
};
struct ISO8859_4 : public AbstractSBEncoding {
ISO8859_4();
};
struct ISO8859_5 : public AbstractSBEncoding {
ISO8859_5();
};
struct ISO8859_6 : public AbstractSBEncoding {
ISO8859_6();
};
struct ISO8859_7 : public AbstractSBEncoding {
ISO8859_7();
};
struct ISO8859_8 : public AbstractSBEncoding {
ISO8859_8();
};
struct ISO8859_10 : public AbstractSBEncoding {
ISO8859_10();
};
struct ISO8859_13 : public AbstractSBEncoding {
ISO8859_13();
};
struct ISO8859_14 : public AbstractSBEncoding {
ISO8859_14();
};
struct ISO8859_15 : public AbstractSBEncoding {
ISO8859_15();
};
struct ISO8859_16 : public AbstractSBEncoding {
ISO8859_16();
};
struct KOI8_R : public AbstractSBEncoding {
KOI8_R();
};
struct KOI8_U : public AbstractSBEncoding {
KOI8_U();
};
struct Macintosh : public AbstractSBEncoding {
Macintosh();
};
struct Windows874 : public AbstractSBEncoding {
Windows874();
};
struct Windows1250 : public AbstractSBEncoding {
Windows1250();
};
struct Windows1251 : public AbstractSBEncoding {
Windows1251();
};
struct Windows1252 : public AbstractSBEncoding {
Windows1252();
};
struct Windows1253 : public AbstractSBEncoding {
Windows1253();
};
struct Windows1254 : public AbstractSBEncoding {
Windows1254();
};
struct Windows1255 : public AbstractSBEncoding {
Windows1255();
};
struct Windows1256 : public AbstractSBEncoding {
Windows1256();
};
struct Windows1257 : public AbstractSBEncoding {
Windows1257();
};
struct Windows1258 : public AbstractSBEncoding {
Windows1258();
};
struct XMacCyrillic : public AbstractSBEncoding {
XMacCyrillic();
};
} // namespace TextEncoding