-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.h
47 lines (35 loc) · 942 Bytes
/
database.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
#include <string>
#include <vector>
#include <iostream>
#include "protein.h"
using std::vector;
using std::string;
class Database {
private :
string filename;
int32_t version;
int32_t type;
int32_t titleLength;
string title;
int32_t timestampLength;
string timestamp;
int32_t nbrSequences;
int32_t residueCount;
int32_t maxLength;
vector<int> headerOffsets;
vector<int> sequenceOffsets;
vector<Protein> proteins;
int bytesToIntBigEndian(char bytes[], int lenght);
int bytesToIntLittleEndian(char bytes[], int lenght);
void loadHeader(const string &filename);
void loadProteins(const string &filename);
void loadHeaders(const string &filename);
public :
Database(string dbName);
//~Database();
void printInfos(std::ostream & out = std::cout);
void loadDb(const string dbName);
Protein & getProtein(int index);
bool contains(Protein protein);
int getNbrSequences();
};