+/* $Id$
+
+This file is part of libmspstrings
+Copyright © 2006-2007 Mikko Rasa
+Distributed under the LGPL
+*/
+
#ifndef MSP_STRINGS_ISO2022JP_H_
#define MSP_STRINGS_ISO2022JP_H_
class Encoder: public StringCodec::Encoder
{
public:
- Encoder(): mode(ASCII) { }
+ Encoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Encoder(em), mode(ASCII) { }
void encode_char(wchar_t);
void sync();
private:
Mode mode;
void switch_mode(Mode);
+ void append_replacement();
};
class Decoder: public StringCodec::Decoder
{
public:
- Decoder();
+ Decoder(ErrorMode =THROW_ON_ERROR);
void decode_char(const std::string &, std::string::const_iterator &);
void sync();
- void reset();
private:
Mode mode;
StringCodec::Decoder *dec;
void switch_mode(Mode);
};
- Encoder *create_encoder() const { return new Encoder; }
- Decoder *create_decoder() const { return new Decoder; }
+ Encoder *create_encoder(ErrorMode em=THROW_ON_ERROR) const { return new Encoder(em); }
+ Decoder *create_decoder(ErrorMode em=THROW_ON_ERROR) const { return new Decoder(em); }
};
} // namespace Msp