libcaf  0.15.3
Public Types | Public Member Functions | Protected Member Functions | List of all members
caf::containerbuf< Container > Class Template Reference

A streambuffer abstraction over a contiguous container. More...

#include <streambuf.hpp>

Inherits basic_streambuf< Container::value_type, std::char_traits< Container::value_type > >.

Public Types

using base = std::basic_streambuf< typename Container::value_type, std::char_traits< typename Container::value_type > >
 
using char_type = typename base::char_type
 
using traits_type = typename base::traits_type
 
using int_type = typename base::int_type
 
using pos_type = typename base::pos_type
 
using off_type = typename base::off_type
 

Public Member Functions

template<class C = Container, class = typename std::enable_if< detail::has_data_member<C>::value && detail::has_size_member<C>::value >::type>
 containerbuf (Container &c)
 Constructs a container streambuf. More...
 
 containerbuf (containerbuf &&other)
 
containerbufoperator= (containerbuf &&other)
 
int_type sgetc ()
 
int_type sputc (char_type c)
 

Protected Member Functions

std::streamsize xsgetn (char_type *s, std::streamsize n) override
 
int_type overflow (int_type c=traits_type::eof()) final
 
std::streamsize xsputn (const char_type *s, std::streamsize n) override
 

Detailed Description

template<class Container>
class caf::containerbuf< Container >

A streambuffer abstraction over a contiguous container.

It supports reading in the same style as arraybuf, but is unbounded for output.

Constructor & Destructor Documentation

template<class Container >
template<class C = Container, class = typename std::enable_if< detail::has_data_member<C>::value && detail::has_size_member<C>::value >::type>
caf::containerbuf< Container >::containerbuf ( Container &  c)

Constructs a container streambuf.

Parameters
cA contiguous container.

The documentation for this class was generated from the following file: