diff dwt/dwthelper/FileInputStream.d @ 360:ee1dd551f5b1

Make compilable for tango 0.99.8
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Mar 2009 20:30:32 +0100
parents 8ebacc5c07dc
children
line wrap: on
line diff
--- a/dwt/dwthelper/FileInputStream.d	Tue Jan 27 10:15:27 2009 +0100
+++ b/dwt/dwthelper/FileInputStream.d	Fri Mar 20 20:30:32 2009 +0100
@@ -8,11 +8,10 @@
 import dwt.dwthelper.InputStream;
 
 version(TANGOSVN){
-    import tango.io.device.File;
+import TangoFile = tango.io.device.File;
 } else {
-    import tango.io.FileConduit;
+import TangoFile = tango.io.FileConduit;
 }
-import tango.io.protocol.Reader;
 import tango.core.Exception;
 import tango.text.convert.Format;
 
@@ -20,11 +19,7 @@
 
     alias dwt.dwthelper.InputStream.InputStream.read read;
 
-    version(TANGOSVN)
-        private tango.io.device.File.File file_;
-    else
-        private FileConduit conduit;
-        
+    private TangoFile.File conduit;
     private ubyte[] buffer;
     private int buf_pos;
     private int buf_size;
@@ -32,20 +27,13 @@
     private bool eof;
 
     public this ( String name ){
-        version(TANGOSVN)
-            file_ = new tango.io.device.File.File( name );
-        else
-            conduit = new FileConduit( name );
-            
+        conduit = new TangoFile.File( name );
         buffer = new ubyte[]( BUFFER_SIZE );
     }
 
     public this ( dwt.dwthelper.File.File file ){
         implMissing( __FILE__, __LINE__ );
-        version(TANGOSVN)
-            file_ = new tango.io.device.File.File ( file.getAbsolutePath(), tango.io.device.File.File.ReadExisting );
-        else
-            conduit = new FileConduit( file.getAbsolutePath(), FileConduit.ReadExisting );
+        conduit = new TangoFile.File( file.getAbsolutePath(), TangoFile.File.ReadExisting );
         buffer = new ubyte[]( BUFFER_SIZE );
     }
 
@@ -56,10 +44,7 @@
         try{
             if( buf_pos == buf_size ){
                 buf_pos = 0;
-                version(TANGOSVN)
-                    buf_size = file_.read( buffer );
-                else
-                    buf_size = conduit.input.read( buffer );
+                buf_size = conduit.input.read( buffer );
             }
             if( buf_size <= 0 ){
                 eof = true;
@@ -88,10 +73,7 @@
     }
 
     public override void close(){
-        version(TANGOSVN)
-            file_.close();
-        else
-            conduit.close();
+        conduit.close();
     }
 }