-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUSTDOUT.PAS
103 lines (84 loc) · 2.14 KB
/
USTDOUT.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
ustdout Unit
Provides read-only stream access to a part of another stream
2022 LRT
}
unit
ustdout;
interface
uses
consts, utils, uexc, uclasses, types, locale, uobject, ustream, math;
type
PStdOutput = ^TStdOutput;
TStdOutput = object (TStream)
public
constructor init;
destructor done; virtual;
function read(buffer: pointer; count: word): word; virtual;
procedure write(buffer: pointer; count: word); virtual;
procedure seek(pos: longint); virtual;
function getPosition: longint; virtual;
function isEOF: boolean; virtual;
function getSize: longint; virtual;
function isReadOnly: boolean; virtual;
function getClassName: string; virtual;
function getClassId: word; virtual;
private
end;
implementation
{ TStdOutput public }
constructor TStdOutput.init;
begin
inherited init;
end;
destructor TStdOutput.done;
begin
inherited done;
end;
function TStdOutput.read(buffer: pointer; count: word): word;
begin
iassert(false, @self, 0, S_ERR_UNSUPPORTED_ACTION);
end;
procedure TStdOutput.write(buffer: pointer; count: word);
var
p: pchar;
i: word;
begin
p := buffer;
for i:=count-1 downto 0 do
begin
system.write(p^);
inc(p);
end;
end;
procedure TStdOutput.seek(pos: longint);
begin
iassert(false, @self, 0, S_ERR_UNSUPPORTED_ACTION);
end;
function TStdOutput.getPosition: longint;
begin
iassert(false, @self, 0, S_ERR_UNSUPPORTED_ACTION);
end;
function TStdOutput.isEOF: boolean;
begin
iassert(false, @self, 0, S_ERR_UNSUPPORTED_ACTION);
end;
function TStdOutput.getSize: longint;
begin
iassert(false, @self, 0, S_ERR_UNSUPPORTED_ACTION);
end;
function TStdOutput.isReadOnly: boolean;
begin
isReadOnly := false;
end;
function TStdOutput.getClassName: string;
begin
getClassName := 'TStdOutput';
end;
function TStdOutput.getClassId: word;
begin
getClassId := C_CLASS_ID_StdOutput;
end;
{ TStdOutput private }
{ Other }
end.