Chris@102: // (C) Copyright 2013 Vicente J. Botet Escriba Chris@102: // Distributed under the Boost Software License, Version 1.0. (See Chris@102: // accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: Chris@102: #ifndef BOOST_THREAD_OSTREAM_BUFFER_HPP Chris@102: #define BOOST_THREAD_OSTREAM_BUFFER_HPP Chris@102: Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: Chris@102: namespace boost Chris@102: { Chris@102: Chris@102: template Chris@102: class ostream_buffer Chris@102: { Chris@102: public: Chris@102: typedef std::basic_ostringstream stream_type; Chris@102: ostream_buffer(OStream& os) : Chris@102: os_(os) Chris@102: { Chris@102: } Chris@102: ~ostream_buffer() Chris@102: { Chris@102: os_ << o_str_.str(); Chris@102: } Chris@102: stream_type& stream() Chris@102: { Chris@102: return o_str_; Chris@102: } Chris@102: private: Chris@102: OStream& os_; Chris@102: stream_type o_str_; Chris@102: }; Chris@102: Chris@102: } Chris@102: Chris@102: #include Chris@102: Chris@102: #endif // header