3 This file is part of libmspstrings
4 Copyright © 2006-2007 Mikko Rasa
5 Distributed under the LGPL
8 #ifndef MSP_STRINGS_ISO2022JP_H_
9 #define MSP_STRINGS_ISO2022JP_H_
16 class Iso2022Jp: public Codec
26 class Encoder: public Codec::Encoder
32 Encoder(ErrorMode em = THROW_ON_ERROR): Codec::Encoder(em), mode(ASCII) { }
34 virtual void encode_char(UnicodeChar, std::string &);
35 virtual void sync(std::string &);
38 void switch_mode(Mode, std::string &);
39 virtual void transliterate(UnicodeChar, std::string &);
42 class Decoder: public Codec::Decoder
49 Decoder(ErrorMode =THROW_ON_ERROR);
51 virtual UnicodeChar decode_char(const std::string &, std::string::const_iterator &);
54 void switch_mode(Mode);
57 virtual const char *get_name() const { return "ISO-2022-JP"; }
59 virtual Encoder *create_encoder(ErrorMode em = THROW_ON_ERROR) const { return new Encoder(em); }
60 virtual Decoder *create_decoder(ErrorMode em = THROW_ON_ERROR) const { return new Decoder(em); }