class Encoder: public Codec::Encoder
{
public:
- Encoder(ErrorMode em=THROW_ON_ERROR): Codec::Encoder(em) { }
+ Encoder(ErrorMode em = THROW_ON_ERROR): Codec::Encoder(em) { }
+
virtual void encode_char(UnicodeChar, std::string &);
private:
virtual void transliterate(UnicodeChar, std::string &);
class Decoder: public Codec::Decoder
{
public:
- Decoder(ErrorMode em=THROW_ON_ERROR): Codec::Decoder(em) { }
+ 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); }
+ virtual const char *get_name() const { return "JIS X 0208"; }
+
+ 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); }
};
+
struct Kuten
{
unsigned short ku;
unsigned short ten;
Kuten(): ku(0), ten(0) { }
+
operator bool() { return ku!=0 && ten!=0; }
};