X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstringcodec%2Fiso2022jp.h;h=aa5c78b9d4de5bf23a2428c1cdffde7013ab0537;hp=73ffec3e71eda5a158798cc37bbb803ba4d5623c;hb=0f32d120e05ebc207dcd2ea733714f29795cb26b;hpb=056dc68dfc606a2c14126a70321045d6d9f12e0e diff --git a/source/stringcodec/iso2022jp.h b/source/stringcodec/iso2022jp.h index 73ffec3..aa5c78b 100644 --- a/source/stringcodec/iso2022jp.h +++ b/source/stringcodec/iso2022jp.h @@ -6,7 +6,7 @@ namespace Msp { namespace StringCodec { -class Iso2022Jp: public Codec +class Iso2022Jp: public StandardCodec { public: enum Mode @@ -22,14 +22,14 @@ public: Mode mode; public: - Encoder(ErrorMode em = THROW_ON_ERROR): Codec::Encoder(em), mode(ASCII) { } + Encoder(ErrorMode em = DEFAULT): Codec::Encoder(em), mode(ASCII) { } - virtual void encode_char(UnicodeChar, std::string &); + virtual void encode_char(unichar, std::string &); virtual void sync(std::string &); virtual void reset(); private: void switch_mode(Mode, std::string &); - virtual void transliterate(UnicodeChar, std::string &); + virtual void transliterate(unichar, std::string &); }; class Decoder: public Codec::Decoder @@ -39,18 +39,17 @@ public: Codec::Decoder *dec; public: - Decoder(ErrorMode =THROW_ON_ERROR); + Decoder(ErrorMode = DEFAULT); - virtual UnicodeChar decode_char(const std::string &, std::string::const_iterator &); + virtual unichar decode_char(const std::string &, std::string::const_iterator &); virtual void reset(); private: void switch_mode(Mode); }; - virtual const char *get_name() const { return "ISO-2022-JP"; } + Iso2022Jp(ErrorMode em = DEFAULT): StandardCodec(em) { } - virtual Encoder *create_encoder(ErrorMode em = THROW_ON_ERROR) const { return new Encoder(em); } - virtual Decoder *create_decoder(ErrorMode em = THROW_ON_ERROR) const { return new Decoder(em); } + virtual const char *get_name() const { return "ISO-2022-JP"; } }; } // namespace StringCodec