Changeset 248:d10ff1f47f84

Show
Ignore:
Timestamp:
07/06/08 10:42:54 (3 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Add: version TANGOSVN

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/dwthelper/ByteArrayOutputStream.d

    r242 r248  
    66public import dwt.dwthelper.OutputStream; 
    77import dwt.dwthelper.utils; 
    8 import tango.io.GrowBuffer; 
     8import tango.io.Buffer; 
     9version(TANGOSVN) { 
     10    import tango.io.Buffer; 
     11
     12else{ 
     13    import tango.io.GrowBuffer; 
     14
    915 
    1016public class ByteArrayOutputStream : dwt.dwthelper.OutputStream.OutputStream { 
  • dwt/dwthelper/File.d

    r212 r248  
    66import dwt.dwthelper.utils; 
    77 
    8 static import tango.io.FileConst; 
     8version(TANGOSVN) { 
     9    static import tango.io.model.IFile; 
     10
     11else{ 
     12    static import tango.io.FileConst; 
     13
    914static import tango.io.FilePath; 
    1015static import tango.io.FileSystem; 
     
    2025 
    2126    static this(){ 
     27version(TANGOSVN) { 
     28        separator = tango.io.model.IFile.FileConst.PathSeparatorString; 
     29        separatorChar = tango.io.model.IFile.FileConst.PathSeparatorChar; 
     30        pathSeparator = tango.io.model.IFile.FileConst.SystemPathString; 
     31        pathSeparatorChar = tango.io.model.IFile.FileConst.SystemPathChar; 
     32} 
     33else{ 
    2234        separator = tango.io.FileConst.FileConst.PathSeparatorString; 
    2335        separatorChar = tango.io.FileConst.FileConst.PathSeparatorChar; 
    2436        pathSeparator = tango.io.FileConst.FileConst.SystemPathString; 
    2537        pathSeparatorChar = tango.io.FileConst.FileConst.SystemPathChar; 
     38} 
    2639    } 
    2740 
  • dwt/dwthelper/InflaterInputStream.d

    r0 r248  
    66public import dwt.dwthelper.InputStream; 
    77import dwt.dwthelper.utils; 
     8import tango.io.Stdout; 
     9import tango.io.compress.ZlibStream; 
     10version(TANGOSVN) { 
     11    import tango.io.Conduit; 
     12} 
     13class InputStreamWrapper : tango.io.model.IConduit.InputStream { 
     14 
     15    dwt.dwthelper.InputStream.InputStream istr; 
     16 
     17    this( dwt.dwthelper.InputStream.InputStream istr ){ 
     18        this.istr = istr; 
     19    } 
     20 
     21    uint read (void[] dst){ 
     22        int res = istr.read( cast(byte[])dst ); 
     23        return res; 
     24    } 
     25version(TANGOSVN) { 
     26    void[] load (void[] dst = null) { 
     27            return Conduit.load (this, dst); 
     28    } 
     29} 
     30 
     31 
     32    tango.io.model.IConduit.InputStream clear (){ 
     33        return this; 
     34    } 
     35 
     36    tango.io.model.IConduit.IConduit conduit (){ 
     37        return null; 
     38    } 
     39 
     40    void close (){ 
     41        istr.close(); 
     42    } 
     43} 
    844 
    945public class InflaterInputStream : dwt.dwthelper.InputStream.InputStream { 
     
    2157    package bool usesDefaultInflater = false; 
    2258 
     59    ZlibInput tangoIstr; 
     60 
    2361    public this ( dwt.dwthelper.InputStream.InputStream istr ){ 
     62        tangoIstr = new ZlibInput( new InputStreamWrapper(istr )); 
    2463    } 
    2564 
    2665    public int read(){ 
    27         implMissing( __FILE__, __LINE__ ); 
    28         return 0; 
     66        ubyte[1] data; 
     67        uint res = tangoIstr.read( data ); 
     68        if( res !is 1 ){ 
     69            return data[0] & 0xFF; 
     70        } 
     71        return -1; 
    2972    } 
    3073 
  • dwt/dwthelper/Runnable.d

    r206 r248  
    1 /** 
     1/** 
    22 * Authors: Frank Benoit <benoit@tionex.de> 
    33 */ 
  • dwt/dwthelper/System.d

    r225 r248  
    44module dwt.dwthelper.System; 
    55 
     6import dwt.dwthelper.utils; 
     7 
    68import tango.core.Exception; 
    79import tango.time.Clock; 
    810import tango.stdc.stdlib : exit; 
    9  
    10 import dwt.dwthelper.utils; 
    1111 
    1212template SimpleType(T) { 
     
    125125    alias SimpleType!(ubyte[]).arraycopy arraycopy; 
    126126    alias SimpleType!(ulong[]).arraycopy arraycopy; 
    127     alias SimpleType!(char[]).arraycopy arraycopy; 
     127    alias SimpleType!(String).arraycopy arraycopy; 
    128128    alias SimpleType!(wchar[]).arraycopy arraycopy; 
    129129    alias SimpleType!(Object[]).arraycopy arraycopy; 
     
    147147    public static String getProperty( String key ){ 
    148148        switch( key ){ 
    149         case "os.name": return "windows"; 
     149        case "os.name": return "linux"; 
    150150        default: return null; 
    151151        } 
  • dwt/dwthelper/utils.d

    r235 r248  
    1111import tango.io.Stdout; 
    1212import tango.io.Print; 
    13 import tango.stdc.stringz; 
     13static import tango.stdc.stringz; 
    1414static import tango.text.Util; 
    1515static import tango.text.Text; 
     
    150150 
    151151    public static String toHexString( int i ){ 
     152version(TANGOSVN) { 
     153        return tango.text.convert.Integer.toString(i, "x" ); 
     154} 
     155else{ 
    152156        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex ); 
     157} 
    153158    } 
    154159 
    155160    public static String toOctalString( int i ){ 
     161version(TANGOSVN) { 
     162        return tango.text.convert.Integer.toString(i, "o" ); 
     163} 
     164else{ 
    156165        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal ); 
     166} 
    157167    } 
    158168 
    159169    public static String toBinaryString( int i ){ 
     170version(TANGOSVN) { 
     171        return tango.text.convert.Integer.toString(i, "b" ); 
     172} 
     173else{ 
    160174        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary ); 
     175} 
    161176    } 
    162177 
     
    630645} 
    631646 
     647public alias tango.stdc.stringz.toStringz toStringz; 
     648public alias tango.stdc.stringz.toString16z toString16z; 
     649public alias tango.stdc.stringz.fromStringz fromStringz; 
     650public alias tango.stdc.stringz.fromString16z fromString16z; 
     651 
    632652static String toHex(uint value, bool prefix = true, int radix = 8){ 
     653version(TANGOSVN) { 
     654    return tango.text.convert.Integer.toString( 
     655            value, 
     656            radix is 10 ? "d" : 
     657            radix is  8 ? "o" : 
     658            radix is 16 ? "x" : 
     659                          "d" ); 
     660} 
     661else{ 
    633662    return tango.text.convert.Integer.toString( 
    634663            value, 
     
    640669            ); 
    641670} 
     671} 
    642672 
    643673class RuntimeException : Exception {