Mercurial > projects > dwt-linux
comparison dwt/dwthelper/System.d @ 305:c7c696cdfec2
Mozilla module progress; fixes to other browser modules; update XPCOM interfaces
author | John Reimer<terminal.node@gmail.com> |
---|---|
date | Sat, 16 Aug 2008 22:53:35 -0700 |
parents | e72345914350 |
children | 9764f08379f2 |
comparison
equal
deleted
inserted
replaced
304:16ba3d9cb209 | 305:c7c696cdfec2 |
---|---|
3 */ | 3 */ |
4 module dwt.dwthelper.System; | 4 module dwt.dwthelper.System; |
5 | 5 |
6 import dwt.dwthelper.utils; | 6 import dwt.dwthelper.utils; |
7 | 7 |
8 import tango.sys.Environment; | |
8 import tango.core.Exception; | 9 import tango.core.Exception; |
10 import tango.io.model.IFile; | |
9 import tango.time.Clock; | 11 import tango.time.Clock; |
10 import tango.stdc.stdlib : exit; | 12 import tango.stdc.stdlib : exit; |
11 | 13 |
12 template SimpleType(T) { | 14 template SimpleType(T) { |
13 debug{ | 15 debug{ |
143 } | 145 } |
144 return (*cast(Object *)&x).toHash(); | 146 return (*cast(Object *)&x).toHash(); |
145 } | 147 } |
146 | 148 |
147 public static String getProperty( String key ){ | 149 public static String getProperty( String key ){ |
148 switch( key ){ | 150 /* Get values for local dwt specific keys */ |
149 case "os.name": return "linux"; | 151 String* p; |
150 case "file.separator" : return "."; | 152 if (key[0..3] == "dwt") { |
151 default: return null; | 153 return ((p = key in localProperties) != null) ? *p : null; |
154 } | |
155 /* else get values for global system keys (environment) */ | |
156 } else { | |
157 switch( key ){ | |
158 case "os.name": return "linux"; | |
159 case "user.name" return ""; | |
160 case "user.home" return ""; | |
161 case "user.dir" : return ""; | |
162 case "file.separator" : return FileConst.PathSeparatorString ; | |
163 default: return null; | |
164 } | |
152 } | 165 } |
153 } | 166 } |
167 | |
168 public static void setProperty ( String key, String value ) { | |
169 /* set property for local dwt keys */ | |
170 if (key[0..3] == "dwt") { | |
171 if (key !is null && value !is null) | |
172 localProperties[ key ] = value; | |
173 /* else set properties for global system keys (environment) */ | |
174 } else { | |
175 | |
176 } | |
177 | |
178 } | |
179 | |
180 private static String[String] localProperties; | |
154 } | 181 } |
155 | 182 |