Subversion Repositories spk

Rev

Rev 183 | Rev 196 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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