whyclwt
2022-05-18 ab72c6e114d7c4e83564194367ba623ca23bf09d
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
#ifndef FILEMANAGE_H
#define FILEMANAGE_H
 
#include "qthread.h"
#include <QObject>
#include <QDir>
#include <QFile>
 
class FileManage : public QThread
{
    Q_OBJECT
 
public:
        virtual void run();
        ~FileManage();
 
protected:
        bool Run_CP_EN;
        bool Run_RM_EN;
 
        QStringList from_Dir;
        QString to_Dir;
 
public:
    static bool removeDir(const QString &fromDir);
    static bool removeFile(const QString &fromDir,const QString &fromFile);
    static QStringList getDirs();
    static QStringList getFiles(const QString &fromDir);
 
    void removeFile(QString &fname);
 
    static int GetFileCount(const QString &fromDir);
    static int GetFileCountFromDirs(const QStringList &fromDir);
    bool copyDirectoryFiles(const QStringList &fromDir, const QString &toDir,
                            bool coverFileIfExist);
    void copyFile(const QString &fromDir, const QString &toDir);
    bool clearDirectoryFiles(const QString &fromDir, const QStringList &fileList);
 
    static int FindLocalFileFromPath(const QString &strFilePath, const QString filename);
 
    bool CheckDiskState(const QString &disk);
 
    bool deleteDirectoryFiles(const QStringList &fromDir);
 
signals:
    void progressValue(int);
 
};
 
#endif // FILEMANAGE_H