ExcludeList property
TDiskScanList Example |
dcMultiDiskScanner component.
|
property ExcludeList: TDiskScanList; // TList
|
The ExcludeList property is the list of searching rules that defines the locations and searching masks which you would like to exclude from search results.
|
|
You can set the excluding rules either at design and run-time of your application.
|
|
The ExcludeList property has the TDiskScanList type. To add the new rule to ExcludeList at run-time - call ExcludeList.AddPath(Location, IncludeSubfolders) method. To clear the list - call ExcludeList.Clear method. Please see an example for more details.
|
Setting the full path name to the excluding rules is not necessarily. For example, if you would like to exclude just some file types (extenstions), you may specify these extensions without path information (i.e: "*.bmp" will exclude ALL bitmaps from the search results):
|
ExcludeList.AddPath('*.bmp', False);
|
|
Plues, if the path information is not specified, the dcMultiDiskScanner will NOT search ANY folders to prepare list of previously excluded files before actual searching.
|
|
For example, you would like to find all files in root folder on disk C:
|
|
IncludeList.Clear; // clear list
|
IncludeList.AddPath('c:\*.*', True);
|
|
but would like to exclude all BMPs:
|
|
ExcludeList.Clear;
|
ExcludeList.AddPath('*.bmp', True);
|
// ^-- if you specify the path
|
// here, i.e: "C:\*.*", the dcMultiDiskScanner will
|
// scan entire disk to exclude files before actual
|
// search, and will take a lot of time to prepare
|
// the pre-excluded list
|
However, if you want to exclude files only from certain directories, you must specify the path. For example, to exclude all BMP-files from, let's say, "C:\Bitmaps" directory, you must speify following exclude:
|
ExcludeList.AddPath('C:\Bitmaps\*.bmp', True);
|
IncludeList property.
|