Ignore:
Timestamp:
Feb 28, 2008, 1:39:16 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

Consoleをスレッド安全化(クリティカルセクション使用)。
Exception.HResultをPublicにした。
StringBuilder.Replaceが正しく機能しない問題を解消。

Location:
trunk/Include/Classes/System/IO
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/IO/Exception.ab

    r391 r435  
    6464    */
    6565    Sub ThrowWinIOException(msg As String, error As DWord)
    66 '       Throw IOException(msg, HRESULT_FROM_WIN32(error))
     66        Throw New IOException(msg, HRESULT_FROM_WIN32(error))
    6767    End Sub
    6868
     
    7474    */
    7575    Sub ThrowWinLastErrorIOException(msg As String)
    76 '       Throw IOException(msg, HRESULT_FROM_WIN32(GetLastError()))
     76        Throw New IOException(msg, HRESULT_FROM_WIN32(GetLastError()))
    7777    End Sub
    7878End Namespace
  • trunk/Include/Classes/System/IO/File.ab

    r432 r435  
    2727
    2828Enum FileMode
    29     Append = OPEN_ALWAYS
    30     Create = CREATE_ALWAYS
    31     CreateNew = CREATE_NEW
    32     Open = OPEN_EXISTING
    33     OpenOrCreate = OPEN_ALWAYS
    34     Truncate = TRUNCATE_EXISTING
     29    Append = 4 'OPEN_ALWAYS
     30    Create = 2 'CREATE_ALWAYS
     31    CreateNew = 1 'CREATE_NEW
     32    Open = 3 'OPEN_EXISTING
     33    OpenOrCreate = 4 'OPEN_ALWAYS
     34    Truncate = 5 'TRUNCATE_EXISTING
    3535End Enum
    3636
  • trunk/Include/Classes/System/IO/FileStream.ab

    r432 r435  
    3434    /* コンストラクタ.NETと同じように実装は難しい、一先ず動くものを実装したが変更が必要だと思う */
    3535    Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions)
     36        If ActiveBasic.IsNothing(path) Then
     37            Throw New ArgumentNullException("path")
     38        ElseIf path.Length = 0 Then
     39            Throw New ArgumentException
     40        End If
     41
     42
    3643        Dim ac = access As DWord
    3744        Dim sh = share As DWord
     
    4956        'Throw System.IO.FileNotFoundException
    5057            This.handle=0
    51             Beep(220,500)
     58            Detail.ThrowWinLastErrorIOException("Failed to open/create file.")
    5259            Exit Sub
    5360        End If
  • trunk/Include/Classes/System/IO/StreamReader.ab

    r432 r435  
    5050    Override Function Read() As Long
    5151        Read = Peek()
    52         cur++
     52        If Read <> -1 Then
     53            cur++
     54        End If
    5355    End Function
    5456
Note: See TracChangeset for help on using the changeset viewer.