mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 14:31:35 +02:00
+ Add GetLineCount method to TMemoryTextFile object
git-svn-id: trunk@7418 -
This commit is contained in:
parent
ea5bc8c155
commit
2b672a5525
@ -30,7 +30,8 @@ type
|
|||||||
constructor Init;
|
constructor Init;
|
||||||
procedure AddLine(const S: string); virtual;
|
procedure AddLine(const S: string); virtual;
|
||||||
function GetLine(Idx: sw_integer; var S: string): boolean; virtual;
|
function GetLine(Idx: sw_integer; var S: string): boolean; virtual;
|
||||||
function GetFileName : string; virtual;
|
function GetFileName : string; virtual;
|
||||||
|
function GetLineCount : sw_integer;
|
||||||
destructor Done; virtual;
|
destructor Done; virtual;
|
||||||
private
|
private
|
||||||
Lines : PUnsortedStrCollection;
|
Lines : PUnsortedStrCollection;
|
||||||
@ -142,6 +143,11 @@ begin
|
|||||||
GetFileName:='unknown';
|
GetFileName:='unknown';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMemoryTextFile.GetLineCount : sw_integer;
|
||||||
|
begin
|
||||||
|
GetLineCount:=Lines^.Count;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMemoryTextFile.AddLine(const S: string);
|
procedure TMemoryTextFile.AddLine(const S: string);
|
||||||
begin
|
begin
|
||||||
Lines^.Insert(NewStr(S));
|
Lines^.Insert(NewStr(S));
|
||||||
@ -617,7 +623,9 @@ var Found: boolean;
|
|||||||
InStr: boolean;
|
InStr: boolean;
|
||||||
I: sw_integer;
|
I: sw_integer;
|
||||||
begin
|
begin
|
||||||
Found:=false; Name:=UpcaseStr(Name);
|
Found:=false;
|
||||||
|
Name:=UpcaseStr(Name);
|
||||||
|
Value:='';
|
||||||
S:=TagParams;
|
S:=TagParams;
|
||||||
repeat
|
repeat
|
||||||
InStr:=false;
|
InStr:=false;
|
||||||
|
Loading…
Reference in New Issue
Block a user