-
Notifications
You must be signed in to change notification settings - Fork 7
/
file.h
58 lines (45 loc) · 1.57 KB
/
file.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
55
56
57
58
#ifndef FILE_H
#define FILE_H
#include <QDir>
namespace File
{
enum ErrorCode {Success,Aborted,NoZip};
}
enum LoadMode {NewMap,ImportAdd,ImportReplace};
enum SaveMode {PartOfMap,CompleteMap,UndoCommand};
enum FileType {VymMap, FreemindMap,UnknownMap};
/////////////////////////////////////////////////////////////////////////////
QString convertToRel (const QString &,const QString &);
QString convertToAbs (const QString &,const QString &);
QString basename (const QString&);
QString dirname (const QString&);
QString browseDirectory (QWidget *parent=NULL, const QString &caption="");
bool reallyWriteDirectory(const QString &dir);
QString makeTmpDir (bool &ok, const QString &dirPath, const QString &prefix);
QString makeTmpDir (bool &ok, const QString &prefix);
bool isInTmpDir (QString fn);
QString makeUniqueDir (bool &ok, QString);
void removeDir(QDir);
bool copyDir (QDir src,QDir dst, const bool &override=false);
void makeSubDirs (const QString &);
bool checkZipTool();
bool checkUnzipTool();
File::ErrorCode zipDir (QDir , QString);
File::ErrorCode unzipDir (QDir , QString);
bool loadStringFromDisk (const QString &fn, QString &s);
bool saveStringToDisk (const QString &fn, const QString &s);
FileType getMapType ( const QString &fn);
//////////////////////////////////////////////////////////
// Helper function to select image format while in SaveDialogs
class ImageIO
{
public:
ImageIO ();
QStringList getFilters();
QString getType ( QString );
QString guessType ( QString );
private:
QStringList imageFilters;
QStringList imageTypes;
};
#endif