changeset 262:e10de397beb1

ADD version TANGOSVN
author Frank Benoit <benoit@tionex.de>
date Sun, 06 Jul 2008 15:33:12 +0200
parents edcf78db8722
children b6e695a17969
files dwt/dwthelper/ByteArrayOutputStream.d dwt/dwthelper/File.d dwt/dwthelper/InflaterInputStream.d dwt/dwthelper/utils.d
diffstat 4 files changed, 55 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/dwthelper/ByteArrayOutputStream.d	Thu Jul 03 21:20:33 2008 +0200
+++ b/dwt/dwthelper/ByteArrayOutputStream.d	Sun Jul 06 15:33:12 2008 +0200
@@ -5,7 +5,13 @@
 
 public import dwt.dwthelper.OutputStream;
 import dwt.dwthelper.utils;
-import tango.io.GrowBuffer;
+import tango.io.Buffer;
+version(TANGOSVN)
+    import tango.io.Buffer;
+}
+else{
+    import tango.io.GrowBuffer;
+}
 
 public class ByteArrayOutputStream : dwt.dwthelper.OutputStream.OutputStream {
 
--- a/dwt/dwthelper/File.d	Thu Jul 03 21:20:33 2008 +0200
+++ b/dwt/dwthelper/File.d	Sun Jul 06 15:33:12 2008 +0200
@@ -5,7 +5,12 @@
 
 import dwt.dwthelper.utils;
 
-static import tango.io.FileConst;
+version(TANGOSVN)
+    static import tango.io.model.IFile;
+}
+else{
+    static import tango.io.FileConst;
+}
 static import tango.io.FilePath;
 static import tango.io.FileSystem;
 
@@ -19,10 +24,18 @@
     private tango.io.FilePath.FilePath mFilePath;
 
     static this(){
+version(TANGOSVN)
+        separator = tango.io.model.IFile.FileConst.PathSeparatorString;
+        separatorChar = tango.io.model.IFile.FileConst.PathSeparatorChar;
+        pathSeparator = tango.io.model.IFile.FileConst.SystemPathString;
+        pathSeparatorChar = tango.io.model.IFile.FileConst.SystemPathChar;
+}
+else{
         separator = tango.io.FileConst.FileConst.PathSeparatorString;
         separatorChar = tango.io.FileConst.FileConst.PathSeparatorChar;
         pathSeparator = tango.io.FileConst.FileConst.SystemPathString;
         pathSeparatorChar = tango.io.FileConst.FileConst.SystemPathChar;
+}
     }
 
     public this ( String pathname ){
--- a/dwt/dwthelper/InflaterInputStream.d	Thu Jul 03 21:20:33 2008 +0200
+++ b/dwt/dwthelper/InflaterInputStream.d	Sun Jul 06 15:33:12 2008 +0200
@@ -7,7 +7,9 @@
 import dwt.dwthelper.utils;
 import tango.io.Stdout;
 import tango.io.compress.ZlibStream;
-
+version(TANGOSVN)
+    import tango.io.Conduit;
+}
 class InputStreamWrapper : tango.io.model.IConduit.InputStream {
 
     dwt.dwthelper.InputStream.InputStream istr;
@@ -20,6 +22,12 @@
         int res = istr.read( cast(byte[])dst );
         return res;
     }
+version(TANGOSVN)
+    void[] load (void[] dst = null) {
+            return Conduit.load (this, dst);
+    }
+}
+
 
     tango.io.model.IConduit.InputStream clear (){
         return this;
--- a/dwt/dwthelper/utils.d	Thu Jul 03 21:20:33 2008 +0200
+++ b/dwt/dwthelper/utils.d	Sun Jul 06 15:33:12 2008 +0200
@@ -149,15 +149,30 @@
     }
 
     public static String toHexString( int i ){
+version(TANGOSVN)
+        return tango.text.convert.Integer.toString(i, "x" );
+}
+else{
         return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex );
+}
     }
 
     public static String toOctalString( int i ){
+version(TANGOSVN)
+        return tango.text.convert.Integer.toString(i, "o" );
+}
+else{
         return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal );
+}
     }
 
     public static String toBinaryString( int i ){
+version(TANGOSVN)
+        return tango.text.convert.Integer.toString(i, "b" );
+}
+else{
         return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary );
+}
     }
 
     public static String toString( int i ){
@@ -635,6 +650,15 @@
 public alias tango.stdc.stringz.fromString16z fromString16z;
 
 static String toHex(uint value, bool prefix = true, int radix = 8){
+version(TANGOSVN)
+    return tango.text.convert.Integer.toString(
+            value,
+            radix is 10 ? "d" :
+            radix is  8 ? "o" :
+            radix is 16 ? "x" :
+                          "d" );
+}
+else{
     return tango.text.convert.Integer.toString(
             value,
             radix is 10 ? tango.text.convert.Integer.Style.Signed :
@@ -644,6 +668,7 @@
             prefix ? tango.text.convert.Integer.Flags.Prefix : tango.text.convert.Integer.Flags.None
             );
 }
+}
 
 class RuntimeException : Exception {
     this( String e = null){