Stream implementations in which the underlying implementation is libc FILEs.
Code Map
//! Stream implementations in which the underlying implementation is libc
//! FILEs.
module watt.io.streams.stdc;
//! An OutputStream in which the sink is a file.
class OutputStdcStream : OutputStream
{
public:
//! The underlying FILE handle.
handle: FILE*;
public:
//! Construct a new OutputStdcStream from a filename. This will use the
//! mode string "w", so will overwrite any file with the given name that
//! already exists.
this(filename: const(char)[]) { }
//! Construct a new OutputStdcStream with a filename, using the given mode
//! string.
this(filename: const(char)[], flags: const(char)[]) { }
//! Close the underlying FILE handle.
fn close() { }
//! Is this stream open?
fn isOpen() bool { }
//! Write a single character to the stream.
fn put(c: dchar) { }
//! Write a string to the stream.
fn write(s: scope (const(scope (char)[])) { }
//! Ensure all buffered input is written to the stream.
fn flush() { }
}
//! An InputStream in which the source is a file.
class InputStdcStream : InputStream
{
public:
//! The underlying FILE handle.
handle: FILE*;
public:
//! Construct a new stream from a filename.
this(filename: const(char)[]) { }
//! Construct a new InputStdcStream with a filename, using the given mode
//! string.
this(filename: const(char)[], flags: const(char)[]) { }
//! Close the underlying FILE handle.
fn close() { }
//! Is this stream open?
fn isOpen() bool { }
//! Read a single character from this stream.
fn get() dchar { }
//! Read from the stream into buffer.
fn read(buffer: u8[]) u8[] { }
//! Has this stream reached EOF?
fn eof() bool { }
}
An OutputStream in which the sink is a file.
The underlying FILE handle.
Construct a new OutputStdcStream
from a filename.
This will use the mode string "w", so will overwrite
any file with the given name that already exists.
Construct a new OutputStdcStream
with a filename, using
the given mode string.
Close the underlying FILE handle.
Is this stream open?
Write a single character to the stream.
Write a string to the stream.
Ensure all buffered input is written to the stream.
An InputStream in which the source is a file.
The underlying FILE handle.
Construct a new stream from a filename.
Construct a new InputStdcStream
with a filename, using
the given mode string.
Close the underlying FILE handle.
Is this stream open?
Read a single character from this stream.
Read from the stream into buffer.
Return
The slice of buffer
actually used.
Has this stream reached EOF?