]> git.tdb.fi Git - libs/core.git/blob - source/stringcodec/windows1252.h
Use native CreateDirectory/RemoveDirectory calls on Windows
[libs/core.git] / source / stringcodec / windows1252.h
1 #ifndef MSP_STRINGCODEC_WINDOWS1252_H_
2 #define MSP_STRINGCODEC_WINDOWS1252_H_
3
4 #include "codec.h"
5
6 namespace Msp {
7 namespace StringCodec {
8
9 class Windows1252: public StandardCodec<Windows1252>
10 {
11 public:
12         class Encoder: public Codec::Encoder
13         {
14         public:
15                 Encoder(ErrorMode em = THROW_ON_ERROR): Codec::Encoder(em) { }
16
17                 virtual void encode_char(unichar, std::string &);
18         private:
19                 virtual void transliterate(unichar, std::string &);
20         };
21
22         class Decoder: public Codec::Decoder
23         {
24         public:
25                 Decoder(ErrorMode em = THROW_ON_ERROR): Codec::Decoder(em) { }
26
27                 virtual unichar decode_char(const std::string &, std::string::const_iterator &);
28         };
29
30         Windows1252(ErrorMode em = THROW_ON_ERROR): StandardCodec<Windows1252>(em) { }
31
32         virtual const char *get_name() const { return "Windows-1252"; }
33 };
34
35 } // namespace StringCodec
36 } // namespace Msp
37
38 #endif