]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/jisx0201.h
Allow error mode to be specified when creating the codec object
[libs/core.git] / source / stringcodec / jisx0201.h
index 7a7223ee7cd3aed7f1b9271a45f74517899dcab4..5521d01e8b002bf6a8303900b7a0b0eac8eb9136 100644 (file)
@@ -6,7 +6,7 @@
 namespace Msp {
 namespace StringCodec {
 
-class JisX0201: public Codec
+class JisX0201: public StandardCodec<JisX0201>
 {
 public:
        class Encoder: public Codec::Encoder
@@ -27,10 +27,9 @@ public:
                virtual unichar decode_char(const std::string &, std::string::const_iterator &);
        };
 
-       virtual const char *get_name() const { return "JIS X 0201"; }
+       JisX0201(ErrorMode em = THROW_ON_ERROR): StandardCodec<JisX0201>(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 "JIS X 0201"; }
 };
 
 } // namespace StringCodec