X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fjisx0208.h;fp=source%2Fjisx0208.h;h=0c4c4a6d06ea04a86ba3a9f5c4b80de1c44b1404;hp=27609e619ddc1dcd3e0669e98f0cd26090b18548;hb=5b1368cb791cab043f0435628cacbaff36e39b7b;hpb=36f9e78ae75f5e14b132f37d249340ad3480b8ce diff --git a/source/jisx0208.h b/source/jisx0208.h index 27609e6..0c4c4a6 100644 --- a/source/jisx0208.h +++ b/source/jisx0208.h @@ -24,7 +24,8 @@ public: 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 &); @@ -33,22 +34,25 @@ public: 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 &); }; 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); } + 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; } };