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