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