BSD style: see
license.txt
May 2005: Initial release
Kris
- class Device : Conduit, ISelectable ¶#
-
Implements a means of reading and writing a file device. Conduits
are the primary means of accessing external data, and this one is
used as a superclass for the console, for files, sockets etc
- alias Conduit.error error [public] ¶#
-
expose superclass definition also
- void error() [final] ¶#
-
Throw an IOException noting the last error
- char[] toString() [override] ¶#
-
Return the name of this device
- size_t bufferSize() [override] ¶#
-
Return a preferred size for buffering conduit I/O
- void reopen(Handle handle) [protected] ¶#
-
Allow adjustment of standard IO handles
- Handle fileHandle() [final] ¶#
-
Return the underlying OS handle of this Conduit
- void detach() [override] ¶#
-
Release the underlying file. Note that an exception
is not thrown on error, as doing so can induce some
spaggetti into error handling. Instead, we need to
change this to return a bool instead, so the caller
can decide what to do.
- size_t read(void[] dst) [override] ¶#
-
Read a chunk of bytes from the file into the provided
array (typically that belonging to an IBuffer).
Returns the number of bytes read, or Eof when there is
no further data
- size_t write(void[] src) [override] ¶#
-
Write a chunk of bytes to the file from the provided
array (typically that belonging to an IBuffer)