Subversion Repositories spk

Rev

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