-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.h
59 lines (44 loc) · 1.46 KB
/
Directory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef DIRECTORY_H
#define DIRECTORY_H
#include "commonHeaders.h"
#include "Shlwapi.h"
class Directory
{
protected:
vector<string> m_files;
vector<string> m_directories;
string m_rootDir;
string m_mask;
bool getDirTree ();
public:
Directory (string startDirectory,
string mask)
{
m_rootDir = startDirectory;
m_mask = mask;
getDirTree ();
}
virtual ~Directory (){}
vector<string> getFiles()
{
if (!getDirTree ())
return vector<string>(0);
else
return m_files;
}
bool CreateNewDirectory (string rootDir,
string path);
bool CreateNewDirectory (string path);
string getRoot() {return m_rootDir;}
string getMask() {return m_mask;}
void setRoot(string s) {m_rootDir = s;}
void setMask(string s) {m_mask = s;}
void clearFiles () {m_files.clear();}
list<string> getDirs (string rootDir); //Fills the vector of directories
list<string> getFiles (string rootDir, //Fills the vector of files
string mask);
list<string> getFilesRecur (string rootDir,
string mask);
string getParentDir (string path);
};
#endif