TDirList( unit KOL.pas ) ï TObj ï _TObj

TDirList = object( TObj )

Allows easy directory scanning. This is not visual object, but storage to simplify working with directory content.

### TDirList properties

property Items[ Idx: Integer ]: PFindfileData; default; Ñ
Full access to scanned items (files and subdirectories).

property IsDirectory[ Idx: Integer ]: Boolean; Ñ
Returns TRUE, if specified item represents a directory, not a file.

property Count: Integer; Ñ
Number of items.

property Names[ Idx: Integer ]: KOLString; Ñ
Full long names of directory items.

property Path: KOLString; Ñ
Path of scanned directory.

#### Properties, inherited from TObj

### TDirList methods

destructor Destroy; virtual; N
Destructor. As usual, call Free method to destroy an object.

procedure Clear;
Call it to clear list of files.

procedure ScanDirectory( const DirPath, Filter: KOLString; Attr: DWord );
Call it to rescan directory or to scan another directory content (method Clear is called first). Pass path to directory, file filter and attributes to scan directory immediately.
Note: Pass FILE_ATTRIBUTE_... constants or-combination as Attr parameter. If 0 passed, both files and directories are listed.

procedure ScanDirectoryEx( const DirPath, Filters: KOLString; Attr: DWord );
Call it to rescan directory or to scan another directory content (method Clear is called first). Pass path to directory, file filter and attributes to scan directory immediately.
Note: Pass FILE_ATTRIBUTE_... constants or-combination as Attr parameter.

procedure Sort( Rules: array of TSortDirRules );
Sorts directory entries. If empty rules array passed, default rules array DefSortDirRules is used.

function FileList( const Separator: KOLString; Dirs, FullPaths: Boolean ): KOLString;
Returns a string containing all names separated with Separator. If Dirs=FALSE, only files are returned.

#### Methods, inherited from TObj

### TDirList events

property OnItem: TOnDirItem;
This event is called on reading each item while scanning directory. To use it, first create PDirList object with empty path to scan, then assign OnItem event and call ScanDirectory with correct path.

#### Events, inherited from TObj

### TDirList fields

#### Fields, inherited from TObj

[ Index ]

This help is generated 14-Jun-2010 by KOL Help generator, (C) 2000-2001 by Vladimir Kladov
Modified (C) 2003 by Alexander Bartov