...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::interprocess::basic_bufferstream
// In header: <boost/interprocess/streams/bufferstream.hpp> template<typename CharT, typename CharTraits> class basic_bufferstream { public: // types typedef std::basic_ios< CharT, CharTraits >::char_type char_type; typedef std::basic_ios< char_type, CharTraits >::int_type int_type; typedef std::basic_ios< char_type, CharTraits >::pos_type pos_type; typedef std::basic_ios< char_type, CharTraits >::off_type off_type; typedef std::basic_ios< char_type, CharTraits >::traits_type traits_type; // construct/copy/destruct basic_bufferstream(std::ios_base::openmode = std::ios_base::in|std::ios_base::out); basic_bufferstream(CharT *, std::size_t, std::ios_base::openmode = std::ios_base::in|std::ios_base::out); ~basic_bufferstream(); // public member functions basic_bufferbuf< CharT, CharTraits > * rdbuf() const; std::pair< CharT *, std::size_t > buffer() const; void buffer(CharT *, std::size_t); };
A basic_iostream class that uses a fixed size character buffer as its formatting buffer.
basic_bufferstream
public
construct/copy/destructbasic_bufferstream(std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);
Constructor. Does not throw.
basic_bufferstream(CharT * buffer, std::size_t length, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);
Constructor. Assigns formatting buffer. Does not throw.
~basic_bufferstream();
basic_bufferstream
public member functionsbasic_bufferbuf< CharT, CharTraits > * rdbuf() const;
Returns the address of the stored stream buffer.
std::pair< CharT *, std::size_t > buffer() const;
Returns the pointer and size of the internal buffer. Does not throw.
void buffer(CharT * buffer, std::size_t length);
Sets the underlying buffer to a new value. Resets stream position. Does not throw.