]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/iso88591.h
Allow error mode to be specified when creating the codec object
[libs/core.git] / source / stringcodec / iso88591.h
index 806bdb1de7d1420c701d5e99dd6ae4d08447e0c1..5c59fae5f9eccbdce443765e620ea345271854fd 100644 (file)
@@ -6,7 +6,7 @@
 namespace Msp {
 namespace StringCodec {
 
-class Iso88591: public Codec
+class Iso88591: public StandardCodec<Iso88591>
 {
 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 "ISO-8859-1"; }
+       Iso88591(ErrorMode em = THROW_ON_ERROR): StandardCodec<Iso88591>(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-8859-1"; }
 };
 
 } // namespace StringCodec