Mercurial > projects > dwt2
diff org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d @ 54:70388b0e6dad
[swt lin] compiles
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 27 Mar 2009 23:31:11 +0100 |
parents | c01d033c633a |
children | 536e43f63c81 |
line wrap: on
line diff
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d Fri Mar 27 21:29:10 2009 +0100 +++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d Fri Mar 27 23:31:11 2009 +0100 @@ -117,7 +117,7 @@ * @param child the file's name * @return true if the file exists */ -public static bool fileExists(String parent, String child) { +public static bool fileExists(CString parent, CString child) { return (new File (parent, child)).exists(); } @@ -192,8 +192,8 @@ * @return a stream on the file if it could be opened. * @exception IOException */ -public static InputStream newFileInputStream(String filename) { - return new FileInputStream(filename); +public static InputStream newFileInputStream(CString filename) { + return new FileInputStream(filename._idup()); } /** @@ -203,8 +203,8 @@ * @return a stream on the file if it could be opened. * @exception IOException */ -public static OutputStream newFileOutputStream(String filename) { - return new FileOutputStream(filename); +public static OutputStream newFileOutputStream(CString filename) { + return new FileOutputStream(filename._idup()); } /** @@ -272,7 +272,7 @@ * @exception ProcessException * if the program cannot be executed */ -public static void exec(String prog) { +public static void exec(CString prog) { version(Tango){ auto proc = new Process( prog ); proc.execute; @@ -293,7 +293,7 @@ * @exception ProcessException * if the program cannot be executed */ -public static void exec(String[] progArray) { +public static void exec(CString[] progArray) { version(Tango){ auto proc = new Process( progArray ); proc.execute; @@ -341,8 +341,8 @@ * * @see SWT#getMessage(String) */ -public static String getMessage(String key) { - String answer = key; +public static String getMessage(CString key) { + String answer = key._idup(); if (key is null) { SWT.error (SWT.ERROR_NULL_ARGUMENT); @@ -351,7 +351,7 @@ try { msgs = ResourceBundle.getBundle(SWTMessagesBundleData); //$NON-NLS-1$ } catch (MissingResourceException ex) { - answer = key ~ " (no resource bundle)"; //$NON-NLS-1$ + answer = cast(String)(key ~ " (no resource bundle)"); //$NON-NLS-1$ } } if (msgs !is null) { @@ -362,8 +362,8 @@ return answer; } -public static String getMessage(String key, Object[] args) { - String answer = key; +public static String getMessage(CString key, Object[] args) { + String answer = key._idup(); if (key is null || args is null) { SWT.error (SWT.ERROR_NULL_ARGUMENT); @@ -372,7 +372,7 @@ try { msgs = ResourceBundle.getBundle(SWTMessagesBundleData); //$NON-NLS-1$ } catch (MissingResourceException ex) { - answer = key ~ " (no resource bundle)"; //$NON-NLS-1$ + answer = cast(String)(key ~ " (no resource bundle)"); //$NON-NLS-1$ } } if (msgs !is null) { @@ -413,7 +413,7 @@ * @param s2 string * @return true if the two instances of class String are equal */ -public static bool equalsIgnoreCase(String s1, String s2) { +public static bool equalsIgnoreCase(CString s1, CString s2) { version(Tango){ String s1b = new char[ s1.length ]; String s2b = new char[ s1.length ];