]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/iso2022jp.h
Allow error mode to be specified when creating the codec object
[libs/core.git] / source / stringcodec / iso2022jp.h
index 91f0166e19a5e0e6f533304c46dba6a5ee679e78..a3f425a95d9c9dd1ddf4a215cdd7454aa3d838a9 100644 (file)
@@ -6,7 +6,7 @@
 namespace Msp {
 namespace StringCodec {
 
-class Iso2022Jp: public Codec
+class Iso2022Jp: public StandardCodec<Iso2022Jp>
 {
 public:
        enum Mode
@@ -47,10 +47,9 @@ public:
                void switch_mode(Mode);
        };
 
-       virtual const char *get_name() const { return "ISO-2022-JP"; }
+       Iso2022Jp(ErrorMode em = THROW_ON_ERROR): StandardCodec<Iso2022Jp>(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