dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO FileStream.cs,1.13


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO FileStream.cs,1.13,1.14 Path.cs,1.14,1.15 Stream.cs,1.9,1.10 StreamReader.cs,1.6,1.7
Date: Wed, 23 Apr 2003 02:28:52 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO
In directory subversions:/tmp/cvs-serv24384/runtime/System/IO

Modified Files:
        FileStream.cs Path.cs Stream.cs StreamReader.cs 
Log Message:


ECMA-compatibility fixes.


Index: FileStream.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO/FileStream.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** FileStream.cs       21 Apr 2003 21:10:24 -0000      1.13
--- FileStream.cs       23 Apr 2003 06:28:50 -0000      1.14
***************
*** 239,245 ****
        ~FileStream()
                        {
!                               // Nothing to do here: the parent class does
!                               // the actual work.  However, we have to declare
!                               // this destructor because ECMA requires it.
                        }
  
--- 239,243 ----
        ~FileStream()
                        {
!                               Dispose(false);
                        }
  
***************
*** 333,367 ****
                        }
  
- #if ECMA_COMPAT
-       // Close the stream.
-       public override void Close()
-                       {
-                               lock(this)
-                               {
-                                       if(handle != invalidHandle)
-                                       {
-                                               if(bufferOwnedByWrite)
-                                               {
-                                                       FlushWriteBuffer();
-                                               }
-                                               if(ownsHandle)
-                                               {
-                                                       
FileMethods.Close(handle);
-                                               }
-                                               handle = invalidHandle;
-                                       }
-                               }
-                       }
- #else // !ECMA_COMPAT
        // Close the stream.
        public override void Close()
                        {
                                Dispose(true);
                        }
- #endif        // !ECMA_COMPAT
  
- #if !ECMA_COMPAT
        // Dispose of this stream.
!       protected override void Dispose(bool disposing)
                        {
                                lock(this)
--- 331,343 ----
                        }
  
        // Close the stream.
        public override void Close()
                        {
                                Dispose(true);
+                               GC.SuppressFinalize(this);
                        }
  
        // Dispose of this stream.
!       protected virtual void Dispose(bool disposing)
                        {
                                lock(this)
***************
*** 381,385 ****
                                }
                        }
- #endif
  
        // Flush the pending contents in this stream.
--- 357,360 ----

Index: Path.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO/Path.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Path.cs     15 Apr 2003 04:37:44 -0000      1.14
--- Path.cs     23 Apr 2003 06:28:50 -0000      1.15
***************
*** 37,42 ****
--- 37,47 ----
                public static readonly char AltDirectorySeparatorChar = 
p.altDirSeparator;
                public static readonly char PathSeparator = p.pathSeparator;
+ #if ECMA_COMPAT
+               internal static readonly char VolumeSeparatorChar = 
p.volumeSeparator;
+               internal static readonly char[] InvalidPathChars = 
p.invalidPathChars;
+ #else
                public static readonly char VolumeSeparatorChar = 
p.volumeSeparator;
                public static readonly char[] InvalidPathChars = 
p.invalidPathChars;
+ #endif
  
                // entropy for GetTempFilename()

Index: Stream.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO/Stream.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** Stream.cs   5 Apr 2003 06:58:12 -0000       1.9
--- Stream.cs   23 Apr 2003 06:28:50 -0000      1.10
***************
*** 33,46 ****
        protected Stream() {}
  
-       // Destructor.
-       ~Stream()
-                       {
-                       #if ECMA_COMPAT
-                               Close();
-                       #else
-                               Dispose(false);
-                       #endif
-                       }
- 
        // Asynchronous read/write control class.
        private sealed class AsyncControl : IAsyncResult
--- 33,36 ----
***************
*** 282,288 ****
        public virtual void Close()
                        {
!                       #if !ECMA_COMPAT
!                               Dispose(true);
!                       #endif
                        }
  
--- 272,276 ----
        public virtual void Close()
                        {
!                               // Nothing to do here.
                        }
  
***************
*** 293,304 ****
                        }
  
- #if !ECMA_COMPAT
-       // Dispose of this stream.
-       protected virtual void Dispose(bool disposing)
-                       {
-                               // Nothing to do here: normally overridden.
-                       }
- #endif
- 
        // Flush the pending contents in this stream.
        public abstract void Flush();
--- 281,284 ----
***************
*** 330,338 ****
        void IDisposable.Dispose()
                        {
-                       #if ECMA_COMPAT
                                Close();
-                       #else
-                               Dispose(true);
-                       #endif
                        }
  
--- 310,314 ----

Index: StreamReader.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO/StreamReader.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** StreamReader.cs     5 Apr 2003 05:19:50 -0000       1.6
--- StreamReader.cs     23 Apr 2003 06:28:50 -0000      1.7
***************
*** 176,185 ****
                        }
  
-       // Destructor.
-       ~StreamReader()
-                       {
-                               Dispose(false);
-                       }
- 
        // Detect the byte order by inspecting the first few bytes.
        private void DetectByteOrder()
--- 176,179 ----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]