Ubuntu12.04.4_lts
2023-08-01 961efe36f62f7eba688d504ec0cdf3e1daa4dd74
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
#ifndef FILEMANAGE_H
#define FILEMANAGE_H
 
#include "qthread.h"
#include <QObject>
#include <QDir>
#include <QFile>
#include <QApplication>
#include <QTimer>
#include <QIODevice>
#include <QDirIterator>
#include "Common/data_define.h"
 
class FileManage : public QThread
{
    Q_OBJECT
 
public:
        virtual void run();
        ~FileManage();
 
protected:
        bool Run_EN;
        int progress;
        bool cover_FileIfExist;
        bool copy_or_clear;
        QStringList from_Dir;
        QString to_Dir;
 
public:
    static bool createDir(const QString &newDir);
    static bool createFile(const QString &fromDir,const QString &newFile);
    static bool removeDir(const QString &fromDir);
    static bool removeFile(const QString &fromDir,const QString &fromFile);
    static QStringList getDirs();
    static QStringList getDirs(bool ifDefault);
    static QStringList getFiles(const QString &fromDir,const QString &fileType);
 
    static int GetFileCount(const QString &fromDir);
    static int GetFileCountFromDirs(const QStringList &fromDir);
    bool copyFiles(const QString &fromDir, const QString &toDir, bool coverFileIfExist);
    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);
 
    void renameDir(const QString &oldName,const QString &newName);
    int FindLocalFileFromPath(const QString &strFilePath, const QString filename);
signals:
    //void progressValue(int value);
};
 
#endif // FILEMANAGE_H