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

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

[Dotgnu-libs-commits] CVS: dotgnu-base/DotGNU/IO FileStream.cs,1.1,1.2 I


From: Peter Minten <address@hidden>
Subject: [Dotgnu-libs-commits] CVS: dotgnu-base/DotGNU/IO FileStream.cs,1.1,1.2 IStream.cs,1.1,1.2 Stream.cs,1.2,1.3
Date: Sun, 28 Jul 2002 11:56:36 -0400

Update of /cvsroot/dotgnu-libs/dotgnu-base/DotGNU/IO
In directory subversions:/tmp/cvs-serv4858/DotGNU/IO

Modified Files:
        FileStream.cs IStream.cs Stream.cs 
Log Message:
Fixed bugs, implemented standard build system.


Index: FileStream.cs
===================================================================
RCS file: /cvsroot/dotgnu-libs/dotgnu-base/DotGNU/IO/FileStream.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** FileStream.cs       27 Jul 2002 10:36:01 -0000      1.1
--- FileStream.cs       28 Jul 2002 15:56:34 -0000      1.2
***************
*** 7,11 ****
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
!  * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   *
--- 7,11 ----
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
!  * the Free Software Foundation; either version 2.1 of the License, or
   * (at your option) any later version.
   *
***************
*** 24,30 ****
--- 24,33 ----
  
  using System;
+ using System.IO;
  using System.Net.Sockets;
  using System.Text;
  
+ 
+ 
  ///<remarks>DotGNU FileStream, support String read/write and 
  ///  stream operators.</remarks>
***************
*** 42,46 ****
        public void Read (String buffer)
        {
!               return Stream.Read(this, buffer);
        }
        
--- 45,50 ----
        public void Read (String buffer)
        {
!               Stream.Read(this, buffer);
!               return;
        }
        
***************
*** 51,55 ****
        public void Read (String buffer, Encoding encoding)
        {
!               return Stream.Read(this, buffer, encoding);
        }
  
--- 55,60 ----
        public void Read (String buffer, Encoding encoding)
        {
!               Stream.Read(this, buffer, encoding);
!               return;
        }
  
***************
*** 59,63 ****
        public void Write(String buffer)
        {
!               return Stream.Write(this, buffer);
        }
  
--- 64,69 ----
        public void Write(String buffer)
        {
!               Stream.Write(this, buffer);
!               return;
        }
  
***************
*** 68,72 ****
        public void Write(String buffer, Encoding encoding)
        {
!               return Stream.Write(this, buffer, encoding);
        }
  
--- 74,79 ----
        public void Write(String buffer, Encoding encoding)
        {
!               Stream.Write(this, buffer, encoding);
!               return;
        }
  
***************
*** 81,84 ****
--- 88,92 ----
        {
                a.Read(b, 0, b.Length);
+               return null;
        }
                                  
***************
*** 89,93 ****
        public static Stream operator>> (System.IO.Stream a, String b)
        {
!               Read(a, b);
        }
        
--- 97,102 ----
        public static Stream operator>> (System.IO.Stream a, String b)
        {
!               DotGNU.IO.Stream.Read(a, b);
!               return null;
        }
        
***************
*** 98,101 ****
--- 107,111 ----
        {
                a.Write(b, 0, b.Length);
+               return null;
        }
  
***************
*** 105,113 ****
        public static Stream operator<< (System.IO.Stream a, String b)
        {
!               Write(a, b);
!       }        
!               
! }; // class FileStream
! 
  
! }; // namespace DotGNU.IO
--- 115,123 ----
        public static Stream operator<< (System.IO.Stream a, String b)
        {
!               DotGNU.IO.Stream.Write(a, b);
!               return null;
!       }         
!       
! }; //class FileStream
  
! }; //namespace DotGNU.IO

Index: IStream.cs
===================================================================
RCS file: /cvsroot/dotgnu-libs/dotgnu-base/DotGNU/IO/IStream.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** IStream.cs  27 Jul 2002 10:36:01 -0000      1.1
--- IStream.cs  28 Jul 2002 15:56:34 -0000      1.2
***************
*** 6,10 ****
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
!  * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   *
--- 6,10 ----
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
!  * the Free Software Foundation; either version 2.1 of the License, or
   * (at your option) any later version.
   *

Index: Stream.cs
===================================================================
RCS file: /cvsroot/dotgnu-libs/dotgnu-base/DotGNU/IO/Stream.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Stream.cs   27 Jul 2002 10:36:01 -0000      1.2
--- Stream.cs   28 Jul 2002 15:56:34 -0000      1.3
***************
*** 6,10 ****
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
!  * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   *
--- 6,10 ----
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
!  * the Free Software Foundation; either version 2.1 of the License, or
   * (at your option) any later version.
   *
***************
*** 61,74 ****
                char[] cbuf = new char[514]; //Stay on the safe side with size 
estimations
                String tbuffer;         
                
                do
                {
!                       int bytesreceived = stream.Read(bbuf);
                                
!                       encoding.GetChars(bbuf, 0, bytesread, cbuf, 0);
                        
                        tbuffer = new String(cbuf);
                
!                       tbuffer = tbuffer.SubString(0, charsread); //Cut off 
useless chars
                        
                        buffer += tbuffer;
--- 61,75 ----
                char[] cbuf = new char[514]; //Stay on the safe side with size 
estimations
                String tbuffer;         
+               int charsread;
                
                do
                {
!                       int bytesreceived = stream.Read(bbuf, 0, bbuf.Length);
                                
!                       charsread = encoding.GetChars(bbuf, 0, bytesreceived, 
cbuf, 0);
                        
                        tbuffer = new String(cbuf);
                
!                       tbuffer = tbuffer.Substring(0, charsread); //Cut off 
useless chars
                        
                        buffer += tbuffer;
***************
*** 97,103 ****
                Encoding encoding)
        {
!               stream.Write(encoding.GetBytes(buffer));
        }
!       
        //Operators
        
--- 98,126 ----
                Encoding encoding)
        {
!               buffer = ""; //Clean buffer
! 
!               byte[] bbuf = new byte[1024]; //Read 1024 at a time
!               char[] cbuf = new char[514]; //Stay on the safe side with size 
estimations
!               int charsread;
!               String tbuffer;
! 
!               do
!               {
!                       int bytesreceived = stream.Read(bbuf, 0, bbuf.Length);
! 
!                       charsread = encoding.GetChars(bbuf, 0, bytesreceived, 
cbuf, 0);
! 
!                       tbuffer = new String(cbuf);
! 
!                       tbuffer = tbuffer.Substring(0, charsread); //Cut off 
useless chars
! 
!                       buffer += tbuffer;
! 
!                       if (bytesreceived < 1024)
!                               return;
! 
!               } while (true); //Infinite loop if it wasn't for that return 
statement
        }
!               
        //Operators
        
***************
*** 108,111 ****
--- 131,135 ----
        {
                a.Read(b, 0, b.Length);
+               return null;
        }
        
***************
*** 117,120 ****
--- 141,145 ----
        {
                Read(a, b);
+               return null;
        }
        
***************
*** 125,128 ****
--- 150,154 ----
        {
                a.Write(b, 0, b.Length);
+               return null;
        }
  
***************
*** 132,136 ****
        public static Stream operator<< (System.IO.Stream a, String b)
        {
!               Write(a, b);
        }        
        
--- 158,163 ----
        public static Stream operator<< (System.IO.Stream a, String b)
        {
!               DotGNU.IO.Stream.Write(a, b);
!               return null;
        }        
        




reply via email to

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