Mercurial > projects > dwt-linux
changeset 227:4e6393f43231
Boolean valueOf
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Apr 2008 23:19:11 +0200 |
parents | 6da025bf255e |
children | a8304c57f9d8 |
files | dwt/dwthelper/utils.d |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d Fri Apr 11 17:50:39 2008 +0200 +++ b/dwt/dwthelper/utils.d Fri Apr 11 23:19:11 2008 +0200 @@ -94,6 +94,15 @@ public bool booleanValue(){ return value; } + public static Boolean valueOf( char[] s ){ + if( s == "yes" || s == "true" ){ + return TRUE; + } + return FALSE; + } + public static Boolean valueOf( bool b ){ + return b ? TRUE : FALSE; + } } alias Boolean ValueWrapperBool;