X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Flatin1.h;h=1dc52e3fc3781ce59911d26ea08408cd61227ee4;hb=9da6abdcabec59f4845da256a8ad75a810ed1589;hp=20eb426d7ef41d3672bf29c130da29a866706b73;hpb=58384e355b4a78730d69243f1092e47591f2f384;p=libs%2Fcore.git diff --git a/source/latin1.h b/source/latin1.h index 20eb426..1dc52e3 100644 --- a/source/latin1.h +++ b/source/latin1.h @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of libmspstrings +Copyright © 2006-2007 Mikko Rasa +Distributed under the LGPL +*/ + #ifndef MSP_STRINGS_LATIN1_H_ #define MSP_STRINGS_LATIN1_H_ @@ -11,17 +18,21 @@ public: class Encoder: public StringCodec::Encoder { public: + Encoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Encoder(em) { } void encode_char(wchar_t); + private: + void append_replacement() { append(032); } }; class Decoder: public StringCodec::Decoder { public: + Decoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Decoder(em) { } void decode_char(const std::string &, std::string::const_iterator &); }; - Encoder *create_encoder() const { return new Encoder; } - Decoder *create_decoder() const { return new Decoder; } + Encoder *create_encoder(ErrorMode em=THROW_ON_ERROR) const { return new Encoder(em); } + Decoder *create_decoder(ErrorMode em=THROW_ON_ERROR) const { return new Decoder(em); } }; } // namespace Msp