Mercurial > projects > dwt-linux
view dwt/dwthelper/FileOutputStream.d @ 329:92aa2d7391f3
Added 'all.d' package import, a dwt.all for everything and a dwt.std for the essential stuff
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Oct 2008 22:01:20 +0200 |
parents | a2166f25ce17 |
children | 8ebacc5c07dc |
line wrap: on
line source
/** * Authors: Frank Benoit <keinfarbton@googlemail.com> */ module dwt.dwthelper.FileOutputStream; public import dwt.dwthelper.File; public import dwt.dwthelper.OutputStream; import dwt.dwthelper.utils; version(TANGOSVN){ import tango.io.device.FileConduit; } else { import tango.io.FileConduit; } public class FileOutputStream : dwt.dwthelper.OutputStream.OutputStream { alias dwt.dwthelper.OutputStream.OutputStream.write write; alias dwt.dwthelper.OutputStream.OutputStream.close close; FileConduit fc; public this ( String name ){ fc = new FileConduit( name, FileConduit.WriteCreate ); } public this ( String name, bool append ){ fc = new FileConduit( name, append ? FileConduit.WriteAppending : FileConduit.WriteCreate ); } public this ( dwt.dwthelper.File.File file ){ this( file.toString ); } public this ( dwt.dwthelper.File.File file, bool append ){ this( file.toString, append ); } public override void write( int b ){ ubyte[1] a; a[0] = b & 0xFF; fc.write(a); } public override void close(){ fc.close(); } public void finalize(){ implMissing( __FILE__, __LINE__ ); } }