]> git.tdb.fi Git - libs/core.git/blobdiff - source/iso646fi.h
Rework the codec API completely to remove the internal buffering
[libs/core.git] / source / iso646fi.h
index 5299054ee4a50e9afce30ce24827b6ecd4e80967..8f38a29d5b399ccd2bd30d9079d91420869e46e7 100644 (file)
@@ -11,30 +11,32 @@ Distributed under the LGPL
 #include "codec.h"
 
 namespace Msp {
 #include "codec.h"
 
 namespace Msp {
+namespace Codecs {
 
 
-class Iso646Fi: public StringCodec
+class Iso646Fi: public Codec
 {
 public:
 {
 public:
-       class Encoder: public StringCodec::Encoder
+       class Encoder: public Codec::Encoder
        {
        public:
        {
        public:
-               Encoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Encoder(em) { }
-               void encode_char(wchar_t);
+               Encoder(ErrorMode em=THROW_ON_ERROR): Codec::Encoder(em) { }
+               virtual void encode_char(UnicodeChar, std::string &);
        private:
        private:
-               void append_replacement() { append(032); }
+               virtual void transliterate(UnicodeChar, std::string &);
        };
 
        };
 
-       class Decoder: public StringCodec::Decoder
+       class Decoder: public Codec::Decoder
        {
        public:
        {
        public:
-               Decoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Decoder(em) { }
-               void decode_char(const std::string &, std::string::const_iterator &);
+               Decoder(ErrorMode em=THROW_ON_ERROR): Codec::Decoder(em) { }
+               virtual UnicodeChar decode_char(const std::string &, std::string::const_iterator &);
        };
 
        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); }
 };
 
        };
 
        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 Codecs
 } // namespace Msp
 
 #endif
 } // namespace Msp
 
 #endif