-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContext.cpp
More file actions
86 lines (68 loc) · 1.17 KB
/
Context.cpp
File metadata and controls
86 lines (68 loc) · 1.17 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* Project Untitled
*/
#include "Context.h"
/**
* Context implementation
*/
Context cxt;
Context::Context() {
this->c_spb = new SuperBlock();
this->MyDisk = fopen("MyDisk.img", "rb+");
c_FileSystem.LoadSuperBlock();
c_rootDirInode.i_number = 0;
c_rootDirInode.ICopy();
c_pwd = &c_rootDirInode;
}
Context::~Context() {
delete this->c_spb;
fclose(this->MyDisk);
}
/**
* @return FileManager*
*/
FileManager* Context::GetFileManager() {
return &(this->c_FileManager);
}
Inode* Context::GetrootDirInode() {
return &(this->c_rootDirInode);
}
/**
* @return inode*
*/
Inode* Context::GetPwd() {
return this->c_pwd;
}
/**
* @return char*
*/
string* Context::GetPwdPath() {
return &(this->c_pwd_path);
}
/**
* @return IOParameter*
*/
IOParameter* Context::GetIOParameter() {
return &(this->c_IOParameter);
}
/**
* @return FileSystem*
*/
FileSystem* Context::GetFileSystem() {
return &(this->c_FileSystem);
}
/**
* @return FILE*
*/
FILE* Context::GetMyDisk() {
return this->MyDisk;
}
OpenFiles* Context::GetOpenFiles() {
return &(this->c_OpenFiles);
}
/**
* @return SuperBlock*
*/
SuperBlock* Context::GetSuperBlock() {
return this->c_spb;
}