diff 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
line wrap: on
line diff
--- a/dwt/dwthelper/System.d	Thu Aug 14 20:25:29 2008 -0700
+++ b/dwt/dwthelper/System.d	Sat Aug 16 22:53:35 2008 -0700
@@ -5,7 +5,9 @@
 
 import dwt.dwthelper.utils;
 
+import tango.sys.Environment;
 import tango.core.Exception;
+import tango.io.model.IFile;
 import tango.time.Clock;
 import tango.stdc.stdlib : exit;
 
@@ -145,11 +147,36 @@
     }
 
     public static String getProperty( String key ){
-        switch( key ){
-        case "os.name": return "linux";
-        case "file.separator" : return ".";
-        default: return null;
+        /* Get values for local dwt specific keys */
+        String* p;
+        if (key[0..3] == "dwt") {
+            return ((p = key in localProperties) != null) ? *p : null;
+        }
+        /* else get values for global system keys (environment) */
+        } else {
+            switch( key ){
+                case "os.name": return "linux";
+                case "user.name" return "";
+                case "user.home" return "";
+                case "user.dir" : return "";
+                case "file.separator" : return FileConst.PathSeparatorString ;
+                default: return null;
+            }
         }
     }
+
+    public static void setProperty ( String key, String value ) {
+        /* set property for local dwt keys */
+        if (key[0..3] == "dwt") {
+            if (key !is null && value !is null) 
+                localProperties[ key ] = value;
+        /* else set properties for global system keys (environment) */
+        } else {
+        
+        }
+
+    }
+
+    private static String[String] localProperties;
 }