Changeset 553 for trunk/ab5.0


Ignore:
Timestamp:
Jul 19, 2008, 2:26:09 AM (16 years ago)
Author:
NoWest
Message:

BinaryReaderとBinaryWriterを文字列操作以外は一応実装完了。

Location:
trunk/ab5.0/ablib/src/Classes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/IO/BinaryReader.ab

    r434 r553  
    1313    Sub BinaryReader(input As Stream)
    1414        stream = input
    15         coding = New System.Text.UTF8Encoding()
     15        enc = New System.Text.UTF8Encoding()
    1616    End Sub
    1717    /*!
     
    2424    Sub BinaryReader(input As Stream, encoding As System.Text.Encoding)
    2525        This.stream = input
    26         This.coding = encoding
     26        This.enc = encoding
    2727    End Sub
    2828
     
    280280Private
    281281    stream As Stream
    282     coding As System.Text.Encoding
     282    enc As System.Text.Encoding
    283283End Class
    284284
  • trunk/ab5.0/ablib/src/Classes/System/IO/BinaryWriter.ab

    r488 r553  
    44
    55Class BinaryWriter
    6     Implements IDisposable
     6    Implements System.IDisposable
    77
    88Public 'constructor
     
    1818    */
    1919    Sub BinaryWriter(output As System.IO.Stream)
     20        This.OutStream=output
    2021    End Sub
    2122
     
    2425    */
    2526    Sub BinaryWriter(output As System.IO.Stream, encoding As System.Text.Encoding)
     27        This.OutStream=output
     28        This.Enc = encoding
    2629    End Sub
    2730
     
    5558    */
    5659    Sub Close()
    57         This.Disposed()
     60        This.Dispose(True)
    5861    End Sub
    5962
     
    7679    */
    7780    Sub Write(value As Boolean)
     81        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Boolean))
    7882    End Sub
    7983 
     
    8286    */
    8387    Sub WriteByte(value As Byte)
     88        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Byte))
    8489    End Sub
    8590 
     
    95100    */
    96101    Sub Write(value As Char)
     102        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Char))
    97103    End Sub
    98104 
     
    115121    */
    116122    Sub Write(value As Double)
     123        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Double))
    117124    End Sub
    118125 
     
    121128    */
    122129    Sub Write(value As Integer)
     130        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Integer))
    123131    End Sub
    124132 
     
    127135    */
    128136    Sub Write(value As Long)
     137        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Long))
    129138    End Sub
    130139 
     
    133142    */
    134143    Sub Write(value As Int64)
     144        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Int64))
    135145    End Sub
    136146 
     
    139149    */
    140150    Sub WriteSByte(value As SByte)
     151        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(SByte))
    141152    End Sub
    142153 
     
    145156    */
    146157    Sub Write(value As Single)
     158        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Single))
    147159    End Sub
    148160 
     
    151163    */
    152164    Sub Write(value As String)
     165        This.OutStream.Write( ToTCStr(value) As *Byte, 0, value.Length()*SizeOf(TCHAR))
    153166    End Sub
    154167 
     
    157170    */
    158171    Sub Write(value As Word)
     172        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(Word))
    159173    End Sub
    160174 
     
    163177    */
    164178    Sub Write(value As DWord)
     179        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(DWord))
    165180    End Sub
    166181 
     
    169184    */
    170185    Sub Write(value As QWord)
     186        This.OutStream.Write( VarPtr(value) As *Byte, 0, SizeOf(QWord))
    171187    End Sub
    172188 
     
    175191    */
    176192    Sub Write(buffer As *Byte, index As Long, count As Long)
     193        This.OutStream.Write( VarPtr(buffer[index]) As *Byte, 0, count)
    177194    End Sub
    178195 
     
    180197        現在のストリームに文字配列の特定の領域を書き込み、使用した Encoding とストリームに書き込んだ特定の文字に従ってストリームの現在位置を進めます。
    181198    */
    182     Sub Write(chars As *Char, index As Long, count As Long)
    183     End Sub 
     199/*  Sub Write(chars As *Char, index As Long, count As Long)
     200    End Sub*/
    184201
    185202    /*
    186203    32 ビット整数を圧縮形式で書き込みます。
    187204    */
    188     Sub Write7BitEncodedInt()
    189     End Sub
     205/*  Sub Write7BitEncodedInt()
     206    End Sub*/
    190207
    191208    /*
    192209    BinaryWriter によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。
    193210    */
    194     Sub Dispose()
     211
     212Protected
     213    Virtual Sub Dispose(disposing As Boolean)
    195214        This.OutStream.Close()
    196215    End Sub
  • trunk/ab5.0/ablib/src/Classes/index.ab

    r545 r553  
    5555'#require "./System/Drawing/Imaging/misc.ab"
    5656'#require "./System/Drawing/Text/misc.ab"
     57#require "./System/IO/BinaryReader.ab"
     58#require "./System/IO/BinaryWriter.ab"
    5759#require "./System/IO/Directory.ab"
    5860#require "./System/IO/DirectoryInfo.ab"
Note: See TracChangeset for help on using the changeset viewer.