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_H |
5 | #define QFILESYSTEMWATCHER_H |
6 | |
7 | #include <QtCore/qobject.h> |
8 | |
9 | QT_REQUIRE_CONFIG(filesystemwatcher); |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | |
14 | class QFileSystemWatcherPrivate; |
15 | |
16 | class Q_CORE_EXPORT QFileSystemWatcher : public QObject |
17 | { |
18 | Q_OBJECT |
19 | Q_DECLARE_PRIVATE(QFileSystemWatcher) |
20 | |
21 | public: |
22 | QFileSystemWatcher(QObject *parent = nullptr); |
23 | QFileSystemWatcher(const QStringList &paths, QObject *parent = nullptr); |
24 | ~QFileSystemWatcher(); |
25 | |
26 | bool addPath(const QString &file); |
27 | QStringList addPaths(const QStringList &files); |
28 | bool removePath(const QString &file); |
29 | QStringList removePaths(const QStringList &files); |
30 | |
31 | QStringList files() const; |
32 | QStringList directories() const; |
33 | |
34 | Q_SIGNALS: |
35 | void fileChanged(const QString &path, QPrivateSignal); |
36 | void directoryChanged(const QString &path, QPrivateSignal); |
37 | |
38 | private: |
39 | Q_PRIVATE_SLOT(d_func(), void _q_fileChanged(const QString &path, bool removed)) |
40 | Q_PRIVATE_SLOT(d_func(), void _q_directoryChanged(const QString &path, bool removed)) |
41 | }; |
42 | |
43 | QT_END_NAMESPACE |
44 | |
45 | #endif // QFILESYSTEMWATCHER_H |
46 |