]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/jisx0208.h
Add move semantics to Variant
[libs/core.git] / source / stringcodec / jisx0208.h
index c59e44f5481ec32e234f41a6b12b306e248b0bf8..0f29432efbfe91cb042ab8f8ff177d1174ca189e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_STRINGCODEC_JISX0208_H_
 #define MSP_STRINGCODEC_JISX0208_H_
 
+#include <msp/core/mspcore_api.h>
 #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<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; }
 };
 
-extern unichar jisx0208_to_ucs(Kuten);
-extern Kuten ucs_to_jisx0208(unichar);
+MSPCORE_API unichar jisx0208_to_ucs(Kuten);
+MSPCORE_API Kuten ucs_to_jisx0208(unichar);
 
 } // namespace StringCodec
 } // namespace Msp