#ifndef MSP_STRINGCODEC_JISX0208_H_
#define MSP_STRINGCODEC_JISX0208_H_
+#include <msp/core/mspcore_api.h>
#include "codec.h"
namespace Msp {
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<JisX0208>
+class MSPCORE_API JisX0208: public StandardCodec<JisX0208>
{
public:
- class Encoder: public Codec::Encoder
+ class MSPCORE_API Encoder: public Codec::Encoder
{
public:
- Encoder(ErrorMode em = THROW_ON_ERROR): Codec::Encoder(em) { }
+ 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 = THROW_ON_ERROR): Codec::Decoder(em) { }
+ 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 = THROW_ON_ERROR): StandardCodec<JisX0208>(em) { }
+ JisX0208(ErrorMode em = DEFAULT): StandardCodec<JisX0208>(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