-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileSystem.hpp
76 lines (70 loc) · 1.74 KB
/
FileSystem.hpp
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
#include <string>
#include <vector>
#include <iostream>
#include <sstream>
//Data structure baseline for the filesystem
struct Name{
char name[8];
char ext;
};
struct Txt{
Name name;
int textLength;
std::string text;
};
struct Program{
Name name;
int cpu;
int mem;
//update struct for project 3 to include time left and remaining
bool hasIO = false;
int timetd;
int amountoftime;
};
//struct proccess of our programs will be used to keep track of the programs running procceses
struct Process{
Name name; //programs name
int cpu; //cpu requirements
int memory; //programs mem
bool hasIO = false;
int timetd;
int totaltime = -1; //running total of the time required for a process
int amountoftime;
bool stored = false;//boolean to check if process is stored or not
bool running = false; //boolean to check if process is currently running
};
struct Directory{
Name name;
int contents;
std::vector<Txt*>texts;
std::vector<Program*>programs;
std::vector<Directory*>subFolders;
Directory *parent;
};
//void initialize();
void initialize(char**);
//createFile update for p2 to include filename in arg
void createFile(std::string);
//mkdir project 2 editing create dir in include a string
void createDir(std::string);
void endDir();
void quit();
//project 2 methods
void cat(std::string);
void ls();
void cd(std::string);
void pwd();
void printinfo(); //same as quit from before
//project 3
//this function will convert any input string to an int
int stringToint(std::string);
void run();
void step(int n);
void start(std::string);
void setMemory(int n);
void getMemory();
void setBurst(int n);
void addProgram(std::string);
void manage();
void runTask(int n);
void buildq();