-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinestrm.pas
93 lines (72 loc) · 1.9 KB
/
linestrm.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
(*----------------------------------------------------------------------------*)
(* Einen Zeilenstrom zur Verfuegung stellen *)
(*----------------------------------------------------------------------------*)
(* Author: Joachim Pimiskern, 1994-2004 *)
(*----------------------------------------------------------------------------*)
unit linestrm;
{$O+,F+}
interface
uses
lspglobl;
type
tLS_obj = object
filepointer: pNode;
EndOfFile : boolean;
FileIsOpen : boolean;
constructor Init(fp: pNode);
destructor Done; virtual;
(*
procedure fOpen(filename: string); virtual;
procedure fClose; virtual;
*)
function getLine: ShortString; virtual;
end;
pLS_obj = ^tLS_obj;
implementation
uses
lspinout, lspstrng;
constructor tLS_obj.Init(fp: pNode);
begin
filepointer := fp;
FileIsOpen := true;
EndOfFile := false;
end;
destructor tLS_obj.Done;
begin
end;
(*
procedure tLS_obj.fopen(filename: string);
begin
assign(fp,filename);
{$i-}
reset(fp);
{$i+}
FileIsOpen := (ioresult = 0);
if FileIsOpen then
EndOfFile := eof(fp)
else
EndOfFile := true;
end;
procedure tLS_obj.fclose;
begin
if FileIsOpen then
close(fp);
end;
*)
function tLS_obj.getLine: ShortString;
var temp: pNode;
begin
temp := readstring(filepointer);
if (temp <> nil) then
begin
getLine := LspGetStringVal(temp);
EndOfFile := false
end
else
begin
getLine := '';
EndOfFile := true
end;
end;
end.