forked from gcsjsd/fileStorageEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSFHeader.h
More file actions
27 lines (25 loc) · 737 Bytes
/
Copy pathSFHeader.h
File metadata and controls
27 lines (25 loc) · 737 Bytes
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
#ifndef SFHeader_h
#define SFHeader_h
#include <string>
#include <vector>
#include "SFile.h"
#include <fstream>
#include "Block.h"
class SFHeader {
private:
block_i blocks[maxFileNumber];
public:
SFHeader();
~SFHeader();
std::vector<int> assignChunks(int chunkNum);
std::vector<int> addFileHeader(block_i& block, std::ofstream archive);
void delFileHeader(int atype, std::string aname, std::ofstream archive);
std::vector<int> getFile(int atype, std::string aname); // return the chunk number for this file.
int getFileSize(int atype, std::string aname);
void writeHeader(std::ofsream& archive);
void readHeader(std::ifstream& archive);
void updateWholeHeader();
void listFiles(std::string s);
void listFiles();
};
#endif