--- code_converter.hpp.orig Sat Mar 22 22:45:55 2008 +++ code_converter.hpp Wed Jul 9 14:02:46 2008 @@ -198,6 +198,19 @@ } } + bool flush() + { + if (!is_open()) + throw BOOST_IOSTREAMS_FAILURE("not open"); + if ((flags_ & f_input_closed) != 0) + throw BOOST_IOSTREAMS_FAILURE("already closed"); + detail::execute_all( + detail::flush_buffer(buf_.first(), dev(), can_read::value), + detail::flush_buffer(buf_.second(), dev(), can_write::value) + ); + return iostreams::flush(dev()); + } + bool is_open() const { return (flags_ & f_open) != 0;} policy_type& dev() { return **dev_; } @@ -252,7 +265,7 @@ public: typedef intern_type char_type; struct category - : impl_type::mode, device_tag, closable_tag, localizable_tag + : impl_type::mode, device_tag, closable_tag, flushable_tag, localizable_tag { }; BOOST_STATIC_ASSERT(( is_same< @@ -279,6 +292,8 @@ bool is_open() const { return this->pimpl_->is_open(); } void close(BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out ) { impl().close(which); } + bool flush() + { return impl().flush(); } // Device interface.