Class TPathWatcher
Unit
Declaration
type TPathWatcher = class(TInterfacedObject, IPathWatcher)
Description
Hierarchy
- TInterfacedObject
- TPathWatcher
Overview
Methods
constructor Create; |
|
destructor Destroy; override; |
|
class function New: IPathWatcher; |
|
function Path(const APath: string): IPathWatcher; |
|
function Ignore(const AIgnoreKind: TIgnoreKind; AItems: TArray<string>): IPathWatcher; |
|
function Timeout(const ATime: Longint): IPathWatcher; |
|
function Run(const AWatcherRun: TWatcherRunCallback): IPathWatcher; |
|
function Start: IPathWatcher; |
Description
Methods
constructor Create; |
|
Default class constructor. Initialize interanal arrays and dictionaries. Use new method for as default class factory. instantiation. |
destructor Destroy; override; |
|
Default class destructor. Release resources. |
class function New: IPathWatcher; |
|
Factory method for TPathWatcher, this is the recommended method to create a new instance of the class. |
function Path(const APath: string): IPathWatcher; |
|
Sets the path to watch for changes. Returns self to allow chained watcher calls.
Parameters
|
function Ignore(const AIgnoreKind: TIgnoreKind; AItems: TArray<string>): IPathWatcher; |
|
Defines a set of values to be ignored according to the type provided as a parameter. Ex: to ignore all items, folders or files that start with "." just call the function as follows: Watcher.Ignore(ikStartsText, ['.']); Ex: to ignore all folders with specific names, call the function as follows: Watcher.Ignore(ikFolder, ['bin', 'lib', 'modules']); Returns self to allow chained watcher calls.
Parameters
|
function Timeout(const ATime: Longint): IPathWatcher; |
|
Sets maximum timeout in milliseconds to call the watcher run callback. Every time run is called this timer is reset. If the maximum timeout is reached TPathWatcher is terminated. Default value is 3600 seconds or 3,600,000 milliseconds.
Parameters
|
function Run(const AWatcherRun: TWatcherRunCallback): IPathWatcher; |
|
Defines the callback procedure that should be executed when a change is detected.
) Parameters
|
function Start: IPathWatcher; |
|
Start watching the path considering the ignore parameters that have been configured. As soon as a change is detected the callback routine will be called. |
Generated by PasDoc 0.16.0.