1 | /*! |
---|
2 | @file |
---|
3 | @brief System.IOに属す例外クラスの定義 |
---|
4 | */ |
---|
5 | |
---|
6 | Namespace ActiveBasic |
---|
7 | |
---|
8 | Const AB_E_IO = &h80041620 '80131620 |
---|
9 | |
---|
10 | End Namespace |
---|
11 | |
---|
12 | Namespace System |
---|
13 | Namespace IO |
---|
14 | |
---|
15 | /*! |
---|
16 | @brief IO処理に関する例外のクラス |
---|
17 | @author Egtra |
---|
18 | @date 2007/12/06 |
---|
19 | */ |
---|
20 | Class IOException |
---|
21 | Inherits SystemException |
---|
22 | Public |
---|
23 | /*! |
---|
24 | @biref コンストラクタ |
---|
25 | */ |
---|
26 | Sub IOException() |
---|
27 | Exception(GetType().FullName, Nothing) |
---|
28 | HResult = ActiveBasic.AB_E_IO |
---|
29 | End Sub |
---|
30 | /*! |
---|
31 | @biref コンストラクタ |
---|
32 | @param[in] message エラーメッセージ |
---|
33 | */ |
---|
34 | Sub IOException(message As String) |
---|
35 | Exception(message, Nothing) |
---|
36 | HResult = ActiveBasic.AB_E_IO |
---|
37 | End Sub |
---|
38 | /*! |
---|
39 | @biref コンストラクタ |
---|
40 | @param[in] message エラーメッセージ |
---|
41 | @param[in] innerException 内部例外 |
---|
42 | */ |
---|
43 | Sub IOException(message As String, innerException As Exception) |
---|
44 | Exception(message, innerException) |
---|
45 | HResult = ActiveBasic.AB_E_IO |
---|
46 | End Sub |
---|
47 | /*! |
---|
48 | @biref コンストラクタ |
---|
49 | @param[in] message エラーメッセージ |
---|
50 | @param[in] hr HRESULT例外値 |
---|
51 | */ |
---|
52 | Sub IOException(message As String, hr As HRESULT) |
---|
53 | Exception(message, Nothing) |
---|
54 | HResult = hr |
---|
55 | End Sub |
---|
56 | End Class |
---|
57 | |
---|
58 | Namespace Detail |
---|
59 | /*! |
---|
60 | @brief Windowsエラー値を基にIOExceptionを投げる。 |
---|
61 | @param[in] message エラーメッセージ |
---|
62 | @author Egtra |
---|
63 | @date 2007/12/06 |
---|
64 | */ |
---|
65 | Sub ThrowWinIOException(msg As String, error As DWord) |
---|
66 | Throw New IOException(msg, HRESULT_FROM_WIN32(error)) |
---|
67 | End Sub |
---|
68 | |
---|
69 | /*! |
---|
70 | @brief GetLastError()の値を基にIOExceptionを投げる。 |
---|
71 | @param[in] message エラーメッセージ |
---|
72 | @author Egtra |
---|
73 | @date 2007/12/06 |
---|
74 | */ |
---|
75 | Sub ThrowWinLastErrorIOException(msg As String) |
---|
76 | Throw New IOException(msg, HRESULT_FROM_WIN32(GetLastError())) |
---|
77 | End Sub |
---|
78 | End Namespace |
---|
79 | |
---|
80 | End Namespace 'IO |
---|
81 | End Namespace 'System |
---|