-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathfileutils.h
54 lines (31 loc) · 1.25 KB
/
fileutils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef FILEUTILS_H
#define FILEUTILS_H
#include <QObject>
#include <QUrl>
#include <QMap>
#include "filescanner.h"
class FileUtils : public QObject
{
Q_OBJECT
public:
Q_INVOKABLE FileUtils(QObject *parent = nullptr);
Q_INVOKABLE bool fileExists(const QString &sFile);
Q_INVOKABLE bool fileDelete(const QString &sFile);
Q_INVOKABLE bool fileCopy(const QString &sSource, const QString &sTarget);
Q_INVOKABLE QString urlToLocalFile(const QUrl &url);
Q_INVOKABLE QUrl urlFromLocalFile(const QString &url);
Q_INVOKABLE bool urlExists(const QUrl &url);
Q_INVOKABLE QUrl urlExtractPath(const QUrl &url);
Q_INVOKABLE QString urlExtractFileName(const QUrl &url);
Q_INVOKABLE bool urlSaveToFile(const QUrl &url, const QStringList &content);
Q_INVOKABLE QUrl urlFindFirstFile(const QUrl &path, const QStringList &extensions);
Q_INVOKABLE void scanDirAsync(const QUrl &url, const QStringList &extensions);
Q_INVOKABLE void terminateScanDir(const QUrl &url);
signals:
void mediaScanCompleted(const QUrl &url, const QList<QUrl> &outList);
public slots:
void onScanCompleted(const QUrl &url, const QList<QUrl> &outList);
private:
QMap<QUrl,FileScanner*> _audioFileScanners;
};
#endif // FILEUTILS_H