X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fstringcodec%2Fjisx0208.h;h=0f29432efbfe91cb042ab8f8ff177d1174ca189e;hb=HEAD;hp=293d2774304d1c27a41c061f9801e76a50260b22;hpb=017feade2799ddbecad62b9a7911bf4d3e229dad;p=libs%2Fcore.git diff --git a/source/stringcodec/jisx0208.h b/source/stringcodec/jisx0208.h index 293d277..0f29432 100644 --- a/source/stringcodec/jisx0208.h +++ b/source/stringcodec/jisx0208.h @@ -1,6 +1,7 @@ #ifndef MSP_STRINGCODEC_JISX0208_H_ #define MSP_STRINGCODEC_JISX0208_H_ +#include #include "codec.h" namespace Msp { @@ -11,45 +12,43 @@ 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 StandardCodec +class MSPCORE_API JisX0208: public StandardCodec { public: - class Encoder: public Codec::Encoder + class MSPCORE_API Encoder: public Codec::Encoder { public: Encoder(ErrorMode em = DEFAULT): Codec::Encoder(em) { } - virtual void encode_char(unichar, std::string &); + void encode_char(unichar, std::string &) override; private: - virtual void transliterate(unichar, std::string &); + void transliterate(unichar, std::string &) override; }; - class Decoder: public Codec::Decoder + class MSPCORE_API Decoder: public Codec::Decoder { public: Decoder(ErrorMode em = DEFAULT): Codec::Decoder(em) { } - virtual unichar decode_char(const std::string &, std::string::const_iterator &); + unichar decode_char(const std::string &, std::string::const_iterator &) override; }; JisX0208(ErrorMode em = DEFAULT): StandardCodec(em) { } - virtual const char *get_name() const { return "JIS X 0208"; } + const char *get_name() const override { return "JIS X 0208"; } }; struct Kuten { - unsigned short ku; - unsigned short ten; + unsigned short ku = 0; + unsigned short ten = 0; - Kuten(): ku(0), ten(0) { } - - operator bool() { return ku!=0 && ten!=0; } + explicit operator bool() { return ku!=0 && ten!=0; } }; -unichar jisx0208_to_ucs(Kuten); -Kuten ucs_to_jisx0208(unichar); +MSPCORE_API unichar jisx0208_to_ucs(Kuten); +MSPCORE_API Kuten ucs_to_jisx0208(unichar); } // namespace StringCodec } // namespace Msp