| 1 |
cycrow |
1 |
#ifndef __DIRIO_H__
|
|
|
2 |
#define __DIRIO_H__
|
|
|
3 |
|
| 196 |
cycrow |
4 |
#include "Utils/WStringList.h"
|
| 1 |
cycrow |
5 |
#include "spkdll.h"
|
|
|
6 |
|
|
|
7 |
class CFileIO;
|
|
|
8 |
|
|
|
9 |
class SPKEXPORT CDirIO
|
|
|
10 |
{
|
|
|
11 |
public:
|
| 196 |
cycrow |
12 |
static bool Exists(const Utils::WString &dir);
|
|
|
13 |
static bool IsEmptyDir(const Utils::WStringList& dirList);
|
| 125 |
cycrow |
14 |
|
|
|
15 |
public:
|
| 185 |
cycrow |
16 |
CDirIO();
|
| 196 |
cycrow |
17 |
CDirIO(const Utils::WString &dir);
|
| 185 |
cycrow |
18 |
CDirIO(CFileIO *file);
|
|
|
19 |
~CDirIO();
|
| 1 |
cycrow |
20 |
|
| 196 |
cycrow |
21 |
void setDir(const Utils::WString& dir);
|
| 1 |
cycrow |
22 |
|
|
|
23 |
// access functions
|
| 121 |
cycrow |
24 |
bool exists() const;
|
| 196 |
cycrow |
25 |
bool exists(const Utils::WString &dir) const;
|
| 121 |
cycrow |
26 |
bool isDir() const;
|
| 196 |
cycrow |
27 |
bool isDir(const Utils::WString &dir) const;
|
| 121 |
cycrow |
28 |
bool isFile() const;
|
| 196 |
cycrow |
29 |
bool isFile(const Utils::WString &dir) const;
|
| 1 |
cycrow |
30 |
|
|
|
31 |
// directory handling
|
| 129 |
cycrow |
32 |
bool create() const;
|
| 196 |
cycrow |
33 |
bool create(const Utils::WString &dir) const;
|
|
|
34 |
bool createAndChange(const Utils::WString &dir);
|
| 1 |
cycrow |
35 |
|
| 196 |
cycrow |
36 |
bool move(const Utils::WString &to);
|
|
|
37 |
bool move(const Utils::WString& from, const Utils::WString& to);
|
| 197 |
cycrow |
38 |
bool removeDir(const Utils::WString &dir, bool doFiles = false, bool recursive = false, Utils::WStringList* errors = NULL);
|
| 196 |
cycrow |
39 |
bool cd(const Utils::WString &dir);
|
| 1 |
cycrow |
40 |
|
| 302 |
cycrow |
41 |
bool dirList(Utils::WStringList& files, const Utils::WString &dir = Utils::WString::Null(), const Utils::WString &filePattern = Utils::WString::Null(), bool absolutePath = false) const;
|
| 197 |
cycrow |
42 |
bool checkEmptyDir(const Utils::WStringList& dirList) const;
|
| 1 |
cycrow |
43 |
|
| 196 |
cycrow |
44 |
Utils::WString file(const Utils::WString &filename) const;
|
|
|
45 |
Utils::WString dir(const Utils::WString &sDir) const;
|
|
|
46 |
const Utils::WString &dir() const;
|
|
|
47 |
Utils::WString topDir() const;
|
|
|
48 |
const Utils::WString &moveBack();
|
|
|
49 |
Utils::WString back() const;
|
| 313 |
cycrow |
50 |
Utils::WString relativePath(const Utils::WString& filename) const;
|
| 1 |
cycrow |
51 |
|
|
|
52 |
private:
|
| 196 |
cycrow |
53 |
Utils::WString _parseDir(const Utils::WString &dir) const;
|
| 1 |
cycrow |
54 |
|
| 196 |
cycrow |
55 |
Utils::WString m_sCurrentDir;
|
| 1 |
cycrow |
56 |
};
|
|
|
57 |
|
|
|
58 |
#endif //__DIRIO_H__
|