Author: dick
Date: 2007-04-30 10:05:12 -0400 (Mon, 30 Apr 2007)
New Revision: 76495
Modified:
trunk/mcs/class/corlib/System.IO/BinaryReader.cs
trunk/mcs/class/corlib/System.IO/BinaryWriter.cs
trunk/mcs/class/corlib/System.IO/BufferedStream.cs
trunk/mcs/class/corlib/System.IO/ChangeLog
trunk/mcs/class/corlib/System.IO/Directory.cs
trunk/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
trunk/mcs/class/corlib/System.IO/DriveInfo.cs
trunk/mcs/class/corlib/System.IO/DriveType.cs
trunk/mcs/class/corlib/System.IO/EndOfStreamException.cs
trunk/mcs/class/corlib/System.IO/File.cs
trunk/mcs/class/corlib/System.IO/FileAccess.cs
trunk/mcs/class/corlib/System.IO/FileAttributes.cs
trunk/mcs/class/corlib/System.IO/FileInfo.cs
trunk/mcs/class/corlib/System.IO/FileLoadException.cs
trunk/mcs/class/corlib/System.IO/FileMode.cs
trunk/mcs/class/corlib/System.IO/FileNotFoundException.cs
trunk/mcs/class/corlib/System.IO/FileShare.cs
trunk/mcs/class/corlib/System.IO/FileStream.cs
trunk/mcs/class/corlib/System.IO/IOException.cs
trunk/mcs/class/corlib/System.IO/MemoryStream.cs
trunk/mcs/class/corlib/System.IO/PathTooLongException.cs
trunk/mcs/class/corlib/System.IO/SeekOrigin.cs
trunk/mcs/class/corlib/System.IO/Stream.cs
trunk/mcs/class/corlib/System.IO/StreamReader.cs
trunk/mcs/class/corlib/System.IO/StreamWriter.cs
trunk/mcs/class/corlib/System.IO/StringReader.cs
trunk/mcs/class/corlib/System.IO/StringWriter.cs
trunk/mcs/class/corlib/System.IO/TextReader.cs
trunk/mcs/class/corlib/System.IO/TextWriter.cs
trunk/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs
Log:
2007-04-30 Dick Porter <[EMAIL PROTECTED]>
* Directory.cs:
* FileShare.cs:
* DirectoryNotFoundException.cs:
* SeekOrigin.cs:
* FileAttributes.cs:
* IOException.cs:
* MemoryStream.cs:
* FileMode.cs:
* BinaryWriter.cs:
* TextWriter.cs:
* File.cs:
* BinaryReader.cs:
* TextReader.cs:
* UnmanagedMemoryStream.cs:
* StringWriter.cs:
* FileAccess.cs:
* FileLoadException.cs:
* BufferedStream.cs:
* Stream.cs:
* FileInfo.cs:
* FileStream.cs:
* StringReader.cs:
* StreamWriter.cs:
* EndOfStreamException.cs:
* DriveInfo.cs:
* StreamReader.cs:
* PathTooLongException.cs:
* DriveType.cs:
* FileNotFoundException.cs: 2.0 profile updates
Modified: trunk/mcs/class/corlib/System.IO/BinaryReader.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/BinaryReader.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/BinaryReader.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -33,8 +33,14 @@
using System.Text;
using System.Globalization;
using Mono.Security;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class BinaryReader : IDisposable {
Stream m_stream;
Encoding m_encoding;
Modified: trunk/mcs/class/corlib/System.IO/BinaryWriter.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/BinaryWriter.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/BinaryWriter.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,9 +32,15 @@
using System.Text;
using System.Globalization;
using Mono.Security;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class BinaryWriter : IDisposable {
// Null is a BinaryWriter with no backing store.
Modified: trunk/mcs/class/corlib/System.IO/BufferedStream.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/BufferedStream.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/BufferedStream.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -35,6 +35,9 @@
using System.Runtime.InteropServices;
namespace System.IO {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class BufferedStream : Stream {
Stream m_stream;
byte[] m_buffer;
Modified: trunk/mcs/class/corlib/System.IO/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.IO/ChangeLog 2007-04-30 13:54:00 UTC (rev
76494)
+++ trunk/mcs/class/corlib/System.IO/ChangeLog 2007-04-30 14:05:12 UTC (rev
76495)
@@ -1,3 +1,35 @@
+2007-04-30 Dick Porter <[EMAIL PROTECTED]>
+
+ * Directory.cs:
+ * FileShare.cs:
+ * DirectoryNotFoundException.cs:
+ * SeekOrigin.cs:
+ * FileAttributes.cs:
+ * IOException.cs:
+ * MemoryStream.cs:
+ * FileMode.cs:
+ * BinaryWriter.cs:
+ * TextWriter.cs:
+ * File.cs:
+ * BinaryReader.cs:
+ * TextReader.cs:
+ * UnmanagedMemoryStream.cs:
+ * StringWriter.cs:
+ * FileAccess.cs:
+ * FileLoadException.cs:
+ * BufferedStream.cs:
+ * Stream.cs:
+ * FileInfo.cs:
+ * FileStream.cs:
+ * StringReader.cs:
+ * StreamWriter.cs:
+ * EndOfStreamException.cs:
+ * DriveInfo.cs:
+ * StreamReader.cs:
+ * PathTooLongException.cs:
+ * DriveType.cs:
+ * FileNotFoundException.cs: 2.0 profile updates
+
2007-04-21 Alp Toker <[EMAIL PROTECTED]>
* FileStream.cs: Respect request for buffering in all cases.
Modified: trunk/mcs/class/corlib/System.IO/Directory.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/Directory.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/Directory.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -44,10 +44,14 @@
using System.Text;
#if NET_2_0
using System.Security.AccessControl;
+using System.Runtime.InteropServices;
#endif
namespace System.IO
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public
#if NET_2_0
static
@@ -88,6 +92,14 @@
return CreateDirectoriesInternal (path);
}
+#if NET_2_0
+ [MonoTODO ("DirectorySecurity not implemented")]
+ public static DirectoryInfo CreateDirectory (string path,
DirectorySecurity directorySecurity)
+ {
+ return(CreateDirectory (path));
+ }
+#endif
+
static DirectoryInfo CreateDirectoriesInternal (string path)
{
if (SecurityManager.SecurityEnabled) {
@@ -396,6 +408,13 @@
throw MonoIO.GetException (error);
}
+#if NET_2_0
+ public static void SetAccessControl (string path,
DirectorySecurity directorySecurity)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
public static void SetCreationTime (string path, DateTime
creation_time)
{
File.SetCreationTime (path, creation_time);
Modified: trunk/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
2007-04-30 13:54:00 UTC (rev 76494)
+++ trunk/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
2007-04-30 14:05:12 UTC (rev 76495)
@@ -31,10 +31,16 @@
//
using System.Runtime.Serialization;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class DirectoryNotFoundException : IOException {
// Constructors
Modified: trunk/mcs/class/corlib/System.IO/DriveInfo.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/DriveInfo.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/DriveInfo.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -94,7 +94,7 @@
}
}
- [MonoTODO ("Currently only works on Mono/Unix")]
+ [MonoTODO ("Currently get only works on Mono/Unix; set not
implemented")]
public string VolumeLabel {
get {
if (_drive_type != _DriveType.Windows)
@@ -102,6 +102,9 @@
else
return path;
}
+ set {
+ throw new NotImplementedException ();
+ }
}
public string DriveFormat {
@@ -265,10 +268,15 @@
return WindowsGetDrives ();
}
- public void GetObjectData
(System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
+ void ISerializable.GetObjectData
(System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
{
throw new NotImplementedException ();
}
+
+ public override string ToString ()
+ {
+ return(Name);
+ }
}
}
Modified: trunk/mcs/class/corlib/System.IO/DriveType.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/DriveType.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/DriveType.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -24,9 +24,12 @@
#if NET_2_0
using System;
using System.Text;
+using System.Runtime.InteropServices;
namespace System.IO {
+ [ComVisible (true)]
+ [Serializable]
public enum DriveType {
CDRom = 5,
Fixed = 3,
Modified: trunk/mcs/class/corlib/System.IO/EndOfStreamException.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/EndOfStreamException.cs 2007-04-30
13:54:00 UTC (rev 76494)
+++ trunk/mcs/class/corlib/System.IO/EndOfStreamException.cs 2007-04-30
14:05:12 UTC (rev 76495)
@@ -34,10 +34,16 @@
using System.Globalization;
using System.IO;
using System.Runtime.Serialization;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO
{
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class EndOfStreamException : IOException
{
// Constructors
Modified: trunk/mcs/class/corlib/System.IO/File.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/File.cs 2007-04-30 13:54:00 UTC (rev
76494)
+++ trunk/mcs/class/corlib/System.IO/File.cs 2007-04-30 14:05:12 UTC (rev
76495)
@@ -36,6 +36,8 @@
using System.Text;
#if NET_2_0
using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Security.AccessControl;
#endif
namespace System.IO
@@ -43,6 +45,9 @@
/// <summary>
///
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public
#if NET_2_0
static
@@ -121,11 +126,33 @@
public static FileStream Create (string path)
{
- return Create (path, 8192);
+ return(Create (path, 8192, FileOptions.None, null));
}
public static FileStream Create (string path, int buffersize)
{
+ return(Create (path, buffersize, FileOptions.None,
+ null));
+ }
+
+#if NET_2_0
+ [MonoTODO ("options not implemented")]
+ public static FileStream Create (string path, int bufferSize,
+ FileOptions options)
+ {
+ return(Create (path, bufferSize, options, null));
+ }
+
+ [MonoTODO ("options and fileSecurity not implemented")]
+ public static FileStream Create (string path, int bufferSize,
+ FileOptions options,
+ FileSecurity fileSecurity)
+#else
+ private static FileStream Create (string path, int bufferSize,
+ FileOptions options,
+ object fileSecurity)
+#endif
+ {
if (null == path)
throw new ArgumentNullException ("path");
if (String.Empty == path.Trim() ||
path.IndexOfAny(Path.InvalidPathChars) >= 0)
@@ -141,7 +168,7 @@
}
return new FileStream (path, FileMode.Create,
FileAccess.ReadWrite,
- FileShare.None, buffersize);
+ FileShare.None, bufferSize);
}
public static StreamWriter CreateText(string path)
Modified: trunk/mcs/class/corlib/System.IO/FileAccess.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileAccess.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileAccess.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,6 +32,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO {
@@ -39,6 +42,10 @@
/// <summary>
/// </summary>
[Flags]
+#if NET_2_0
+ [ComVisible (true)]
+ [Serializable]
+#endif
public enum FileAccess : int {
/// <summary>
Modified: trunk/mcs/class/corlib/System.IO/FileAttributes.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileAttributes.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileAttributes.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,11 +32,17 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO
{
[Flags]
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum FileAttributes : int
{
Archive = 0x00020,
Modified: trunk/mcs/class/corlib/System.IO/FileInfo.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileInfo.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileInfo.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -35,6 +35,10 @@
using System.Runtime.InteropServices;
+#if NET_2_0
+using System.Security.AccessControl;
+#endif
+
namespace System.IO {
[Serializable]
@@ -245,5 +249,37 @@
public override string ToString () {
return OriginalPath;
}
+
+#if NET_2_0
+ public FileSecurity GetAccessControl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public FileSecurity GetAccessControl (AccessControlSections
includeSections)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [ComVisible (false)]
+ public FileInfo Replace (string destinationFileName,
+ string destinationBackupFileName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [ComVisible (false)]
+ public FileInfo Replace (string destinationFileName,
+ string destinationBackupFileName,
+ bool ignoreMetadataErrors)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetAccessControl (FileSecurity fileSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
}
}
Modified: trunk/mcs/class/corlib/System.IO/FileLoadException.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileLoadException.cs 2007-04-30
13:54:00 UTC (rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileLoadException.cs 2007-04-30
14:05:12 UTC (rev 76495)
@@ -34,9 +34,16 @@
using System.Security.Permissions;
using System.Text;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class FileLoadException : IOException {
// Fields
Modified: trunk/mcs/class/corlib/System.IO/FileMode.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileMode.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileMode.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,12 +32,19 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+ [Serializable]
+#endif
public enum FileMode {
/// <summary>
Modified: trunk/mcs/class/corlib/System.IO/FileNotFoundException.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileNotFoundException.cs 2007-04-30
13:54:00 UTC (rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileNotFoundException.cs 2007-04-30
14:05:12 UTC (rev 76495)
@@ -33,9 +33,16 @@
using System.Security.Permissions;
using System.Text;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class FileNotFoundException : IOException {
const int Result = unchecked ((int)0x80131621);
Modified: trunk/mcs/class/corlib/System.IO/FileShare.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileShare.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileShare.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,6 +32,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO {
@@ -39,6 +42,10 @@
/// <summary>
/// </summary>
[Flags]
+#if NET_2_0
+ [ComVisible (true)]
+ [Serializable]
+#endif
public enum FileShare : int {
None = 0,
Modified: trunk/mcs/class/corlib/System.IO/FileStream.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/FileStream.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/FileStream.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -39,23 +39,39 @@
#if NET_2_0
using Microsoft.Win32.SafeHandles;
+using System.Security.AccessControl;
#endif
namespace System.IO
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class FileStream : Stream
{
// construct from handle
+#if NET_2_0_SAFEFILEHANDLE_ENABLED
+ [Obsolete ("Use FileStream(SafeFileHandle handle, FileAccess
access) instead")]
+#endif
public FileStream (IntPtr handle, FileAccess access)
: this (handle, access, true, DefaultBufferSize, false)
{}
+#if NET_2_0_SAFEFILEHANDLE_ENABLED
+ [Obsolete ("Use FileStream(SafeFileHandle handle, FileAccess
access) instead")]
+#endif
public FileStream (IntPtr handle, FileAccess access, bool
ownsHandle)
: this (handle, access, ownsHandle, DefaultBufferSize,
false) {}
+#if NET_2_0_SAFEFILEHANDLE_ENABLED
+ [Obsolete ("Use FileStream(SafeFileHandle handle, FileAccess
access, int bufferSize) instead")]
+#endif
public FileStream (IntPtr handle, FileAccess access, bool
ownsHandle, int bufferSize)
: this (handle, access, ownsHandle, bufferSize, false)
{}
+#if NET_2_0_SAFEFILEHANDLE_ENABLED
+ [Obsolete ("Use FileStream(SafeFileHandle handle, FileAccess
access, int bufferSize, bool isAsync) instead")]
+#endif
public FileStream (IntPtr handle, FileAccess access, bool
ownsHandle, int bufferSize, bool isAsync)
: this (handle, access, ownsHandle, bufferSize,
isAsync, false) {}
@@ -135,6 +151,38 @@
: this (name, mode, access, share, bufferSize, false,
options)
{
}
+
+ public FileStream (SafeFileHandle handle, FileAccess access)
+ :this(handle, access, DefaultBufferSize, false)
+ {
+ }
+
+ public FileStream (SafeFileHandle handle, FileAccess access,
+ int bufferSize)
+ :this(handle, access, bufferSize, false)
+ {
+ }
+
+ public FileStream (SafeFileHandle handle, FileAccess access,
+ int bufferSize, bool isAsync)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public FileStream (string path, FileMode mode,
+ FileSystemRights rights, FileShare share,
+ int bufferSize, FileOptions options)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public FileStream (string path, FileMode mode,
+ FileSystemRights rights, FileShare share,
+ int bufferSize, FileOptions options,
+ FileSecurity fileSecurity)
+ {
+ throw new NotImplementedException ();
+ }
#endif
internal FileStream (string name, FileMode mode, FileAccess
access, FileShare share, int bufferSize, bool isAsync, bool anonymous)
@@ -352,6 +400,9 @@
}
}
+#if NET_2_0_SAFEFILEHANDLE_ENABLED
+ [Obsolete ("Use SafeFileHandle instead")]
+#endif
public virtual IntPtr Handle {
[SecurityPermission (SecurityAction.LinkDemand,
UnmanagedCode = true)]
[SecurityPermission (SecurityAction.InheritanceDemand,
UnmanagedCode = true)]
@@ -852,6 +903,18 @@
}
}
+#if NET_2_0
+ public FileSecurity GetAccessControl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetAccessControl (FileSecurity fileSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
// private.
// ReadSegment, WriteSegment, FlushBuffer,
Modified: trunk/mcs/class/corlib/System.IO/IOException.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/IOException.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/IOException.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,8 +32,15 @@
using System.Runtime.Serialization;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class IOException : SystemException {
// Constructors
Modified: trunk/mcs/class/corlib/System.IO/MemoryStream.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/MemoryStream.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/MemoryStream.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -39,6 +39,9 @@
namespace System.IO
{
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[MonoTODO ("Serialization format not compatible with .NET")]
public class MemoryStream : Stream
{
Modified: trunk/mcs/class/corlib/System.IO/PathTooLongException.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/PathTooLongException.cs 2007-04-30
13:54:00 UTC (rev 76494)
+++ trunk/mcs/class/corlib/System.IO/PathTooLongException.cs 2007-04-30
14:05:12 UTC (rev 76495)
@@ -35,9 +35,16 @@
using System.IO;
using System.Runtime.Serialization;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
namespace System.IO
{
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class PathTooLongException : IOException
{
// Constructors
Modified: trunk/mcs/class/corlib/System.IO/SeekOrigin.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/SeekOrigin.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/SeekOrigin.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,6 +32,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
namespace System.IO {
@@ -39,6 +42,9 @@
/// <summary>
/// </summary>
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum SeekOrigin : int {
/// <summary>
Modified: trunk/mcs/class/corlib/System.IO/Stream.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/Stream.cs 2007-04-30 13:54:00 UTC (rev
76494)
+++ trunk/mcs/class/corlib/System.IO/Stream.cs 2007-04-30 14:05:12 UTC (rev
76495)
@@ -64,6 +64,7 @@
}
#if NET_2_0
+ [ComVisible (false)]
public virtual bool CanTimeout {
get {
return false;
@@ -104,6 +105,7 @@
Dispose (true);
}
+ [ComVisible (false)]
public virtual int ReadTimeout {
get {
throw new InvalidOperationException ("Timeouts
are not supported on this stream.");
@@ -113,6 +115,7 @@
}
}
+ [ComVisible (false)]
public virtual int WriteTimeout {
get {
throw new InvalidOperationException ("Timeouts
are not supported on this stream.");
Modified: trunk/mcs/class/corlib/System.IO/StreamReader.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/StreamReader.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/StreamReader.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -38,6 +38,9 @@
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class StreamReader : TextReader {
const int DefaultBufferSize = 1024;
Modified: trunk/mcs/class/corlib/System.IO/StreamWriter.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/StreamWriter.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/StreamWriter.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -7,36 +7,43 @@
//
// (C) Ximian, Inc. http://www.ximian.com
//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System.Text;
using System;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class StreamWriter : TextWriter {
private Encoding internalEncoding;
@@ -72,10 +79,10 @@
int BufferSize = Math.Max(bufferSize,
MinimumBufferSize);
decode_buf = new char [BufferSize];
byte_buf = new byte [encoding.GetMaxByteCount
(BufferSize)];
-
- // Fixes bug
http://bugzilla.ximian.com/show_bug.cgi?id=74513
- if (internalStream.CanSeek && internalStream.Position >
0)
- preamble_done = true;
+
+ // Fixes bug
http://bugzilla.ximian.com/show_bug.cgi?id=74513
+ if (internalStream.CanSeek && internalStream.Position >
0)
+ preamble_done = true;
}
//[MonoTODO("Nothing is done with bufferSize")]
@@ -141,17 +148,17 @@
get {
return iflush;
}
- set {
- if (DisposedAlready)
- throw new
ObjectDisposedException("StreamWriter");
- iflush = value;
-
- if (iflush) {
- Flush ();
- }
- }
- }
+ set {
+ if (DisposedAlready)
+ throw new
ObjectDisposedException("StreamWriter");
+ iflush = value;
+ if (iflush) {
+ Flush ();
+ }
+ }
+ }
+
public virtual Stream BaseStream {
get {
return internalStream;
@@ -253,29 +260,29 @@
index += todo;
decode_pos += todo;
}
- }
-
- void LowLevelWrite (string s)
- {
- int count = s.Length;
- int index = 0;
- while (count > 0) {
- int todo = decode_buf.Length - decode_pos;
- if (todo == 0) {
- Decode ();
- todo = decode_buf.Length;
- }
- if (todo > count)
- todo = count;
-
- for (int i = 0; i < todo; i ++)
- decode_buf [i + decode_pos] = s [i +
index];
-
- count -= todo;
- index += todo;
- decode_pos += todo;
- }
}
+
+ void LowLevelWrite (string s)
+ {
+ int count = s.Length;
+ int index = 0;
+ while (count > 0) {
+ int todo = decode_buf.Length - decode_pos;
+ if (todo == 0) {
+ Decode ();
+ todo = decode_buf.Length;
+ }
+ if (todo > count)
+ todo = count;
+
+ for (int i = 0; i < todo; i ++)
+ decode_buf [i + decode_pos] = s [i +
index];
+
+ count -= todo;
+ index += todo;
+ decode_pos += todo;
+ }
+ }
public override void Write (char value)
{
@@ -308,7 +315,7 @@
throw new
ObjectDisposedException("StreamWriter");
if (value != null)
- LowLevelWrite (value);
+ LowLevelWrite (value);
if (iflush)
Flush ();
Modified: trunk/mcs/class/corlib/System.IO/StringReader.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/StringReader.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/StringReader.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -35,6 +35,9 @@
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class StringReader : TextReader {
string source;
Modified: trunk/mcs/class/corlib/System.IO/StringWriter.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/StringWriter.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/StringWriter.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -1,63 +1,70 @@
//
// System.IO.StringWriter
//
-// Authors
-// Marcin Szczepanski ([EMAIL PROTECTED])
-// Sebastien Pouliot <[EMAIL PROTECTED]>
-//
+// Authors
+// Marcin Szczepanski ([EMAIL PROTECTED])
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
// Copyright (C) 2004 Novell (http://www.novell.com)
//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System.Globalization;
using System.Text;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
namespace System.IO {
-
+
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[MonoTODO ("Serialization format not compatible with .NET")]
public class StringWriter : TextWriter {
private StringBuilder internalString;
private bool disposed = false;
- public StringWriter () : this (new StringBuilder ())
- {
+ public StringWriter () : this (new StringBuilder ())
+ {
}
- public StringWriter (IFormatProvider formatProvider) :
- this (new StringBuilder (), formatProvider)
- {
+ public StringWriter (IFormatProvider formatProvider) :
+ this (new StringBuilder (), formatProvider)
+ {
}
- public StringWriter (StringBuilder sb) :
- this (sb, null)
+ public StringWriter (StringBuilder sb) :
+ this (sb, null)
{
}
- public StringWriter (StringBuilder sb, IFormatProvider
formatProvider)
+ public StringWriter (StringBuilder sb, IFormatProvider
formatProvider)
{
if (sb == null)
throw new ArgumentNullException ("sb");
@@ -72,7 +79,7 @@
}
}
- public override void Close ()
+ public override void Close ()
{
Dispose (true);
disposed = true;
@@ -86,52 +93,52 @@
disposed = true;
}
- public virtual StringBuilder GetStringBuilder ()
+ public virtual StringBuilder GetStringBuilder ()
{
return internalString;
}
- public override string ToString ()
+ public override string ToString ()
{
return internalString.ToString ();
}
- public override void Write (char value)
+ public override void Write (char value)
{
if (disposed) {
- throw new ObjectDisposedException
("StringReader",
- Locale.GetText ("Cannot write to a
closed StringWriter"));
+ throw new ObjectDisposedException
("StringReader",
+ Locale.GetText ("Cannot write to a
closed StringWriter"));
}
internalString.Append (value);
}
- public override void Write (string value)
+ public override void Write (string value)
{
if (disposed) {
- throw new ObjectDisposedException
("StringReader",
- Locale.GetText ("Cannot write to a
closed StringWriter"));
+ throw new ObjectDisposedException
("StringReader",
+ Locale.GetText ("Cannot write to a
closed StringWriter"));
}
-
+
internalString.Append (value);
}
- public override void Write (char[] buffer, int index, int
count)
+ public override void Write (char[] buffer, int index, int
count)
{
if (disposed) {
- throw new ObjectDisposedException
("StringReader",
- Locale.GetText ("Cannot write to a
closed StringWriter"));
+ throw new ObjectDisposedException
("StringReader",
+ Locale.GetText ("Cannot write to a
closed StringWriter"));
}
if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ throw new ArgumentNullException ("buffer");
if (index < 0)
- throw new ArgumentOutOfRangeException ("index",
"< 0");
+ throw new ArgumentOutOfRangeException ("index",
"< 0");
if (count < 0)
- throw new ArgumentOutOfRangeException ("count",
"< 0");
- // re-ordered to avoid possible integer overflow
+ throw new ArgumentOutOfRangeException ("count",
"< 0");
+ // re-ordered to avoid possible integer overflow
if (index > buffer.Length - count)
throw new ArgumentException ("index + count >
buffer.Length");
-
+
internalString.Append (buffer, index, count);
}
}
Modified: trunk/mcs/class/corlib/System.IO/TextReader.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/TextReader.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/TextReader.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -35,6 +35,9 @@
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class TextReader : MarshalByRefObject, IDisposable {
protected TextReader() { }
Modified: trunk/mcs/class/corlib/System.IO/TextWriter.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/TextWriter.cs 2007-04-30 13:54:00 UTC
(rev 76494)
+++ trunk/mcs/class/corlib/System.IO/TextWriter.cs 2007-04-30 14:05:12 UTC
(rev 76495)
@@ -32,9 +32,16 @@
using System.Text;
+#if NET_2_0
+using System.Runtime.InteropServices;
+#endif
+
namespace System.IO {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class TextWriter : MarshalByRefObject, IDisposable {
protected TextWriter() {
Modified: trunk/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs 2007-04-30
13:54:00 UTC (rev 76494)
+++ trunk/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs 2007-04-30
14:05:12 UTC (rev 76495)
@@ -315,6 +315,20 @@
}
}
}
+
+ protected unsafe void Initialize (byte* pointer, long length,
+ long capacity,
+ FileAccess access)
+ {
+ fileaccess = access;
+ this.length = length;
+ this.capacity = capacity;
+ initial_position = 0;
+ current_position = initial_position;
+ canseek = true;
+ initial_pointer = new IntPtr ((void *)pointer);
+ closed = false;
+ }
#endregion
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches