D
Language
Phobos
Comparisons
object
std
std.base64
std.boxer
std.compiler
std.conv
std.cover
std.ctype
std.date
std.demangle
std.file
std.format
std.gc
std.intrinsic
std.math
std.md5
std.mmfile
std.openrj
std.outbuffer
std.path
std.process
std.random
std.recls
std.regexp
std.socket
std.socketstream
std.stdint
std.stdio
std.cstream
std.stream
std.string
std.system
std.thread
std.uni
std.uri
std.utf
std.zip
std.zlib
std.c.fenv
std.c.math
std.c.process
std.c.stdarg
std.c.stddef
std.c.stdio
std.c.stdlib
std.c.string
std.c.time
std.c.wcharh
std.windows.charset
std.windows
std.linux
std.c.windows
std.c.linux
|
std.cstream
The std.cstream module bridges std.c.stdio (or std.stdio) and std.stream.
Both std.c.stdio and std.stream are publicly imported by std.cstream.
Authors:
Ben Hinkle
License:
Public Domain
- class CFile: std.stream.Stream;
- A Stream wrapper for a C file of type FILE*.
- this(_iobuf * cfile, FileMode mode, bool seekable = false);
- Create the stream wrapper for the given C file.
Params:
FileMode mode |
a bitwise combination of FileMode.In for a readable file
and FileMode.Out for a writeable file. |
bool seekable |
indicates if the stream should be seekable. |
- _iobuf * file();
void file(_iobuf * cfile);
- Property to get or set the underlying file for this stream.
Setting the file marks the stream as open.
- void flush();
void close();
bool eof();
char getc();
char ungetc(char c);
uint readBlock(void* buffer, uint size);
uint writeBlock(void* buffer, uint size);
ulong seek(long offset, SeekPos rel);
void writeLine(char[] s);
void writeLineW(wchar[] s);
- Overrides of the Stream methods to call the underlying FILE*
C functions.
- CFile din;
- CFile wrapper of std.c.stdio.stdin (not seekable).
- CFile dout;
- CFile wrapper of std.c.stdio.stdout (not seekable).
- CFile derr;
- CFile wrapper of std.c.stdio.stderr (not seekable).
|