Ignore:
Timestamp:
Jan 13, 2009, 2:01:38 AM (15 years ago)
Author:
イグトランス (egtra)
Message:

#231に関連して、エンコーディング周りを見直し、Encoder/Decoderをストリーム用に特化。
UTF8Encodingをコンパイル可能にし、ビルドに含めるようにした。ただし、実装が不完全なためテストは不可。
(#231)

File:
1 edited

Legend:

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

    r668 r676  
    2222    Virtual Function Peek() As Long
    2323        If pos >= buf.Length Then
     24            buf.Length = 0
     25            pos = 0
    2426            If Not Underflow() Then
    2527                Peek = -1
     
    114116        Wend
    115117        ReadToEnd = buf.ToString()
     118        buf.Length = 0
     119        pos = 0
    116120    End Function
    117121
     
    141145    @auther Egtra
    142146    @return 内部バッファ
     147    内部バッファの既存の要素は、一切の変更をしないこと。また、空であるという仮定を置かないこと。
    143148    */
    144149    Function Buffer() As Text.StringBuilder
     
    151156    */
    152157    Function ReadImpl(buffer As *Char, count As Long) As Long
     158        'ToDo 適当なところでバッファの読み取り済みの部分を除去する処理を入れる(現在Peekのみ)。
    153159        Dim p = StrPtr(buf)
    154160        While buf.Length - pos < count
     
    156162        Wend
    157163        ReadImpl = Math.Min(buf.Length - pos, count)
    158         ActiveBasic.Strings.ChrCopy(buffer, VarPtr(p[pos]), ReadImpl As SIZE_T)
     164        ActiveBasic.Strings.ChrCopy(buffer, VarPtr(p[pos]) As *Char, ReadImpl As SIZE_T)
    159165        pos += ReadImpl
    160166    End Function
Note: See TracChangeset for help on using the changeset viewer.