Evo supports various types of I/O streams:
Note: Streams use synchronous I/O – see also: Asynchronous I/O
Base class for all stream exceptions: ExceptionStream
Features include:
- Files, pipes, and sockets
- Output formatting (operator<<) – see Stream Formatting
- Text newline conversion (LF, CRLF, CR)
- Text reading supports all common newline types
- Text writing converts to system newline type by default – explicit Newline values are not converted
- High performance buffering
- Read/Write buffers minimize the overhead of low-level I/O calls
- Output formatting writes directly to stream buffer
- Thread-safe streams with wrappers (ConsoleMT, StreamMT, StreamExtMT) and EVO_IO_MT() macro
- Low-level I/O abstraction layer (OS files, pipes, sockets, etc) for supporting multiple platforms
Streams inherit from Stream (read/write), StreamIn (read-only), or StreamOut (write-only). Note that a Stream (read/write) may be opened in read-only or write-only mode.
Note: Implementation detail classes above are grayed and are not normally instantiated directly- Implementation Detail
A Stream (or StreamIn or StreamOut) type is coupled (via template param) with a type implementing IoDevice (IoFile, IoSocket), which handles the low-level device I/O.
- The stream implementation will use an IoReader to read from the device, and/or an IoWriter to write to the device
- IoReader and IoWriter implement the buffering layer
IoReader, IoWriter, and IoFilterChain use RawBuffer for low-level memory buffers.