comparison dwt/dwthelper/utils.d @ 187:bcdc37794717

Reverted changes from previous wrong reverting changes: See: -r026ce3b05f57, -r4d06074bb1af, -rc4643827733c
author Frank Benoit <benoit@tionex.de>
date Mon, 10 Mar 2008 17:08:22 +0100
parents c4643827733c
children 72ef824d4983
comparison
equal deleted inserted replaced
186:ee3ee677f5fc 187:bcdc37794717
43 } 43 }
44 } 44 }
45 45
46 alias ValueWrapperT!(bool) ValueWrapperBool; 46 alias ValueWrapperT!(bool) ValueWrapperBool;
47 alias ValueWrapperT!(int) ValueWrapperInt; 47 alias ValueWrapperT!(int) ValueWrapperInt;
48 alias ValueWrapperT!(long) ValueWrapperLong;
48 alias ArrayWrapperT!(byte) ArrayWrapperByte; 49 alias ArrayWrapperT!(byte) ArrayWrapperByte;
49 alias ArrayWrapperT!(int) ArrayWrapperInt; 50 alias ArrayWrapperT!(int) ArrayWrapperInt;
50 alias ArrayWrapperT!(Object) ArrayWrapperObject; 51 alias ArrayWrapperT!(Object) ArrayWrapperObject;
51 alias ArrayWrapperT!(char) ArrayWrapperString; 52 alias ArrayWrapperT!(char) ArrayWrapperString;
52 alias ArrayWrapperT!(char[]) ArrayWrapperString2; 53 alias ArrayWrapperT!(char[]) ArrayWrapperString2;
318 319
319 public hash_t toHash( char[] src ){ 320 public hash_t toHash( char[] src ){
320 return typeid(char[]).getHash(&src); 321 return typeid(char[]).getHash(&src);
321 } 322 }
322 323
324 public char* toStringzValidPtr( char[] src ){
325 if( src ){
326 return src.toStringz();
327 }
328 else{
329 static const char[] nullPtr = "\0";
330 return nullPtr.ptr;
331 }
332 }
333
323 static char[] toHex(uint value, bool prefix = true, int radix = 8){ 334 static char[] toHex(uint value, bool prefix = true, int radix = 8){
324 return tango.text.convert.Integer.toString( 335 return tango.text.convert.Integer.toString(
325 value, 336 value,
326 radix is 10 ? tango.text.convert.Integer.Style.Signed : 337 radix is 10 ? tango.text.convert.Integer.Style.Signed :
327 radix is 8 ? tango.text.convert.Integer.Style.Octal : 338 radix is 8 ? tango.text.convert.Integer.Style.Octal :