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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
| #pragma once
class FileSystem
{
public:
FileSystem();
~FileSystem();
};
class TableUsers
{
private:
long virtual_address;
public:
};
class MAIN
{
private:
/*long offset;
FILE *f;
char Name_of_stream[] = "MAIN";*/
public:
};
class SYMKEY: public MAIN
{
private:
public:
};
class TableOfStreams
{
private:
};
class DescriptorStreams: public MAIN
{
private:
string name_of_stream;
long virtual_adress;
public:
};
class StructureOfDirectory
{
};
class Directory : public File
{
private:
long virtual_address;
};
class File
{
private:
string filename;
Directory *descriptor;
long size;
FILE *f;
Date time_and_date;
Access access;
public:
File() : filename(nullptr),descriptor (nullptr), size(0), time_and_date(), access(), f(nullptr){}
File(string);
File Open_to_Read(File &);
File Open_to_Write(File &);
File Editing(File &);
File Close(File &);
File Output_infomation(File &);
void Output_infomation_About_file(File &);
File GetAccess_To_File(File &);
File Change_Access_To_File(File &);
~File();
};
class NormalFile : public File
{
private:
TableOfStreams *cur;
public:
NormalFile() :File(){}
string Type_of_File(){ return "Normal File";}
};
class EncryptedFile : public File
{
private:
TableOfStreams *cur;
public:
EncryptedFile() :File(){}
string Type_Of_File(){ return "Encrypted File";};
};
//Класс управления доступом на уровне пользователей
//ADMIN - 0 , 1- only user, 2- all users
class Access
{
private:
int ID;
char access; //биты 1-чтение 2-запись 3-исполнение
static Access entrance;
public:
Access(int ident=0, char acc=0);
~Access();
void set_Access(int, char);
int get_ID();
char get_Access();
};
//Класс даты и времени
class Date
{
private:
int day, month, year, hour, minutes, seconds;
static Date creation_date;
static Date last_modification_date;
public:
Date(int dd = 0, int mon = 0, int yy = 0, int hh = 0, int min = 0, int ss = 0);
~Date();
static void set_creation();
static void set_last_modification();
Date get_creation_date();
Date get_last_modification_date();
}; |