]> git.tdb.fi Git - libs/core.git/blobdiff - source/jisx0201.h
Add copyright notices and Id tags
[libs/core.git] / source / jisx0201.h
index 976a9456f708a150a2d699b2b3c990fe37da535b..8cc1e22c451f675fd5592d579f585f1e6b1506b6 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspstrings
+Copyright © 2006-2007 Mikko Rasa
+Distributed under the LGPL
+*/
+
 #ifndef MSP_STRINGS_JISX201_H_
 #define MSP_STRINGS_JISX201_H_
 
@@ -11,17 +18,21 @@ public:
        class Encoder: public StringCodec::Encoder
        {
        public:
+               Encoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Encoder(em) { }
                void encode_char(wchar_t);
+       private:
+               void append_replacement() { append(032); }
        };
 
        class Decoder: public StringCodec::Decoder
        {
        public:
+               Decoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Decoder(em) { }
                void decode_char(const std::string &, std::string::const_iterator &);
        };
 
-       Encoder *create_encoder() const { return new Encoder; }
-       Decoder *create_decoder() const { return new Decoder; }
+       Encoder *create_encoder(ErrorMode em=THROW_ON_ERROR) const { return new Encoder(em); }
+       Decoder *create_decoder(ErrorMode em=THROW_ON_ERROR) const { return new Decoder(em); }
 };
 
 } // namespace Msp