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
Variables
derr
:
CFile
CFile wrapper of std.c.stdio.stderr (not seekable).
din
:
CFile
CFile wrapper of std.c.stdio.stdin (not seekable).
dout
:
CFile
CFile wrapper of std.c.stdio.stdout (not seekable).
Classes
CFile
:
Stream
A Stream wrapper for a C file of type FILE*.
Super hierarchy:
Object
->
Stream
->
CFile
All implemented interfaces:
InputStream
,
OutputStream
Fields
cfile
:
_iobuf
*
Constructors
this
(
_iobuf
*
cfile
,
FileMode
mode
,
bool
seekable
)
Create the stream wrapper for the given C file.
Parameters:
mode
a bitwise combination of
FileMode.In
for a readable file and
FileMode.Out
for a writeable file.
seekable
indicates if the stream should be _seekable.
Methods
void
close
()
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
bool
eof
()
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
_iobuf
*
file
()
Property to get or set the underlying file for this stream. Setting the file marks the stream as open.
void
flush
()
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
char
getc
()
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
uint
readBlock
(
void
*
buffer
,
uint
size
)
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
ulong
seek
(
long
offset
,
SeekPos
rel
)
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
char
ungetc
(
char
c
)
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
uint
writeBlock
(
void
*
buffer
,
uint
size
)
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
void
writeLine
(
char
[]
s
)
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
void
writeLineW
(
wchar
[]
s
)
Overrides of the
Stream
methods to call the underlying
FILE*
C functions.
Inherited methods
from
Object
:
factory
,
notifyRegister
,
notifyUnRegister
,
opCmp
,
opEquals
,
print
,
toHash
,
toString
from
Stream
:
available
,
close
,
copyFrom
,
eof
,
flush
,
getc
,
getcw
,
isOpen
,
opApply
,
position
,
printf
,
read
,
readBlock
,
readExact
,
readf
,
readLine
,
readLineW
,
readString
,
readStringW
,
seek
,
seekCur
,
seekEnd
,
seekSet
,
size
,
toHash
,
toString
,
ungetAvailable
,
ungetc
,
ungetcw
,
vprintf
,
vreadf
,
write
,
writeBlock
,
writeExact
,
writef
,
writefln
,
writefx
,
writeLine
,
writeLineW
,
writeString
,
writeStringW
from
InputStream
:
available
,
eof
,
getc
,
getcw
,
isOpen
,
opApply
,
read
,
readExact
,
readf
,
readLine
,
readLineW
,
readString
,
readStringW
,
ungetc
,
ungetcw
,
vreadf
from
OutputStream
:
close
,
flush
,
isOpen
,
printf
,
vprintf
,
write
,
writeExact
,
writef
,
writefln
,
writefx
,
writeLine
,
writeLineW
,
writeString
,
writeStringW