-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFiler.h
54 lines (44 loc) · 1010 Bytes
/
Filer.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 FILER_H
#define FILER_H
#include "ColorLog.h"
#include <QObject>
#include <QString>
#include <QFileInfo>
class Filer : public QObject
{
Q_OBJECT
public:
explicit Filer(QObject *parent = 0);
~Filer();
public:
enum FileError {
AllOk,
FIsEmpty,
FIsDirIsNotFile,
FIsNotFile,
FIsNotReadable,
FIsNotWritable,
FIsExists,
FIsTooBig,
DIsFileIsNotDir,
DIsEmpty,
DIsNotReadable,
DIsNotWritable
};
public:
FileError setName(const QString &aFileName);
QString getDirName() const;
QString getFileName() const;
QString getPatchedFileName() const;
private:
QString fileName;
QString patchedFileName;
QString dirName;
private:
FileError checkFileInfo(const QFileInfo &aFileInfo);
void generateName(bool aSmgExt);
int generateNum(const QString &aName, int aStart, bool aSmgExt) const;
signals:
void toLogArea(ColError, QString);
};
#endif // FILER_H