]> git.tdb.fi Git - libs/core.git/blobdiff - source/codec.h
Added reset function for StringCodec::Decoder
[libs/core.git] / source / codec.h
index d5ba595b3b3ee765caa574479c766c92f27281c8..5fb29db29b305577582e6ed56c58f3bda61d823c 100644 (file)
@@ -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(); }