Interface IPathWatcher

Unit

Declaration

type IPathWatcher = interface(IInterface)

Description

Interface that represents an object to monitor a path, with methods to configure parameters and callback in addition to initializing the watch itself.

ignore files with the specified extension

Attributes
GUID['{E995078A-19C1-4785-AE53-8A3113574A72}']

Hierarchy

Overview

Methods

Public function Path(const APath: string): IPathWatcher;
Public function Ignore(const AIgnoreKind: TIgnoreKind; AItems: TArray<string>): IPathWatcher;
Public function Timeout(const ATime: Longint): IPathWatcher;
Public function Run(const AWatcherRun: TWatcherRunCallback): IPathWatcher;
Public function Start: IPathWatcher;

Description

Methods

Public function Path(const APath: string): IPathWatcher;

Sets the path to watch for changes. Returns self to allow chained watcher calls.

Parameters
APath
Path that will be monitored
Public 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
AIgnoreKind
Kind of item to be ignored by the watcher
AItems
An array containing strings to be ignored according to AIgnoreKind
Public 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
ATime
Number of milliseconds to set the maximum timeout.
Public function Run(const AWatcherRun: TWatcherRunCallback): IPathWatcher;

Defines the callback procedure that should be executed when a change is detected.

)

Parameters
AProc
A procedure that will be called after a change
Public 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.