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_inotify_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// Qt-Security score:significant reason:default
4
5#ifndef QFILESYSTEMWATCHER_INOTIFY_P_H
6#define QFILESYSTEMWATCHER_INOTIFY_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20
22
23#include <QtCore/qhash.h>
24#include <QtCore/qmutex.h>
25#include <QtCore/qsocketnotifier.h>
26
27QT_BEGIN_NAMESPACE
28
29class QInotifyFileSystemWatcherEngine : public QFileSystemWatcherEngine
30{
31 Q_OBJECT
32
33public:
34 ~QInotifyFileSystemWatcherEngine();
35
36 static QInotifyFileSystemWatcherEngine *create(QObject *parent);
37
38 QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
39 QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
40
41private Q_SLOTS:
42 void readFromInotify();
43
44private:
45 QString getPathFromID(int id) const;
46
47private:
48 QInotifyFileSystemWatcherEngine(int fd, QObject *parent);
49 int inotifyFd;
50 QHash<QString, int> pathToID;
51 QMultiHash<int, QString> idToPath;
52 QSocketNotifier notifier;
53};
54
55
56QT_END_NAMESPACE
57#endif // QFILESYSTEMWATCHER_INOTIFY_P_H
QT_REQUIRE_CONFIG(animation)
QT_REQUIRE_CONFIG(filesystemwatcher)
Hash::const_iterator find_last_in_equal_range(const Hash &c, const Key &key)