Mercurial > projects > dwt-mac
diff dwt/dwthelper/utils.d @ 139:86fc761a24ae
Fixes #11
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 04 Jun 2009 23:23:10 +0200 |
parents | 623ff6db5f1d |
children |
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d Wed Jun 03 00:36:31 2009 +0200 +++ b/dwt/dwthelper/utils.d Thu Jun 04 23:23:10 2009 +0200 @@ -555,6 +555,14 @@ return cont.dup; } +wchar[] new_String( wchar[] cont, int offset, int len ){ + return cont[ offset .. offset+len ].dup; +} + +wchar[] new_String (wchar[] cont){ + return cont.dup; +} + public String toUpperCase( String str ){ return tango.text.Unicode.toUpper( str ); } @@ -638,6 +646,18 @@ return toString16( str ); } +public String fromString16( wchar[] str ){ + return toString( str ); +} + +public char toChar(wchar c){ + return [c].toString()[0]; +} + +public wchar toWChar(char c){ + return [c].toString16()[0]; +} + public bool endsWith( String src, String pattern ){ if( src.length < pattern.length ){ return false; @@ -649,6 +669,10 @@ return src == other; } +public bool equals( wchar[] src, wchar[] other ){ + return src == other; +} + public bool equalsIgnoreCase( String src, String other ){ return tango.text.Unicode.toFold(src) == tango.text.Unicode.toFold(other); }