-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCS.hpp
63 lines (52 loc) · 1.02 KB
/
CS.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
#include "BTreeNode.cpp"
#include "BTree.cpp"
#include "ChunkNodeKey.cpp"
#include "FileNodeKey.cpp"
#include <iostream>
#include <string>
namespace AIFBS
{
struct SplittedNames
{
public:
std::string m_fileName;
std::string m_chunkName;
};
class CS
{
int m_fileT;
int m_chunkT;
BTree<FileNodeKey> *fileTree;
SplittedNames split(std::string);
public:
CS() {
m_fileT = 3;
m_chunkT = 5;
fileTree = new BTree<FileNodeKey>(m_fileT);
}
CS(int t_t) {
m_fileT = t_t;
m_chunkT = t_t;
fileTree = new BTree<FileNodeKey>(m_fileT);
}
CS(int t_fileT, int t_chunkT) {
m_fileT = t_fileT;
m_chunkT = t_chunkT;
fileTree = new BTree<FileNodeKey>(m_fileT);
}
~CS() {
}
void insert(std::string name, int payload);
ChunkNodeKey* find(std::string t_name);
void traverse() {
if(fileTree == NULL)
std::cout<<"Empty FileTree";
else
fileTree->traverse();
}
bool removeFile() {
}
bool remove(std::string chunkDetails);
bool removeFile(std::string fileName);
};
}