Ver Fonte

Added stubbed implementations for classes.

svn path=/trunk/mcs/; revision=476
Jim Richardson há 24 anos atrás
pai
commit
fa145bef84

+ 173 - 0
mcs/class/corlib/System.IO/Directory.cs

@@ -0,0 +1,173 @@
+//------------------------------------------------------------------------------
+// 
+// System.IO.Directory.cs 
+//
+// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
+// 
+// Author:         Jim Richardson, [email protected]
+// Created:        Monday, August 13, 2001 
+//
+//------------------------------------------------------------------------------
+
+using System;
+
+namespace System.IO
+{
+	/// <summary>
+	/// 
+	/// </summary>
+	public sealed class Directory : Object
+	{
+
+		/// <summary>
+		/// Creates all directories not existing in path
+		/// </summary>
+		public static DirectoryInfo CreateDirectory(string path)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Delete an empty directory
+		/// </summary>
+		public static void Delete(string path)
+		{
+		}
+		/// <summary>
+		/// Delete a directory, and contents if bRecurse is true
+		/// </summary>
+		public static void Delete(string path, bool bRecurse)
+		{
+		}
+		/// <summary>
+		/// Returns true if directory exists on disk
+		/// </summary>
+		public static bool Exists(string path)
+		{
+			return false;
+		}
+		/// <summary>
+		/// Returns the date and time the directory specified by path was created
+		/// </summary>
+		public static DateTime GetCreationTime(string path)
+		{
+			return DateTime.MinValue;
+		}
+		/// <summary>
+		/// Returns the date and time the directory specified by path was created
+		/// </summary>
+		public static string GetCurrentDirectory()
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of directories in the directory specified by path
+		/// </summary>
+		public static string[] GetDirectories(string path)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of directories in the directory specified by path
+		/// matching the filter specified by mask
+		/// </summary>
+		public static string[] GetDirectories(string path, string mask)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns the root of the specified path
+		/// </summary>
+		public static string GetDirectoryRoot(string path)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of files in the directory specified by path
+		/// </summary>
+		public static string[] GetFiles(string path)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of files in the directory specified by path
+		/// matching the filter specified by mask
+		/// </summary>
+		public static string[] GetFiles(string path, string mask)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of filesystementries in the directory specified by path
+		/// </summary>
+		public static string[] GetFileSystemEntries(string path)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of filesystementries in the directory specified by path
+		/// matching the filter specified by mask
+		/// </summary>
+		public static string[] GetFileSystemEntries(string path, string mask)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns the date and time the directory specified by path was last accessed
+		/// </summary>
+		public static DateTime GetLastAccessTime(string path)
+		{
+			return DateTime.MinValue;
+		}
+		/// <summary>
+		/// Returns the date and time the directory specified by path was last modified
+		/// </summary>
+		public static DateTime GetLastWriteTime(string path)
+		{
+			return DateTime.MinValue;
+		}
+		/// <summary>
+		/// Returns an array of logical drives on this system
+		/// </summary>
+		public static string[] GetLogicalDrives()
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns the parent directory of the directory specified by path
+		/// </summary>
+		public static DirectoryInfo GetParent(string path)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Moves a directory and its contents
+		/// </summary>
+		public static void Move(string srcDirName, string destDirName)
+		{
+		}
+		/// <summary>
+		/// Sets the creation time of the directory specified by path
+		/// </summary>
+		public static void SetCreationTime(string path, DateTime creationTime)
+		{
+		}
+		/// <summary>
+		/// Sets the current directory to the directory specified by path
+		/// </summary>
+		public static void SetCurrentDirectory(string path)
+		{
+		}
+		/// <summary>
+		/// Sets the last access time of the directory specified by path
+		/// </summary>
+		public static void SetLastAccessTime(string path, DateTime accessTime)
+		{
+		}
+		/// <summary>
+		/// Sets the last write time of the directory specified by path
+		/// </summary>
+		public static void SetLastWriteTime(string path, DateTime modifiedTime)
+		{
+		}
+	}
+}

+ 128 - 0
mcs/class/corlib/System.IO/DirectoryInfo.cs

@@ -0,0 +1,128 @@
+//------------------------------------------------------------------------------
+// 
+// System.IO.DirectoryInfo.cs 
+//
+// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
+// 
+// Author:         Jim Richardson, [email protected]
+// Created:        Monday, August 13, 2001 
+//
+//------------------------------------------------------------------------------
+
+using System;
+
+namespace System.IO
+{
+	/// <summary>
+	/// 
+	/// </summary>
+	public sealed class DirectoryInfo : FileSystemInfo
+	{
+
+		public DirectoryInfo()
+		{
+			// 
+			// TODO: Add constructor logic here
+			//
+		}
+
+		public override bool Exists
+		{
+			get
+			{
+				return false;
+			}
+		}
+
+		public override string Name
+		{
+			get
+			{	//TODO: Implement this as per the documenation
+				return FullPath;
+			}
+		}
+
+		public DirectoryInfo Root
+		{
+			get
+			{
+				return null;
+			}
+		}
+
+		public void Create()
+		{
+		}
+
+		DirectoryInfo CreateSubdirectory(string path)
+		{
+			return null;
+		}
+
+		public override void Delete()
+		{
+			Directory.Delete(FullPath);
+		}
+
+		public void Delete(bool bRecurse)
+		{
+			Directory.Delete(FullPath, bRecurse);
+		}
+
+		/// <summary>
+		/// Returns an array of DirectoryInfos for subdirectories
+		/// </summary>
+		public DirectoryInfo[] GetDirectories()
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of DirectoryInfos
+		/// matching the filter specified by mask
+		/// </summary>
+		public static DirectoryInfo[] GetDirectories(string mask)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of FileInfo for subdirectories
+		/// </summary>
+		public FileInfo[] GetFiles()
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of FileInfo
+		/// matching the filter specified by mask
+		/// </summary>
+		public static FileInfo[] GetFiles(string mask)
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of FileSystemInfo for subdirectories
+		/// </summary>
+		public FileSystemInfo[] GetFileSystemInfos()
+		{
+			return null;
+		}
+		/// <summary>
+		/// Returns an array of FileSystemInfo
+		/// matching the filter specified by mask
+		/// </summary>
+		public static FileSystemInfo[] GetFileSystemInfos(string mask)
+		{
+			return null;
+		}
+
+		public void MoveTo(string destDirName)
+		{
+			Directory.Move(FullName, destDirName);
+		}
+
+		public override string ToString()
+		{
+			return FullName;
+		}
+	}
+}

+ 33 - 0
mcs/class/corlib/System.IO/FileAttributes.cs

@@ -0,0 +1,33 @@
+//------------------------------------------------------------------------------
+// 
+// System.IO.FileAttributes.cs 
+//
+// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
+// 
+// Author:         Jim Richardson, [email protected]
+// Created:        Monday, August 13, 2001 
+//
+//------------------------------------------------------------------------------
+
+
+namespace System.IO
+{
+	public enum FileAttributes
+	{
+		Archive,
+		Compressed, 
+		Device, // Reserved for future use. 
+		Directory,
+		Encrypted,
+		Hidden,
+		Normal,
+		NotContentIndexed,
+		Offline,
+		ReadOnly,
+		ReparsePoint,
+		SparseFile,
+		System,
+		Temporary 
+	}
+
+}

+ 142 - 0
mcs/class/corlib/System.IO/FileInfo.cs

@@ -0,0 +1,142 @@
+//------------------------------------------------------------------------------
+// 
+// System.IO.FileInfo.cs 
+//
+// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
+// 
+// Author:         Jim Richardson, [email protected]
+// Created:        Monday, August 13, 2001 
+//
+//------------------------------------------------------------------------------
+
+using System;
+
+namespace System.IO
+{
+	/// <summary>
+	/// 
+	/// </summary>
+	public sealed class FileInfo : FileSystemInfo
+	{
+		public FileInfo()
+		{
+			// 
+			// TODO: Add constructor logic here
+			//
+		}
+
+		public override bool Exists
+		{
+			get
+			{
+				return false;
+			}
+		}
+
+		public override string Name
+		{
+			get
+			{	//TODO: Implement this as per the documenation
+				return FullPath;
+			}
+		}
+
+		/// <summary>
+		/// Gets the parent directory info
+		/// </summary>
+		public DirectoryInfo Directory
+		{
+			get
+			{
+				return null;
+			}
+		}
+
+		/// <summary>
+		/// Get the path of the file
+		/// </summary>
+		public string DirectoryName
+		{
+			get
+			{
+				return null;
+			}
+		}
+
+		/// <summary>
+		/// Get the length of the file
+		/// </summary>
+		public long Length
+		{
+			get
+			{
+				return 0;
+			}
+		}
+
+		/* TODO: Uncomment / implement as classes become available
+		public StreamWriter AppendText()
+		{
+		}
+		
+
+		public FileStream Create()
+		{
+			return null;
+		}
+
+		public StreamWriter CreateText()
+		{
+			return null;
+		}
+		
+		public FileStream Open(FileMode mode)
+		{
+			return Open(mode, FileAccess.ReadWrite);
+		}
+
+		public FileStream Open(FileMode mode, FileAccess access)
+		{
+			return Open(mode, access, FileShare.None);
+		}
+
+		public FileStream Open(FileMode mode, FileAccess access, FileShare share)
+		{
+			return null;
+		}
+
+		public FileStream OpenRead()
+		{	// TODO: find out what default share should be
+			return Open(FileMode.Open, FileAccess.Read, FileShare.Read);
+		}
+
+		public StreamReader OpenText()
+		{
+			return null;
+		}
+
+		public FileStream OpenWrite()
+		{
+			return Open(FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
+		}
+		*/
+
+		public FileInfo CopyTo(string destFile)
+		{
+			return CopyTo(destFile, false);
+		}
+
+		public FileInfo CopyTo(string destFile, bool bOverwrite)
+		{
+			return null;
+		}
+
+		public override void Delete()
+		{
+		}
+
+		public void MoveTo(string destName)
+		{
+		}
+	}
+}

+ 135 - 0
mcs/class/corlib/System.IO/FileSystemInfo.cs

@@ -0,0 +1,135 @@
+//------------------------------------------------------------------------------
+// 
+// System.IO.FileSystemInfo.cs 
+//
+// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
+// 
+// Author:         Jim Richardson, [email protected]
+// Created:        Monday, August 13, 2001 
+//
+//------------------------------------------------------------------------------
+
+using System;
+
+namespace System.IO
+{
+	/// <summary>
+	/// 
+	/// </summary>
+	public abstract class FileSystemInfo : MarshalByRefObject
+	{
+		private FileAttributes itsAttributes;
+		private DateTime itsCreated;
+		private DateTime itsLastAccess;
+		private DateTime itsLastWrite;
+		//private string itsFullName;
+		protected string FullPath;
+		protected string OriginalPath;
+
+		public FileSystemInfo()
+		{
+			// 
+			// TODO: Add constructor logic here
+			//
+		}
+
+		public FileAttributes Attributes
+		{
+			get
+			{
+				return itsAttributes;
+			}
+			set
+			{
+				itsAttributes = value;
+			}
+		}
+
+		public DateTime CreationTime
+		{
+			get
+			{
+				return itsCreated;
+			}
+			set
+			{
+				itsCreated = value;
+			}
+		}
+
+		public abstract bool Exists {get;}
+		public abstract string Name {get;}
+		public abstract void Delete();
+
+		/// <summary>
+		/// Get the extension of this item
+		/// </summary>
+		public string Extension
+		{
+			get
+			{
+				return Path.GetExtension(FullPath);
+			}
+		}
+
+		public string FullName
+		{
+			get
+			{
+				return FullPath;
+			}
+		}
+
+		public DateTime LastAccessTime
+		{
+			get
+			{
+				return itsLastAccess;
+			}
+		}
+
+		public DateTime LastWriteTime
+		{
+			get
+			{
+				return itsLastWrite;
+			}
+		}
+
+		public override int GetHashCode()
+		{
+			return FullPath.GetHashCode();
+		}
+
+		public override bool Equals(object obj)
+		{
+			return false;
+		}
+
+		new public static bool Equals(object obj1, object obj2)
+		{
+			return false;
+		}
+
+		public void Refresh()
+		{
+		}
+
+		/* TODO: determine if we need these
+		public override ObjRef CreateObjRef(Type requestedType)
+		{
+			return null;
+		}
+		
+		/*public object GetLifeTimeService ()
+		{
+			return null;
+		}
+
+		public override object InitializeLifeTimeService ()
+		{
+			return null;
+		}
+		*/
+	}
+}