| Home | Libraries | People | FAQ | More

## Class template basic_obufferstream

boost::interprocess::basic_obufferstream

## Synopsis

    // In header: <boost/interprocess/interprocess_fwd.hpp>

    template<typename CharT, typename CharTraits = std::char_traits<CharT> >
    class basic_obufferstream : public std::basic_ostream< CharT, CharTraits > {
    public:
      // construct/copy/destruct
      basic_obufferstream(std::ios_base::openmode = std::ios_base::out);
      basic_obufferstream(CharT *, std::size_t,
                          std::ios_base::openmode = std::ios_base::out);
      ~basic_obufferstream();

      // public member functions
      basic_bufferbuf< CharT, CharTraits > * rdbuf() const;
      std::pair< CharT *, std::size_t > buffer() const;
      void buffer(CharT *, std::size_t);
    };

## Description

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

### `basic_obufferstream` public construct/copy/destruct

1.     basic_obufferstream(std::ios_base::openmode mode = std::ios_base::out);

   Constructor. Does not throw.

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

   Constructor. Assigns formatting buffer. Does not throw.

3.     ~basic_obufferstream();

### `basic_obufferstream` public member functions

1.     basic_bufferbuf< CharT, CharTraits > * rdbuf() const;

   Returns the address of the stored stream buffer.

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

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

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

   Sets the underlying buffer to a new value. Resets stream position. Does not throw.