2019-03-08 06:55:43 -08:00
|
|
|
struct @beta Eio.Sentry.Event
|
2016-04-12 12:00:23 -07:00
|
|
|
{
|
|
|
|
[[Wraps the data about a monitor event on a file.]]
|
2016-05-31 08:02:26 -07:00
|
|
|
trigger: string; [[The cause of the event.]]
|
|
|
|
source: string; [[The original monitored path.]]
|
2016-04-12 12:00:23 -07:00
|
|
|
}
|
|
|
|
|
2019-03-11 05:31:55 -07:00
|
|
|
class @beta Eio.Sentry extends Efl.Object
|
2016-04-12 12:00:23 -07:00
|
|
|
{
|
|
|
|
[[Monitors files and directories for changes.]]
|
|
|
|
|
|
|
|
methods {
|
|
|
|
add {
|
|
|
|
[[Adds a new path to the list of monitored paths.]]
|
|
|
|
params {
|
2016-11-11 00:15:24 -08:00
|
|
|
@in path: string; [[Path to monitor]]
|
2016-04-12 12:00:23 -07:00
|
|
|
}
|
2016-11-11 00:15:24 -08:00
|
|
|
return : bool; [[$true on success, $false otherwise]]
|
2016-04-12 12:00:23 -07:00
|
|
|
}
|
2018-02-14 18:14:52 -08:00
|
|
|
remove {
|
2016-04-12 12:00:23 -07:00
|
|
|
[[Removes the given path from the monitored list.]]
|
|
|
|
params {
|
2016-11-11 00:15:24 -08:00
|
|
|
@in path: string; [[Path to remove from monitoring]]
|
2016-04-12 12:00:23 -07:00
|
|
|
}
|
|
|
|
}
|
2018-06-26 15:20:37 -07:00
|
|
|
fallback_check @const @beta {
|
|
|
|
[[Return if the sentry is using the fallback monitoring method
|
|
|
|
|
|
|
|
The fallback method of monitoring cannot provide certain events.
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
@in path: string; [[Path to check for fallback monitoring]]
|
|
|
|
}
|
|
|
|
return : bool; [[$true only if the sentry is using the fallback mechanism]]
|
|
|
|
}
|
2016-04-12 12:00:23 -07:00
|
|
|
}
|
|
|
|
events {
|
2016-11-11 00:15:24 -08:00
|
|
|
file,created: Eio.Sentry.Event; [[Called when a file was created]]
|
|
|
|
file,deleted: Eio.Sentry.Event; [[Called when a file was deleted]]
|
|
|
|
file,modified: Eio.Sentry.Event; [[Called when a file was modified]]
|
2018-06-26 15:20:37 -07:00
|
|
|
file,closed: Eio.Sentry.Event; [[Called for non-fallback sentries when a file was closed]]
|
2016-11-11 00:15:24 -08:00
|
|
|
directory,created: Eio.Sentry.Event; [[Called when a directory was created]]
|
|
|
|
directory,deleted: Eio.Sentry.Event; [[Called when a directory was deleted]]
|
|
|
|
directory,modified: Eio.Sentry.Event; [[called when a directory was modified]]
|
2018-06-26 15:20:37 -07:00
|
|
|
directory,closed: Eio.Sentry.Event; [[Called for non-fallback sentries when a directory was closed]]
|
|
|
|
self,rename: Eio.Sentry.Event; [[Called for non-fallback sentries when the object was renamed]]
|
2016-11-11 00:15:24 -08:00
|
|
|
self,deleted: Eio.Sentry.Event; [[Called when the object was deleted]]
|
|
|
|
error: Eio.Sentry.Event; [[Called in case of an error]]
|
2016-04-12 12:00:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
implements {
|
2016-08-10 07:23:04 -07:00
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.destructor;
|
2016-04-12 12:00:23 -07:00
|
|
|
}
|
|
|
|
}
|