-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileOps.h
51 lines (33 loc) · 1.24 KB
/
FileOps.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
/******************************************************
*
* Take a vector of strings representing a list of files
*
*****************************************************/
#ifndef HDR_BLAST_FILEOPS_H
#define HDR_BLAST_FILEOPS_H
#include <vector>
#include <string>
/*
* Mapping of bytes in a given file to byte ranges in the key
*/
typedef struct FileToKeyByteMap
{
std::string filename;
/* index in the key that corresponds to the first byte in this file */
unsigned long startByteIndex;
/* index in the key that corresponds to the last byte in this file */
unsigned long endByteIndex;
unsigned long file_sz;
void print() const;
unsigned char getNthByte(const std::string filename, const unsigned long n);
FileToKeyByteMap(const FileToKeyByteMap &map) { filename = map.filename; startByteIndex = map.startByteIndex; endByteIndex = map.endByteIndex; }
FileToKeyByteMap() { filename = ""; startByteIndex = 0; endByteIndex = 0; }
} FileToKeyByteMap;
class FileOps
{
public:
FileOps() {};
unsigned long fileChecks(const std::vector<std::string> fileNames, std::vector<FileToKeyByteMap>& keyMap);
void populateKeyMap(const unsigned long n, std::vector<FileToKeyByteMap>& keyMap);
};
#endif /* !HDR_BLAST_FILEOPS_H */