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 dispose() [override] ¶#
-
- 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. Returns the number of bytes read, or Eof where
there is no further data.
Operates asynchronously where the hosting thread is
configured in that manner.
- size_t write(void[] src) [override] ¶#
-
Write a chunk of bytes to the file from the provided
array. Returns the number of bytes written, or Eof if
the output is no longer available.
Operates asynchronously where the hosting thread is
configured in that manner.
- size_t wait(scheduler.Type type, uint bytes, uint timeout) [protected, final] ¶#
-