-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfile-manager.h
47 lines (35 loc) · 956 Bytes
/
file-manager.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
#ifndef FILE_MANAGER_H_
#define FILE_MANAGER_H_
#include <string>
#include <vector>
using std::string;
using std::vector;
class FileManager;
static FileManager* fm = NULL;
class FileManager {
public:
static FileManager* DefaultFileManager() {
if (fm == NULL) {
fm = new FileManager();
}
return fm;
}
bool Initialize();
bool DirectoryContents(const string& dir, vector<string>* contents);
string ProjectDir() { return project_dir_; }
int NumSavedProjects();
vector<string> SavedProjectNames();
// Return the full path to the configuration file. Will be empty if there is
// no configuration file.
string ConfigFilePath() { return config_file_path_; }
private:
FileManager();
virtual ~FileManager();
bool CheckDir(const string& dir);
bool FileExists(const string& file_path);
string home_dir_;
string data_dir_;
string project_dir_;
string config_file_path_;
};
#endif // FILE_MANAGER_H_