Ignore:
Timestamp:
Jul 21, 2008, 2:34:12 PM (16 years ago)
Author:
dai
Message:

#183への対応。コンストラクタ、デストラクタが直接呼び出された場合はエラーとして扱うようにした。
(64bit版は後ほどコミットします)

Location:
trunk/ab5.0/ablib/src/Classes/System/IO
Files:
2 edited

Legend:

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

    r435 r560  
    2525    */
    2626    Sub IOException()
    27         Exception(GetType().FullName, Nothing)
     27        SystemException(GetType().FullName)
    2828        HResult = ActiveBasic.AB_E_IO
    2929    End Sub
     
    3333    */
    3434    Sub IOException(message As String)
    35         Exception(message, Nothing)
     35        SystemException(message)
    3636        HResult = ActiveBasic.AB_E_IO
    3737    End Sub
     
    4242    */
    4343    Sub IOException(message As String, innerException As Exception)
    44         Exception(message, innerException)
     44        SystemException(message, innerException)
    4545        HResult = ActiveBasic.AB_E_IO
    4646    End Sub
     
    5151    */
    5252    Sub IOException(message As String, hr As HRESULT)
    53         Exception(message, Nothing)
     53        SystemException(message)
    5454        HResult = hr
    5555    End Sub
  • trunk/ab5.0/ablib/src/Classes/System/IO/FileStream.ab

    r552 r560  
    3131    offset As QWord 'オーバーラップドIO用
    3232
    33 Public
    34     /* コンストラクタ.NETと同じように実装は難しい、一先ず動くものを実装したが変更が必要だと思う */
    35     Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions)
     33    Sub _Initialize(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions)
    3634        If ActiveBasic.IsNothing(path) Then
    3735            Throw New ArgumentNullException("path")
     
    7270        End If
    7371    End Sub
     72
     73Public
     74    /* コンストラクタ.NETと同じように実装は難しい、一先ず動くものを実装したが変更が必要だと思う */
     75    Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions)
     76        _Initialize( path, mode, access, share, options )
     77    End Sub
    7478    Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare)
    75         This.FileStream(path,mode,access,share,FileOptions.None)
     79        _Initialize(path,mode,access,share,FileOptions.None)
    7680    End Sub
    7781    Sub FileStream(path As String, mode As FileMode, access As FileAccess)
    78         This.FileStream(path,mode,access,FileShare.None,FileOptions.None)
     82        _Initialize(path,mode,access,FileShare.None,FileOptions.None)
    7983    End Sub
    8084    Sub FileStream(path As String, mode As FileMode)
     
    9498                access=FileAccess.Write
    9599        End Select
    96         This.FileStream(path,mode,access,FileShare.None,FileOptions.None)
     100        _Initialize(path,mode,access,FileShare.None,FileOptions.None)
    97101    End Sub
    98102    /*
Note: See TracChangeset for help on using the changeset viewer.