UNISTDX_IO_FILDESBUF
using fildesbuf = basic_fildesbuf< char >

Alias to basic_fildesbuf<char>.

template <class Ch, class Tr = std::char_traits<Ch>, class Fd = sys::fildes>
class sys::basic_fildesbuf

Stream buffer that writes and reads from file descriptor.

Fd
File descriptor type. Can be a wrapper class or int.
  • Input/output file descriptor operations are assumed to be non-blocking.
  • Does not flush its contents when closed.

Base classes
  • public virtual std::basic_streambuf< Ch, std::char_traits< Ch > >
Types
  • using fd_type = Fd

    File descriptor type.

Methods
  • available() const -> std::streamsize

    Returns the number of available bytes in get buffer.

  • remaining() const -> std::streamsize

    Returns the number of remaining bytes in put buffer.

  • dirty() const -> bool

    Returns true, if put buffer is non-empty.

  • swap(basic_fildesbuf & rhs) -> void

    Swap with rhs.

  • compact() -> void

    Compact buffer.

  • close() -> void

    Close file descriptor.

  • fd() -> fd_type &

    Get file descriptor.

  • fd() const -> const fd_type &

    Get file descriptor.

  • setfd(fd_type && rhs) -> void

    Set file descriptor.

  • pubfill() -> std::streamsize

    Fill get area from file descriptor.

  • pubflush() -> std::streamsize

    Flush put area contents to file descriptor.

  • sync() -> int

    Overrides std::streambuf::sync.

  • xsputn(const char_type * s, std::streamsize n) -> std::streamsize

    Overrides std::streambuf::xsputn.

  • xsgetn(char_type * s, std::streamsize n) -> std::streamsize

    Overrides std::streambuf::xsgetn.

  • underflow() -> int_type

    Overrides std::streambuf::underflow.

  • basic_fildesbuf(fd_type && fd, size_type gbufsize, size_type pbufsize)

    Construct the buffer with file descriptor fd, get area size gbufsize and put area size pbufsize.

  • basic_fildesbuf(fd_type && fd, size_type bufsize)

    Construct the buffer with file descriptor fd and get and put area size equal to bufsize.

  • basic_fildesbuf(fd_type && fd)explicit

    Construct the buffer with file descriptor fd.

  • basic_fildesbuf()
template <class Ch, class Tr, class Fd>
swap(basic_fildesbuf< Ch, Tr, Fd > & lhs, basic_fildesbuf< Ch, Tr, Fd > & rhs) -> void

Overload of std::swap for basic_fildesbuf.