Use FSEvents in wxFileSystemWatcher on OS X

The FSEvents API allows for creating watches in entire trees of
directories in an efficient manner.

Closes #16969.
This commit is contained in:
Roberto Perpuly
2015-06-06 01:28:30 +04:00
committed by Dimitri Schoolwerth
parent f0e098fa06
commit aa5dbad410
14 changed files with 700 additions and 36 deletions

View File

@@ -78,10 +78,11 @@ public:
Additionally a file mask can be specified to include only files
matching that particular mask.
This method is implemented efficiently on MSW, but should be used with
care on other platforms for directories with lots of children (e.g. the
root directory) as it calls Add() for each subdirectory, potentially
creating a lot of watches and taking a long time to execute.
This method is implemented efficiently on MSW and OS X >= 10.7, but
should be used with care on other platforms for directories with lots
of children (e.g. the root directory) as it calls Add() for each
subdirectory, potentially creating a lot of watches and taking a long
time to execute.
Note that on platforms that use symbolic links, you will probably want
to have called wxFileName::DontFollowLink on @a path. This is especially
@@ -242,8 +243,9 @@ enum wxFSWFlags
Notice that under MSW this event is sometimes -- although not always --
followed by a ::wxFSW_EVENT_MODIFY for the new file.
Under OS X this event is currently not detected and instead separate
::wxFSW_EVENT_CREATE and ::wxFSW_EVENT_DELETE events are.
Under OS X this event is only detected when watching entire trees. When
watching directories, separate ::wxFSW_EVENT_CREATE and
::wxFSW_EVENT_DELETE events are detected instead.
*/
wxFSW_EVENT_RENAME = 0x04,
@@ -253,7 +255,7 @@ enum wxFSWFlags
Depending on the program doing the file modification, multiple such
events can be reported for a single logical file update.
Under OS X this event is currently not detected.
Under OS X this event is only detected when watching entire trees.
*/
wxFSW_EVENT_MODIFY = 0x08,
@@ -267,7 +269,8 @@ enum wxFSWFlags
/**
The item's metadata was changed, e.g.\ its permissions or timestamps.
This event is currently only detected under Linux.
This event is currently only detected under Linux and OS X.
Under OS X this event is only detected when watching entire trees.
@since 2.9.5
*/
@@ -279,7 +282,8 @@ enum wxFSWFlags
wxFSW_EVENT_UNMOUNT cannot be set; unmount events are produced automatically. This flag
is therefore not included in wxFSW_EVENT_ALL.
This event is currently only detected under Linux.
This event is currently only detected under Linux and OS X.
Under OS X this event is only detected when watching entire trees.
@since 2.9.5
*/