CharsetConverter.hpp
1.47 KB
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
/*
* File: EncodingConverter.hpp
* Author: mlenart
*
* Created on 14 listopad 2013, 17:28
*/
#ifndef ENCODINGCONVERTER_HPP
#define ENCODINGCONVERTER_HPP
#include <cstdint>
#include <string>
class CharsetConverter {
public:
virtual uint32_t peek(const char*& it, const char* end) const = 0;
virtual uint32_t next(const char*& it, const char* end) const = 0;
virtual void append(uint32_t cp, std::string& result) const = 0;
private:
};
class UTF8CharsetConverter: public CharsetConverter {
public:
uint32_t peek(const char*& it, const char* end) const;
uint32_t next(const char*& it, const char* end) const;
void append(uint32_t cp, std::string& result) const;
private:
};
class UTF16CharsetConverter: public CharsetConverter {
public:
uint32_t peek(const char*& it, const char* end) const;
uint32_t next(const char*& it, const char* end) const;
void append(uint32_t cp, std::string& result) const;
private:
};
class UTF32CharsetConverter: public CharsetConverter {
public:
uint32_t peek(const char*& it, const char* end) const;
uint32_t next(const char*& it, const char* end) const;
void append(uint32_t cp, std::string& result) const;
private:
};
class ISO8859_2_CharsetConverter: public CharsetConverter {
public:
uint32_t peek(const char*& it, const char* end) const;
uint32_t next(const char*& it, const char* end) const;
void append(uint32_t cp, std::string& result) const;
private:
};
#endif /* ENCODINGCONVERTER_HPP */