X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstringcodec%2Fcodec.h;h=5e67d46049078f3555994eeca393ce9691bf75f8;hp=efa165784ac2988f674c0c6be5794c3a1a44c63d;hb=991fabc1956b73a4007859058fb44171000b452e;hpb=122846f0881673770d88eff7d925ecf25c01b62e diff --git a/source/stringcodec/codec.h b/source/stringcodec/codec.h index efa1657..5e67d46 100644 --- a/source/stringcodec/codec.h +++ b/source/stringcodec/codec.h @@ -43,7 +43,7 @@ public: Encoder(ErrorMode em): err_mode(em==DEFAULT ? THROW_ON_ERROR : em) { } public: - virtual ~Encoder() { } + virtual ~Encoder() = default; /** Encodes a single unicode character. If the character can't be represented in this encoding, error() should be called. */ @@ -94,7 +94,7 @@ public: Decoder(ErrorMode em): err_mode(em==DEFAULT ? THROW_ON_ERROR : em) { } public: - virtual ~Decoder() { } + virtual ~Decoder() = default; /** Decodes a single character from a string. The iterator is advanced to the next character. For stateful codecs, -1 may be returned if a @@ -131,9 +131,9 @@ public: }; protected: - Codec() { } + Codec() = default; public: - virtual ~Codec() { } + virtual ~Codec() = default; /** Returns the name of the encoding handled by this codec. */ virtual const char *get_name() const = 0; @@ -171,10 +171,10 @@ protected: { return (em==DEFAULT ? err_mode : em); } public: - virtual Encoder *create_encoder(ErrorMode em = DEFAULT) const + Encoder *create_encoder(ErrorMode em = DEFAULT) const override { return new typename C::Encoder(get_error_mode(em)); } - virtual Decoder *create_decoder(ErrorMode em = DEFAULT) const + Decoder *create_decoder(ErrorMode em = DEFAULT) const override { return new typename C::Decoder(get_error_mode(em)); } };