33class QFseventsFileSystemWatcherEngine :
public QFileSystemWatcherEngine
37 ~QFseventsFileSystemWatcherEngine();
39 static QFseventsFileSystemWatcherEngine *create(QObject *parent);
41 QStringList addPaths(
const QStringList &paths, QStringList *files, QStringList *directories);
42 QStringList removePaths(
const QStringList &paths, QStringList *files, QStringList *directories);
44 void processEvent(ConstFSEventStreamRef streamRef, size_t numEvents,
char **eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[]);
47 void emitFileChanged(
const QString &path,
bool removed);
48 void emitDirectoryChanged(
const QString &path,
bool removed);
49 void scheduleStreamRestart();
52 void doEmitFileChanged(
const QString &path,
bool removed);
53 void doEmitDirectoryChanged(
const QString &path,
bool removed);
69 Info(
const QString &origPath,
const timespec &ctime, mode_t mode,
const QString &watchedPath)
73 , watchedPath(watchedPath)
76 typedef QHash<QString, Info> InfoByName;
77 typedef QHash<QString, InfoByName> FilesByPath;
82 typedef QHash<QString, DirInfo> DirsByName;
83 typedef QHash<QString, qint64> PathRefCounts;
85 struct WatchingState {
93 FilesByPath watchedFiles;
94 DirsByName watchedDirectories;
95 PathRefCounts watchedPaths;
98 QFseventsFileSystemWatcherEngine(QObject *parent);
100 void stopStream(
bool isStopped =
false);
101 InfoByName scanForDirEntries(
const QString &path);
102 bool derefPath(
const QString &watchedPath);
103 bool checkDir(DirsByName::iterator &it);
104 bool rescanDirs(
const QString &path);
105 bool rescanFiles(InfoByName &filesInPath);
106 bool rescanFiles(
const QString &path);
109 dispatch_queue_t queue;
110 FSEventStreamRef stream;
111 FSEventStreamEventId lastReceivedEvent;
112 WatchingState watchingState;
static QT_BEGIN_NAMESPACE void callBackFunction(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[])