X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcodec.h;h=5fb29db29b305577582e6ed56c58f3bda61d823c;hp=d5ba595b3b3ee765caa574479c766c92f27281c8;hb=51b84c0c2c3abb0cf7e815c5ae259face40ac977;hpb=ebd23ef7dde39a35e9ffdfb5be31934507cefaad diff --git a/source/codec.h b/source/codec.h index d5ba595..5fb29db 100644 --- a/source/codec.h +++ b/source/codec.h @@ -91,11 +91,17 @@ public: { for(std::string::const_iterator i=s.begin(); i!=s.end(); ) decode_char(s, i); } /** - Ensures that all input has been processed. An exception is thrown if - this is not the case. + Ensures that all input has been processed. If this is not the case any + buffers are cleared and an exception is thrown, */ virtual void sync() { } + /** + Resets the decoder, clearing a possibly erroneus state. Does not flush + the internal buffer. + */ + virtual void reset() { } + const std::wstring &get() const { return buffer_; } unsigned size() const { return buffer_.size(); } void flush() { buffer_.clear(); }