|
CAF 0.17.6
|
A streambuffer abstraction over a fixed array of bytes. More...
#include <streambuf.hpp>
Public Types | |
| using | base = std::basic_streambuf< CharT, Traits > |
| 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 Types inherited from caf::stream_buffer< CharT, Traits > | |
| using | base = std::basic_streambuf< CharT, Traits > |
| using | pos_type = typename base::pos_type |
| using | off_type = typename base::off_type |
Public Member Functions | |
| template<class Container , class = typename std::enable_if< detail::has_data_member<Container>::value && detail::has_size_member<Container>::value >::type> | |
| arraybuf (Container &c) | |
| Constructs an array streambuffer from a container. | |
| arraybuf (char_type *data, size_t size) | |
| Constructs an array streambuffer from a raw character sequence. | |
| arraybuf (arraybuf &&other) | |
| arraybuf & | operator= (arraybuf &&other) |
Protected Member Functions | |
| std::basic_streambuf< char_type, Traits > * | setbuf (char_type *s, std::streamsize n) override |
| pos_type | seekpos (pos_type pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) override |
| pos_type | seekoff (off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which) override |
| std::streamsize | xsputn (const char_type *s, std::streamsize n) override |
| std::streamsize | xsgetn (char_type *s, std::streamsize n) override |
Protected Member Functions inherited from caf::stream_buffer< CharT, Traits > | |
| template<class T = int> | |
| std::enable_if< sizeof(T)==4 >::type | safe_pbump (std::streamsize n) |
| The standard only defines pbump(int), which can overflow on 64-bit architectures. | |
| template<class T = int> | |
| std::enable_if< sizeof(T)==8 >::type | safe_pbump (std::streamsize n) |
| template<class T = int> | |
| std::enable_if< sizeof(T)==4 >::type | safe_gbump (std::streamsize n) |
| template<class T = int> | |
| std::enable_if< sizeof(T)==8 >::type | safe_gbump (std::streamsize n) |
| pos_type | default_seekoff (off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which) |
| pos_type | default_seekpos (pos_type pos, std::ios_base::openmode which) |
A streambuffer abstraction over a fixed array of bytes.
This streambuffer cannot overflow/underflow. Once it has reached its end, attempts to read characters will return trait_type::eof.
| caf::arraybuf< CharT, Traits >::arraybuf | ( | Container & | c | ) |
Constructs an array streambuffer from a container.
| c | A contiguous container. |
c.data() must point to a contiguous sequence of characters having length c.size(). | caf::arraybuf< CharT, Traits >::arraybuf | ( | char_type * | data, |
| size_t | size | ||
| ) |
Constructs an array streambuffer from a raw character sequence.
| data | A pointer to the first character. |
| size | The length of the character sequence. |