home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
DirIter.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-01-30
|
1KB
|
43 lines
unit DirIter;
interface
uses Iter,
SysUtils;
type TDirIter=class(TIter)
protected
f:TSearchRec;
fState:integer;
function rdFileName:string;
public
constructor Create(const S:string;Attr:integer);
procedure Next;override;
function IsEnd:Boolean;override;
destructor Destroy;override;
property FileName:string read rdFileName;
property SearchRec:TSearchRec read f;
end;
implementation
constructor TDirIter.Create;
begin
Inherited Create;
fState:=FindFirst(S,Attr,F);
end;
procedure TDirIter.Next;
begin
fState:=FindNext(F);
end;
function TDirIter.IsEnd;
begin
Result:=fState<>0;
end;
destructor TDirIter.Destroy;
begin
FindClose(F);
Inherited Destroy;
end;
function TDirIter.rdFileName;
begin
Result:=f.Name;
end;
end.