Changeset 250:55591bc3974c

Show
Ignore:
Timestamp:
07/06/08 11:26:06 (3 months ago)
Author:
Frank Benoit <benoit@tionex.de>
Parents:

249:b3dbd786541a 248:d10ff1f47f84

branch:
default
Message:

merge

Files:

Legend:

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

    r246 r250  
    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) { 
    152153        return tango.text.convert.Integer.toString(i, "x" ); 
     154} 
     155else{ 
     156        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) { 
    156162        return tango.text.convert.Integer.toString(i, "o" ); 
     163} 
     164else{ 
     165        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) { 
    160171        return tango.text.convert.Integer.toString(i, "b" ); 
     172} 
     173else{ 
     174        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) { 
    633654    return tango.text.convert.Integer.toString( 
    634655            value, 
    635656            radix is 10 ? "d" : 
    636             radix is  8 ? "o"  : 
    637             radix is 16 ? "x"    : 
    638                           "d" 
     657            radix is  8 ? "o" : 
     658            radix is 16 ? "x" : 
     659                          "d" ); 
     660
     661else{ 
     662    return tango.text.convert.Integer.toString( 
     663            value, 
     664            radix is 10 ? tango.text.convert.Integer.Style.Signed : 
     665            radix is  8 ? tango.text.convert.Integer.Style.Octal  : 
     666            radix is 16 ? tango.text.convert.Integer.Style.Hex    : 
     667                          tango.text.convert.Integer.Style.Signed, 
     668            prefix ? tango.text.convert.Integer.Flags.Prefix : tango.text.convert.Integer.Flags.None 
    639669            ); 
     670} 
    640671} 
    641672