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