Mercurial > projects > dwt-win
diff dwt/dwthelper/utils.d @ 22:5f2e72114476
Image in work, this revision does not compile
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 26 Jan 2008 19:05:32 +0100 |
parents | 1bea9f0c6f63 |
children | f5482da87ed8 |
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d Sat Jan 26 16:45:05 2008 +0100 +++ b/dwt/dwthelper/utils.d Sat Jan 26 19:05:32 2008 +0100 @@ -1,4 +1,4 @@ -/** +/** * Authors: Frank Benoit <keinfarbton@googlemail.com> */ module dwt.dwthelper.utils; @@ -88,9 +88,24 @@ return str[ pos ]; } +public void getChars( char[] src, int srcBegin, int srcEnd, char[] dst, int dstBegin){ + dst[ dstBegin .. dstBegin + srcEnd - srcBegin ] = str[ srcBegin .. srcEnd ]; +} + +public bool endsWith( char[] src, char[] pattern ){ + if( src.length < pattern.length ){ + return false; + } + return src[ $-pattern.length .. $ ] == pattern; +} + +public char[] toLowerCase( char[] src ){ + return tango.text.Unicode.toLower( src ); +} + static char[] toHex(uint value, bool prefix = true, int radix = 8){ - return tango.text.convert.Integer.toString( - value, + return tango.text.convert.Integer.toString( + value, radix is 10 ? tango.text.convert.Integer.Style.Signed : radix is 8 ? tango.text.convert.Integer.Style.Octal : radix is 16 ? tango.text.convert.Integer.Style.Hex :