UNISTDX_BASE_STREAMBUF_TRAITS
template <class T>
struct sys::streambuf_traits

Traits that abstract read and write operations for stream buffers.

  • With this class it is possible to plug arbitrary object (including another stream buffer) as a source or sink for stream buffer using basic_fildesbuf.
  • Generic implementation is done for std::streambuf.

Types
  • using char_type = T::char_type

    Character type.

Methods
  • in_avail(T & buf) -> std::streamsize

    Check how many bytes are available for reading in buffer buf.

  • is_blocking(const T &) -> bool

    Check if the source/sink is blocking.

  • read(T & buf, char_type * s, std::streamsize n) -> std::streamsize

    Read n bytes to array pointed by s from buffer buf.

  • write(T & buf, const char_type * s, std::streamsize n) -> std::streamsize

    Write n bytes from array pointed by s to buffer buf.