comparison dwt/dwthelper/utils.d @ 276:9d67c3170a58 Release-1

Removed version=TANGOSVN for release 0.99.7
author Frank Benoit <benoit@tionex.de>
date Sat, 26 Jul 2008 02:52:25 +0200
parents d472fae79005
children 05e48e1e65d1
comparison
equal deleted inserted replaced
275:5983f0f11896 276:9d67c3170a58
147 return null; 147 return null;
148 } 148 }
149 } 149 }
150 150
151 public static String toHexString( int i ){ 151 public static String toHexString( int i ){
152 version(TANGOSVN) {
153 return tango.text.convert.Integer.toString(i, "x" ); 152 return tango.text.convert.Integer.toString(i, "x" );
154 }
155 else{
156 return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex );
157 }
158 } 153 }
159 154
160 public static String toOctalString( int i ){ 155 public static String toOctalString( int i ){
161 version(TANGOSVN) {
162 return tango.text.convert.Integer.toString(i, "o" ); 156 return tango.text.convert.Integer.toString(i, "o" );
163 }
164 else{
165 return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal );
166 }
167 } 157 }
168 158
169 public static String toBinaryString( int i ){ 159 public static String toBinaryString( int i ){
170 version(TANGOSVN) {
171 return tango.text.convert.Integer.toString(i, "b" ); 160 return tango.text.convert.Integer.toString(i, "b" );
172 }
173 else{
174 return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary );
175 }
176 } 161 }
177 162
178 public static String toString( int i ){ 163 public static String toString( int i ){
179 return tango.text.convert.Integer.toString(i); 164 return tango.text.convert.Integer.toString(i);
180 } 165 }
648 public alias tango.stdc.stringz.toString16z toString16z; 633 public alias tango.stdc.stringz.toString16z toString16z;
649 public alias tango.stdc.stringz.fromStringz fromStringz; 634 public alias tango.stdc.stringz.fromStringz fromStringz;
650 public alias tango.stdc.stringz.fromString16z fromString16z; 635 public alias tango.stdc.stringz.fromString16z fromString16z;
651 636
652 static String toHex(uint value, bool prefix = true, int radix = 8){ 637 static String toHex(uint value, bool prefix = true, int radix = 8){
653 version(TANGOSVN) {
654 return tango.text.convert.Integer.toString( 638 return tango.text.convert.Integer.toString(
655 value, 639 value,
656 radix is 10 ? "d" : 640 radix is 10 ? "d" :
657 radix is 8 ? "o" : 641 radix is 8 ? "o" :
658 radix is 16 ? "x" : 642 radix is 16 ? "x" :
659 "d" ); 643 "d" );
660 }
661 else{
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
669 );
670 }
671 } 644 }
672 645
673 class RuntimeException : Exception { 646 class RuntimeException : Exception {
674 this( String e = null){ 647 this( String e = null){
675 super(e); 648 super(e);