]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/jisx0208.h
Allow error mode to be specified when creating the codec object
[libs/core.git] / source / stringcodec / jisx0208.h
index 81b39f2104ca5c638fd967b1baaa91abdb03a8b0..c59e44f5481ec32e234f41a6b12b306e248b0bf8 100644 (file)
@@ -11,7 +11,7 @@ Codec for the JIS X 0208 encoding.  This is not particularly useful as a
 stand-alone codec, due to lack of a linefeed character among other things,
 but is included as part of some other encodings.
 */
-class JisX0208: public Codec
+class JisX0208: public StandardCodec<JisX0208>
 {
 public:
        class Encoder: public Codec::Encoder
@@ -32,10 +32,9 @@ public:
                virtual unichar decode_char(const std::string &, std::string::const_iterator &);
        };
 
-       virtual const char *get_name() const { return "JIS X 0208"; }
+       JisX0208(ErrorMode em = THROW_ON_ERROR): StandardCodec<JisX0208>(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 0208"; }
 };