Up to Documentation.
The std
library provides a nice separation between media and streams.
Streams are stateless formatters, while media are the actual containers.
The idea is that any stream can operate on any medium.
The notion of media is not easily noticeable, because there are only two concrete implementations with unclear names - stringbuf
and filebuf
.
The really important class, though, is the semi-abstract streambuf
.
There a three small methods that a medium may have to override to become operational.
abc
provides several media and streams that could be mixed and matched.
Follow the links to read more about each class.
buffer_streambuf
- a char buffer of a fixed length.socket_streambuf
- a TCP or UDP socket.multifile_streambuf
- a file that when reopened creates a new file with a timestamp in the name. There two specializations:duration_multifile_streambuf
- automatically reopens at a given time interval.size_multifile_streambuf
- automatically reopens when the file's size exceed a given limit.
http
- a group of streams:http_request_istream
http_request_ostream
http_response_istream
http_response_ostream
http_server_stream
- a convenience combination ofhttp_request_istream
andhttp_response_ostream
.http_client_stream
- a convenience combination ofhttp_request_ostream
andhttp_response_istream
.
json
- a group of streams:table_ostream
- an output stream of lines.log_ostream
- a specialization for logging.
line_ostream
- an output stream of chars.debug_line_ostream
- a specialization for human-readable diagnostics.diag_line_ostream
- a specialization for compact diagnostics.test_line_ostream
- a specialization for unit testing.