Mercurial > projects > dwt-win
annotate dwt/dwthelper/File.d @ 272:463d461e6e78
Fix path handling, thanks yidabu for reporting.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 01 Aug 2008 07:16:10 +0200 |
parents | a63e2cd5485e |
children | f403c83322c3 |
rev | line source |
---|---|
0 | 1 /** |
2 * Authors: Frank Benoit <keinfarbton@googlemail.com> | |
3 */ | |
4 module dwt.dwthelper.File; | |
5 | |
6 import dwt.dwthelper.utils; | |
7 | |
264
a63e2cd5485e
Removed version=TANGOSVN for release 0.99.7
Frank Benoit <benoit@tionex.de>
parents:
248
diff
changeset
|
8 static import tango.io.model.IFile; |
0 | 9 static import tango.io.FilePath; |
272
463d461e6e78
Fix path handling, thanks yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
264
diff
changeset
|
10 static import tango.io.Path; |
0 | 11 static import tango.io.FileSystem; |
12 | |
13 public class File { | |
14 | |
15 public static char separatorChar; | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
16 public static String separator; |
0 | 17 public static char pathSeparatorChar; |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
18 public static String pathSeparator; |
0 | 19 |
20 private tango.io.FilePath.FilePath mFilePath; | |
21 | |
22 static this(){ | |
248 | 23 separator = tango.io.model.IFile.FileConst.PathSeparatorString; |
24 separatorChar = tango.io.model.IFile.FileConst.PathSeparatorChar; | |
25 pathSeparator = tango.io.model.IFile.FileConst.SystemPathString; | |
26 pathSeparatorChar = tango.io.model.IFile.FileConst.SystemPathChar; | |
0 | 27 } |
28 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
29 public this ( String pathname ){ |
272
463d461e6e78
Fix path handling, thanks yidabu for reporting.
Frank Benoit <benoit@tionex.de>
parents:
264
diff
changeset
|
30 mFilePath = new tango.io.FilePath.FilePath( tango.io.Path.standard( pathname )); |
0 | 31 } |
32 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
33 public this ( String parent, String child ){ |
0 | 34 mFilePath = new tango.io.FilePath.FilePath( tango.io.FilePath.FilePath.join( parent, child ) ); |
35 } | |
36 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
37 public this ( dwt.dwthelper.File.File parent, String child ){ |
0 | 38 mFilePath = new tango.io.FilePath.FilePath( tango.io.FilePath.FilePath.join( parent.mFilePath.toString, child ) ); |
39 } | |
40 | |
41 public int getPrefixLength(){ | |
42 implMissing( __FILE__, __LINE__ ); | |
43 return 0; | |
44 } | |
45 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
46 public String getName(){ |
0 | 47 implMissing( __FILE__, __LINE__ ); |
48 return null; | |
49 } | |
50 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
51 public String getParent(){ |
0 | 52 implMissing( __FILE__, __LINE__ ); |
53 return null; | |
54 } | |
55 | |
56 public dwt.dwthelper.File.File getParentFile(){ | |
57 implMissing( __FILE__, __LINE__ ); | |
58 return null; | |
59 } | |
60 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
61 public String getPath(){ |
0 | 62 implMissing( __FILE__, __LINE__ ); |
63 return null; | |
64 } | |
65 | |
66 public bool isAbsolute(){ | |
67 implMissing( __FILE__, __LINE__ ); | |
68 return false; | |
69 } | |
70 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
71 public String getAbsolutePath(){ |
0 | 72 return tango.io.FileSystem.FileSystem.toAbsolute( mFilePath ).toString; |
73 } | |
74 | |
75 public dwt.dwthelper.File.File getAbsoluteFile(){ | |
76 return new File( getAbsolutePath() ); | |
77 } | |
78 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
79 public String getCanonicalPath(){ |
0 | 80 implMissing( __FILE__, __LINE__ ); |
81 return null; | |
82 } | |
83 | |
84 public dwt.dwthelper.File.File getCanonicalFile(){ | |
85 implMissing( __FILE__, __LINE__ ); | |
86 return null; | |
87 } | |
88 | |
89 public bool canRead(){ | |
90 implMissing( __FILE__, __LINE__ ); | |
91 return false; | |
92 } | |
93 | |
94 public bool canWrite(){ | |
95 return mFilePath.isWritable; | |
96 } | |
97 | |
98 public bool exists(){ | |
99 return mFilePath.exists; | |
100 } | |
101 | |
102 public bool isDirectory(){ | |
103 return mFilePath.isFolder; | |
104 } | |
105 | |
106 public bool isFile(){ | |
107 implMissing( __FILE__, __LINE__ ); | |
108 return false; | |
109 } | |
110 | |
111 public bool isHidden(){ | |
112 implMissing( __FILE__, __LINE__ ); | |
113 return false; | |
114 } | |
115 | |
116 public long lastModified(){ | |
117 implMissing( __FILE__, __LINE__ ); | |
118 return 0L; | |
119 } | |
120 | |
121 public long length(){ | |
122 implMissing( __FILE__, __LINE__ ); | |
123 return 0L; | |
124 } | |
125 | |
126 public bool createNewFile(){ | |
127 implMissing( __FILE__, __LINE__ ); | |
128 return false; | |
129 } | |
130 | |
131 public bool delete_KEYWORDESCAPE(){ | |
132 implMissing( __FILE__, __LINE__ ); | |
133 return false; | |
134 } | |
135 | |
136 public void deleteOnExit(){ | |
137 implMissing( __FILE__, __LINE__ ); | |
138 } | |
139 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
140 public String[] list(){ |
0 | 141 implMissing( __FILE__, __LINE__ ); |
142 return null; | |
143 } | |
144 | |
145 public dwt.dwthelper.File.File[] listFiles(){ | |
146 implMissing( __FILE__, __LINE__ ); | |
147 return null; | |
148 } | |
149 | |
150 public bool mkdir(){ | |
151 implMissing( __FILE__, __LINE__ ); | |
152 return false; | |
153 } | |
154 | |
155 public bool mkdirs(){ | |
156 implMissing( __FILE__, __LINE__ ); | |
157 return false; | |
158 } | |
159 | |
160 public bool renameTo( dwt.dwthelper.File.File dest ){ | |
161 implMissing( __FILE__, __LINE__ ); | |
162 return false; | |
163 } | |
164 | |
165 public bool setLastModified( long time ){ | |
166 implMissing( __FILE__, __LINE__ ); | |
167 return false; | |
168 } | |
169 | |
170 public bool setReadOnly(){ | |
171 implMissing( __FILE__, __LINE__ ); | |
172 return false; | |
173 } | |
174 | |
175 public static dwt.dwthelper.File.File[] listRoots(){ | |
176 implMissing( __FILE__, __LINE__ ); | |
177 return null; | |
178 } | |
179 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
180 public static dwt.dwthelper.File.File createTempFile( String prefix, String suffix, dwt.dwthelper.File.File directory ){ |
0 | 181 implMissing( __FILE__, __LINE__ ); |
182 return null; | |
183 } | |
184 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
185 public static dwt.dwthelper.File.File createTempFile( String prefix, String suffix ){ |
0 | 186 implMissing( __FILE__, __LINE__ ); |
187 return null; | |
188 } | |
189 | |
190 public int compareTo( dwt.dwthelper.File.File pathname ){ | |
191 implMissing( __FILE__, __LINE__ ); | |
192 return 0; | |
193 } | |
194 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
195 public String toString(){ |
0 | 196 implMissing( __FILE__, __LINE__ ); |
197 return null; | |
198 } | |
199 | |
200 | |
201 } | |
202 | |
203 |