UNISTDX_IO_FDSTREAM
using ofdstream = basic_ofdstream< char >

Character based output file descriptor stream.

using fdstream = basic_fdstream< char >

Character based input/output file descriptor stream.

using ifdstream = basic_ifdstream< char >

Character based input file descriptor stream.

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

Input/output stream that reads/writes to/from file descriptor.

  • Any type for which streambuf_traits are defined, may be used instead of file descriptor.
  • Input and output operations are non-blocking by default.
  • The stream does not flush buffer contents when closed.

Base classes
  • public std::basic_iostream< Ch, std::char_traits< Ch > >
Types
Methods
  • fdbuf() -> fildesbuf_type &

    Get stream buffer.

  • fdbuf() const -> const fildesbuf_type &

    Get stream buffer.

  • fd() -> fd_type &

    Get file descriptor.

  • fd() const -> const fd_type &

    Get file descriptor.

  • close() -> void

    Close the stream.

  • open(fd_type && rhs) -> void

    Open the stream with file descriptor rhs.

  • basic_fdstream(Fd && fd)explicit

    Construct the stream with file descriptor fd.

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

Output stream that writes to file descriptor.

  • Any type for which streambuf_traits are defined, may be used instead of file descriptor.
  • Output operations are non-blocking by default.
  • The stream does not flush buffer contents when closed.

Base classes
  • public std::basic_ostream< Ch, std::char_traits< Ch > >
Types
Methods
  • fdbuf() -> fildesbuf_type &

    Get stream buffer.

  • fdbuf() const -> const fildesbuf_type &

    Get stream buffer.

  • fd() -> fd_type &

    Get file descriptor.

  • fd() const -> const fd_type &

    Get file descriptor.

  • close() -> void

    Close the stream.

  • open(fd_type && rhs) -> void

    Open the stream with file descriptor rhs.

  • basic_ofdstream(Fd && fd)explicit

    Construct the stream with file descriptor fd.

  • basic_ofdstream()
template <class Ch, class Tr = std::char_traits<Ch>, class Fd = sys::fildes>
class sys::basic_ifdstream

Input stream that reads from file descriptor.

Fd
File descriptor type. Can be a wrapper class or int.

  • Any type for which streambuf_traits are defined, may be used instead of file descriptor.
  • Input operations are non-blocking by default.

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

    File descriptor type.

Methods
  • fdbuf() -> fildesbuf_type &

    Get stream buffer.

  • fdbuf() const -> const fildesbuf_type &

    Get stream buffer.

  • fd() -> fd_type &

    Get file descriptor.

  • fd() const -> const fd_type &

    Get file descriptor.

  • close() -> void

    Close the stream.

  • open(fd_type && rhs) -> void

    Open the stream with file descriptor rhs.

  • basic_ifdstream(Fd && fd)explicit

    Construct the stream with file descriptor fd.