source: Include/Classes/System/IO/Stream.ab@ 144

Last change on this file since 144 was 119, checked in by イグトランス (egtra), 18 years ago

Unicode (#50) 前準備
Byte→Char (#51) 型名は殆ど完了、ただし中身までは手を付けていないものが多い

File size: 2.0 KB
Line 
1
2#require <Classes/System/misc.ab>
3
4Class Stream
5Public 'Protected
6 Sub Stream(): End Sub
7Public
8 Virtual Sub ~Stream()
9 Close()
10 End Sub
11Public
12 Abstract Function CanRead() As Boolean
13 Abstract Function CanSeek() As Boolean
14
15 Virtual Function CanTimeout() As Boolean
16 Return True
17 End Function
18
19 Abstract Function CanWrite() As Boolean
20 Abstract Function Length() As Int64
21 Abstract Sub Position(value As Int64)
22 Abstract Function Position() As Int64
23
24 Virtual Sub ReadTimeout(value As Long)
25 ' Throw InvalidOperationException
26 End Sub
27
28 Virtual Function ReadTimeout() As Long
29 ' Throw InvalidOperationException
30 End Function
31
32 Virtual Sub WriteTimeout(value As Long)
33 ' Throw InvalidOperationException
34 End Sub
35
36 Virtual Function WriteTimeout() As Long
37 ' Throw InvalidOperationException
38 End Function
39
40Public
41 Virtual Function BeginRead(ByRef buffer[] As Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As IAsyncResult: End Function
42 Virtual Function BeginWrite(ByRef buffer[] As Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As IAsyncResult: End Function
43 Virtual Sub Close(): End Sub
44 Virtual Function EndRead(ByRef asyncResult As IAsyncResult) As Long: End Function
45 Virtual Sub EndWrite(ByRef asyncResult As IAsyncResult): End Sub
46 Abstract Sub Flush()
47 Abstract Function Read(ByRef buffer[] As Byte, offset As Long, count As Long) As Long
48
49 Virtual Function ReadByte() As Long
50 Dim b As Byte
51 Dim ret = Read(VarPtr(b), 0, 1)
52 If ret <> 0 Then
53 Return b
54 Else
55 Return -1
56 End If
57 End Function
58
59 Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Long
60 Abstract Sub SetLength(value As Int64): End Sub
61 Abstract Sub Write(ByRef buffer[] As Byte, offset As Long, count As Long)
62
63 Virtual Sub WriteByte(b As Byte)
64 Write(VarPtr(b), 0, 1)
65 End Sub
66Protected
67 Virtual Function CreateWaitHandle() As WaitHandle: End Function
68End Class
Note: See TracBrowser for help on using the repository browser.