From c241f071d26823ce2b6140c2687dcb750f6dfc29 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 20 Oct 2005 16:56:04 +0000 Subject: Added flush() on 'outputStream' + added unit tests for 'charsetFilteredOutputStream' when input contains invalid sequences. --- src/utility/filteredStream.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/utility/filteredStream.cpp') diff --git a/src/utility/filteredStream.cpp b/src/utility/filteredStream.cpp index 57846f96..6c6a8c1a 100644 --- a/src/utility/filteredStream.cpp +++ b/src/utility/filteredStream.cpp @@ -160,6 +160,13 @@ void dotFilteredOutputStream::write } +void dotFilteredOutputStream::flush() +{ + // Do nothing + m_stream.flush(); +} + + // CRLFToLFFilteredOutputStream CRLFToLFFilteredOutputStream::CRLFToLFFilteredOutputStream(outputStream& os) @@ -185,8 +192,8 @@ void CRLFToLFFilteredOutputStream::write const value_type* start = data; // Warning: if the whole buffer finishes with '\r', this - // last character will not be written back... - // TODO: add a finalize() method? + // last character will not be written back if flush() is + // not called if (m_previousChar == '\r') { if (*pos != '\n') @@ -228,6 +235,14 @@ void CRLFToLFFilteredOutputStream::write } +void CRLFToLFFilteredOutputStream::flush() +{ + m_stream.flush(); + + // TODO +} + + // stopSequenceFilteredInputStream <1> template <> -- cgit