This repository has been archived by the owner on Apr 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpleOS.h
52 lines (46 loc) · 1.41 KB
/
SimpleOS.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
/* Name : Dumitru
** Class : CS 330 - 001
** Date : Jan/Feb 2007
**
** Description: SimpleOS.h
Mimics a simple operating system with system calls. With the use of the file
system class it can install a disk, format it, mount it, display its contents,
change between file systems and finally unmount the file system.
******************************************************************************/
#ifndef SIMPLE_OS_H // avoid multiple declarations
#define SIMPLE_OS_H
#include "FileSystem.h"
// represents a disk object
struct DiskObj
{
string diskName; // name of the disk
FileSystem * fs; // the disk's file system
bool mounted; // is the disk mounted or not
bool isCurrent; // is the disk's fs the current fs
};
class SimpleOS
{
public:
// constructor
SimpleOS();
// self explanatory functions
void InstallDisk(string,int,fstream&);
void FormatDisk(string,string,int,int,fstream&);
void MountDisk(string,string,fstream&);
void UnmountDisk(string,fstream&);
void ShowMounts(fstream&);
void ChangeFs(string,fstream&);
void DumpFs(int,int,fstream&);
void ShowFs(fstream&);
void ImportFile(string,fstream&);
void CpFile(string,string,fstream&);
void RenameFile(string,string,fstream&);
void ListFiles(fstream&);
void ChgOwner(string,int,fstream&);
void ChangePerm(string,string,fstream&);
void ExportFile(string,fstream&);
private:
DiskObj * diskTable[MAX_NUM_FS];
int GetCurrFSindex();
};
#endif // SIMPLE_OS_H