Mercurial > projects > dwt-win
annotate dwt/dwthelper/FileOutputStream.d @ 339:210994f12c4c
Fixes for dmd 1.041 and tango 0.99.8
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 28 Mar 2009 03:12:07 +0100 |
parents | 1ee938a6e02e |
children |
rev | line source |
---|---|
0 | 1 /** |
2 * Authors: Frank Benoit <keinfarbton@googlemail.com> | |
3 */ | |
4 module dwt.dwthelper.FileOutputStream; | |
5 | |
6 public import dwt.dwthelper.File; | |
7 public import dwt.dwthelper.OutputStream; | |
8 | |
9 import dwt.dwthelper.utils; | |
10 | |
332
1ee938a6e02e
Tango updates, removing trace prints and added prints via Logger
Frank Benoit <benoit@tionex.de>
parents:
308
diff
changeset
|
11 import TangoFile = tango.io.device.File; |
242
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
12 |
0 | 13 public class FileOutputStream : dwt.dwthelper.OutputStream.OutputStream { |
14 | |
15 alias dwt.dwthelper.OutputStream.OutputStream.write write; | |
16 alias dwt.dwthelper.OutputStream.OutputStream.close close; | |
332
1ee938a6e02e
Tango updates, removing trace prints and added prints via Logger
Frank Benoit <benoit@tionex.de>
parents:
308
diff
changeset
|
17 TangoFile.File fc; |
242
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
18 |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
19 public this ( String name ){ |
332
1ee938a6e02e
Tango updates, removing trace prints and added prints via Logger
Frank Benoit <benoit@tionex.de>
parents:
308
diff
changeset
|
20 fc = new TangoFile.File( name, TangoFile.File.WriteCreate ); |
0 | 21 } |
22 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
23 public this ( String name, bool append ){ |
332
1ee938a6e02e
Tango updates, removing trace prints and added prints via Logger
Frank Benoit <benoit@tionex.de>
parents:
308
diff
changeset
|
24 fc = new TangoFile.File( name, append ? TangoFile.File.WriteAppending : TangoFile.File.WriteCreate ); |
0 | 25 } |
26 | |
27 public this ( dwt.dwthelper.File.File file ){ | |
242
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
28 this( file.toString ); |
0 | 29 } |
30 | |
31 public this ( dwt.dwthelper.File.File file, bool append ){ | |
242
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
32 this( file.toString, append ); |
0 | 33 } |
34 | |
242
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
35 public override void write( int b ){ |
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
36 ubyte[1] a; |
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
37 a[0] = b & 0xFF; |
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
38 fc.write(a); |
0 | 39 } |
40 | |
242
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
41 public override void close(){ |
32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
212
diff
changeset
|
42 fc.close(); |
0 | 43 } |
44 | |
45 public void finalize(){ | |
46 implMissing( __FILE__, __LINE__ ); | |
47 } | |
48 | |
49 | |
50 } | |
51 | |
52 |