annotate dwt/dwthelper/FileOutputStream.d @ 242:32a6819fef61

Fix implMissing for ImageLoader.save, thx yidabu for reporting.
author Frank Benoit <benoit@tionex.de>
date Tue, 24 Jun 2008 22:05:28 +0200
parents ab60f3309436
children 8d53428f9be0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
1 /**
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
2 * Authors: Frank Benoit <keinfarbton@googlemail.com>
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
3 */
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
4 module dwt.dwthelper.FileOutputStream;
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
5
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
6 public import dwt.dwthelper.File;
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
7 public import dwt.dwthelper.OutputStream;
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
8
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
9 import dwt.dwthelper.utils;
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
10
242
32a6819fef61 Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents: 212
diff changeset
11 import tango.io.FileConduit;
32a6819fef61 Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents: 212
diff changeset
12
0
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
13 public class FileOutputStream : dwt.dwthelper.OutputStream.OutputStream {
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
14
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
15 alias dwt.dwthelper.OutputStream.OutputStream.write write;
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
16 alias dwt.dwthelper.OutputStream.OutputStream.close close;
242
32a6819fef61 Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents: 212
diff changeset
17 FileConduit fc;
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 ){
242
32a6819fef61 Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents: 212
diff changeset
20 fc = new FileConduit( name, FileConduit.WriteCreate );
0
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
21 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
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 ){
242
32a6819fef61 Fix implMissing for ImageLoader.save, thx yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents: 212
diff changeset
24 fc = new FileConduit( name, append ? FileConduit.WriteAppending : FileConduit.WriteCreate );
0
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
25 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
26
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
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
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
29 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
30
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
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
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
33 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
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
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
39 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
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
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
43 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
44
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
45 public void finalize(){
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
46 implMissing( __FILE__, __LINE__ );
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
47 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
48
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
49
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
50 }
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
51
5406a8f6526d Add initial files
John Reimer <terminal.node@gmail.com
parents:
diff changeset
52