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_
15 class Iso2022Jp: public StringCodec
25 class Encoder: public StringCodec::Encoder
28 Encoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Encoder(em), mode(ASCII) { }
29 void encode_char(wchar_t);
34 void switch_mode(Mode);
35 void append_replacement();
38 class Decoder: public StringCodec::Decoder
41 Decoder(ErrorMode =THROW_ON_ERROR);
42 void decode_char(const std::string &, std::string::const_iterator &);
46 StringCodec::Decoder *dec;
49 void switch_mode(Mode);
52 Encoder *create_encoder(ErrorMode em=THROW_ON_ERROR) const { return new Encoder(em); }
53 Decoder *create_decoder(ErrorMode em=THROW_ON_ERROR) const { return new Decoder(em); }