| 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 |   | 
        
           |  |  | 21 | 	void SetDir(CyString dir);
 | 
        
           |  |  | 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;
 | 
        
           | 1 | cycrow | 34 | 	bool Create(CyString dir = NullString);
 | 
        
           |  |  | 35 | 	bool CreateAndChange(CyString dir);
 | 
        
           |  |  | 36 |   | 
        
           | 125 | cycrow | 37 | 	bool move(const Utils::String &to);
 | 
        
           | 1 | cycrow | 38 | 	bool Move(CyString from, CyString to);
 | 
        
           |  |  | 39 | 	bool RemoveDir(CyString dir, bool doFiles = false, bool recursive = false, CyStringList *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;
 | 
        
           | 121 | cycrow | 43 | 	Utils::CStringList dirList(Utils::String dir = Utils::String::Null(), Utils::String filePattern = Utils::String::Null()) const;
 | 
        
           | 1 | cycrow | 44 | 	CyStringList *DirList(CyString dir = NullString, CyString filepattern = NullString);
 | 
        
           |  |  | 45 | 	bool CheckEmptyDir(CyStringList *dirList);
 | 
        
           |  |  | 46 |   | 
        
           |  |  | 47 | 	CyString File(CyString filename);
 | 
        
           | 121 | cycrow | 48 | 	Utils::String file(const Utils::String &filename) const;
 | 
        
           | 1 | cycrow | 49 | 	CyString Dir(CyString dir = NullString);
 | 
        
           | 85 | cycrow | 50 | 	Utils::String dir(const Utils::String &sDir) const;
 | 
        
           |  |  | 51 | 	const Utils::String &dir() const;
 | 
        
           | 121 | cycrow | 52 | 	Utils::String topDir() const;
 | 
        
           | 125 | cycrow | 53 | 	const Utils::String &moveBack();
 | 
        
           |  |  | 54 | 	Utils::String back() const;
 | 
        
           | 1 | cycrow | 55 |   | 
        
           |  |  | 56 | private:
 | 
        
           | 125 | cycrow | 57 | 	Utils::String _parseDir(const Utils::String &dir) const;
 | 
        
           | 1 | cycrow | 58 |   | 
        
           | 85 | cycrow | 59 | 	Utils::String m_sCurrentDir;
 | 
        
           | 1 | cycrow | 60 | };
 | 
        
           |  |  | 61 |   | 
        
           |  |  | 62 | #endif //__DIRIO_H__
 |