Mercurial > projects > dwt-linux
diff dwt/dwthelper/File.d @ 12:0c78fa47d476
helper classes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 06 Jan 2008 19:36:29 +0100 |
parents | |
children | 62a654ba5276 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/dwthelper/File.d Sun Jan 06 19:36:29 2008 +0100 @@ -0,0 +1,202 @@ +/** + * Authors: Frank Benoit <keinfarbton@googlemail.com> + */ +module dwt.dwthelper.File; + +import dwt.dwthelper.utils; + +static import tango.io.FileConst; +static import tango.io.FilePath; +static import tango.io.FileSystem; + +public class File { + + public static char separatorChar; + public static char[] separator; + public static char pathSeparatorChar; + public static char[] pathSeparator; + + private tango.io.FilePath.FilePath mFilePath; + + public this ( char[] pathname ){ + mFilePath = new tango.io.FilePath.FilePath( pathname ); + } + + public this ( char[] parent, char[] child ){ + mFilePath = new tango.io.FilePath.FilePath( tango.io.FilePath.FilePath.join( parent, child ) ); + } + + public this ( dwt.dwthelper.File.File parent, char[] child ){ + mFilePath = new tango.io.FilePath.FilePath( tango.io.FilePath.FilePath.join( parent.mFilePath.toString, child ) ); + } + + public int getPrefixLength(){ + implMissing( __FILE__, __LINE__ ); + return 0; + } + + public char[] getName(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public char[] getParent(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public dwt.dwthelper.File.File getParentFile(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public char[] getPath(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public bool isAbsolute(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public char[] getAbsolutePath(){ + return tango.io.FileSystem.FileSystem.toAbsolute( mFilePath ).toString; + } + + public dwt.dwthelper.File.File getAbsoluteFile(){ + return new File( getAbsolutePath() ); + } + + public char[] getCanonicalPath(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public dwt.dwthelper.File.File getCanonicalFile(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public bool canRead(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public bool canWrite(){ + return mFilePath.isWritable; + } + + public bool exists(){ + return mFilePath.exists; + } + + public bool isDirectory(){ + return mFilePath.isFolder; + } + + public bool isFile(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public bool isHidden(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public long lastModified(){ + implMissing( __FILE__, __LINE__ ); + return 0L; + } + + public long length(){ + implMissing( __FILE__, __LINE__ ); + return 0L; + } + + public bool createNewFile(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public bool delete_KEYWORDESCAPE(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public void deleteOnExit(){ + implMissing( __FILE__, __LINE__ ); + } + + public char[][] list(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public dwt.dwthelper.File.File[] listFiles(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public bool mkdir(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public bool mkdirs(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public bool renameTo( dwt.dwthelper.File.File dest ){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public bool setLastModified( long time ){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public bool setReadOnly(){ + implMissing( __FILE__, __LINE__ ); + return false; + } + + public static dwt.dwthelper.File.File[] listRoots(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public static dwt.dwthelper.File.File createTempFile( char[] prefix, char[] suffix, dwt.dwthelper.File.File directory ){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public static dwt.dwthelper.File.File createTempFile( char[] prefix, char[] suffix ){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public int compareTo( dwt.dwthelper.File.File pathname ){ + implMissing( __FILE__, __LINE__ ); + return 0; + } + + public char[] toString(){ + implMissing( __FILE__, __LINE__ ); + return null; + } + + public static void static_this(){ + separator = tango.io.FileConst.FileConst.PathSeparatorString; + separatorChar = tango.io.FileConst.FileConst.PathSeparatorChar; + pathSeparator = tango.io.FileConst.FileConst.SystemPathString; + pathSeparatorChar = tango.io.FileConst.FileConst.SystemPathChar; + } + + +} + +