home *** CD-ROM | disk | FTP | other *** search
- 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.
-