| 1 |
/** |
|---|
| 2 |
* Authors: Frank Benoit <keinfarbton@googlemail.com> |
|---|
| 3 |
*/ |
|---|
| 4 |
module dwt.dwthelper.File; |
|---|
| 5 |
|
|---|
| 6 |
import dwt.dwthelper.utils; |
|---|
| 7 |
|
|---|
| 8 |
static import tango.io.model.IFile; |
|---|
| 9 |
static import tango.io.FilePath; |
|---|
| 10 |
static import tango.io.Path; |
|---|
| 11 |
static import tango.io.FileSystem; |
|---|
| 12 |
|
|---|
| 13 |
public class File { |
|---|
| 14 |
|
|---|
| 15 |
public static char separatorChar; |
|---|
| 16 |
public static String separator; |
|---|
| 17 |
public static char pathSeparatorChar; |
|---|
| 18 |
public static String pathSeparator; |
|---|
| 19 |
|
|---|
| 20 |
private tango.io.FilePath.FilePath mFilePath; |
|---|
| 21 |
|
|---|
| 22 |
static this(){ |
|---|
| 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; |
|---|
| 27 |
} |
|---|
| 28 |
|
|---|
| 29 |
public this ( String pathname ){ |
|---|
| 30 |
mFilePath = new tango.io.FilePath.FilePath( tango.io.Path.standard( pathname )); |
|---|
| 31 |
} |
|---|
| 32 |
|
|---|
| 33 |
public this ( String parent, String child ){ |
|---|
| 34 |
mFilePath = new tango.io.FilePath.FilePath( tango.io.FilePath.FilePath.join( parent, child ) ); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
public this ( dwt.dwthelper.File.File parent, String child ){ |
|---|
| 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 |
|
|---|
| 46 |
public String getName(){ |
|---|
| 47 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 48 |
return null; |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
public String getParent(){ |
|---|
| 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 |
|
|---|
| 61 |
public String getPath(){ |
|---|
| 62 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 63 |
return null; |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
public bool isAbsolute(){ |
|---|
| 67 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 68 |
return false; |
|---|
| 69 |
} |
|---|
| 70 |
|
|---|
| 71 |
public String getAbsolutePath(){ |
|---|
| 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 |
|
|---|
| 79 |
public String getCanonicalPath(){ |
|---|
| 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 |
|
|---|
| 140 |
public String[] list(){ |
|---|
| 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 |
|
|---|
| 180 |
public static dwt.dwthelper.File.File createTempFile( String prefix, String suffix, dwt.dwthelper.File.File directory ){ |
|---|
| 181 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 182 |
return null; |
|---|
| 183 |
} |
|---|
| 184 |
|
|---|
| 185 |
public static dwt.dwthelper.File.File createTempFile( String prefix, String suffix ){ |
|---|
| 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 |
|
|---|
| 195 |
public String toString(){ |
|---|
| 196 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 197 |
return null; |
|---|
| 198 |
} |
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
} |
|---|