X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fjisx0208.h;h=12dc2c0526a9e94a2e74e1a19edca1980e4445a2;hp=16f82027247c4517d32097d74bca300af1d897ca;hb=d2118ac101602cfe2d62fb7deb6ef3fcb0fe137b;hpb=dbda1bb7f44f289c9f1c5ba9741970ac264d8e5d diff --git a/source/jisx0208.h b/source/jisx0208.h index 16f8202..12dc2c0 100644 --- a/source/jisx0208.h +++ b/source/jisx0208.h @@ -11,12 +11,16 @@ public: class Encoder: public StringCodec::Encoder { public: + Encoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Encoder(em) { } void encode_char(wchar_t); + private: + void append_replacement() { append("!)"); } }; class Decoder: public StringCodec::Decoder { public: + Decoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Decoder(em), high(0) { } void decode_char(const std::string &, std::string::const_iterator &); void sync(); void reset(); @@ -24,8 +28,8 @@ public: char high; }; - 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); } }; extern wchar_t jisx0208_to_ucs(unsigned short);