]> git.tdb.fi Git - libs/core.git/blob - source/jisx0208.h
16f82027247c4517d32097d74bca300af1d897ca
[libs/core.git] / source / jisx0208.h
1 #ifndef MSP_STRINGS_JISX0208_H_
2 #define MSP_STRINGS_JISX0208_H_
3
4 #include "codec.h"
5
6 namespace Msp {
7
8 class JisX0208: public StringCodec
9 {
10 public:
11         class Encoder: public StringCodec::Encoder
12         {
13         public:
14                 void encode_char(wchar_t);
15         };
16
17         class Decoder: public StringCodec::Decoder
18         {
19         public:
20                 void decode_char(const std::string &, std::string::const_iterator &);
21                 void sync();
22                 void reset();
23         private:
24                 char high;
25         };
26
27         Encoder *create_encoder() const { return new Encoder; }
28         Decoder *create_decoder() const { return new Decoder; }
29 };
30
31 extern wchar_t jisx0208_to_ucs(unsigned short);
32 extern unsigned short ucs_to_jisx0208(wchar_t);
33
34 } // namespace Msp
35
36 #endif