Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template basic_bufferstream

boost::interprocess::basic_bufferstream

Synopsis

// In header: <boost/interprocess/streams/bufferstream.hpp>

template<typename CharT, typename CharTraits> 
class basic_bufferstream : public std::basic_iostream< CharT, CharTraits > {
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;

  // public member functions
  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();
  basic_bufferbuf< CharT, CharTraits > * rdbuf() const;
  std::pair< CharT *, std::size_t > buffer() const;
  std::pair< CharT *, std::size_t > written_buffer() const;
  void buffer(CharT *, std::size_t);
};

Description

A basic_iostream class that uses a fixed size character buffer as its formatting buffer.

basic_bufferstream public member functions

  1. basic_bufferstream(std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);

    Constructor. Does not throw.

  2. basic_bufferstream(CharT * buf, std::size_t length, 
                       std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);

    Constructor. Assigns formatting buffer. Does not throw.

  3. ~basic_bufferstream();
  4. basic_bufferbuf< CharT, CharTraits > * rdbuf() const;

    Returns the address of the stored stream buffer.

  5. std::pair< CharT *, std::size_t > buffer() const;

    Returns the pointer and size of the internal buffer. Does not throw.

  6. std::pair< CharT *, std::size_t > written_buffer() const;

    Returns the pointer and size of the written part of the buffer: in std::ios_base::out mode, from the start of the buffer to the current write position. Otherwise, the whole buffer. Like std::basic_spanstream::span(). Does not throw.

  7. void buffer(CharT * buf, std::size_t length);

    Sets the underlying buffer to a new value. The read position goes to the start of the buffer. The write position goes to the start of the buffer, or to the end of the buffer in std::ios_base::ate mode. Does not throw.


PrevUpHomeNext