Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfilesystemwatcher_kqueue_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFILESYSTEMWATCHER_KQUEUE_P_H
5#define QFILESYSTEMWATCHER_KQUEUE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
19
20#include <QtCore/qhash.h>
21#include <QtCore/qmutex.h>
22#include <QtCore/qsocketnotifier.h>
23#include <QtCore/qthread.h>
24
25QT_REQUIRE_CONFIG(filesystemwatcher);
26struct kevent;
27
28QT_BEGIN_NAMESPACE
29
30class QKqueueFileSystemWatcherEngine : public QFileSystemWatcherEngine
31{
32 Q_OBJECT
33public:
34 ~QKqueueFileSystemWatcherEngine();
35
36 static QKqueueFileSystemWatcherEngine *create(QObject *parent);
37
38 QStringList addPaths(const QStringList &paths, QStringList *files,
39 QStringList *directories) override;
40 QStringList removePaths(const QStringList &paths, QStringList *files,
41 QStringList *directories) override;
42
43private Q_SLOTS:
44 void readFromKqueue();
45
46private:
47 QKqueueFileSystemWatcherEngine(int kqfd, QObject *parent);
48
49 int kqfd;
50
51 QHash<QString, int> pathToID;
52 QHash<int, QString> idToPath;
53 QSocketNotifier notifier;
54};
55
56QT_END_NAMESPACE
57
58#endif // QFILESYSTEMWATCHER_KQUEUE_P_H
QT_REQUIRE_CONFIG(animation)