-
Notifications
You must be signed in to change notification settings - Fork 1
/
book.h
48 lines (44 loc) · 1.21 KB
/
book.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
#ifndef BOOK_H
#define BOOK_H
#include <string>
#include <vector>
using namespace std;
class Book
{
private:
string m_name;
string m_moduleName;
typedef struct Verse {
int m_start;
int m_length;
int m_tokensStart;
int m_tokensLength;
string m_info;
} Verse;
vector<Verse> m_verses;
string m_text;
vector<int> m_tokens;
public:
Book(const string& name): m_name(name) {};
void setModuleName(const string& moduleName);
string getModuleName();
string getName();
void addVerse(const string& text, const string& info, vector<int> tokens);
string getVerse(string info);
string getVerseInfoStart(int position);
string getVerseInfoEnd(int position);
string getVerseTokensInfoStart(int position);
string getVerseTokensInfoEnd(int position);
string getText();
vector<int> getVerseTokens(string info);
vector<int> getTokens();
int getVerseStart(string info);
int getVerseEnd(string info);
int getVerseTokensStart(string info);
int getVerseTokensEnd(string info);
// to load a book from cache:
void setText(const string& text);
void addVerse(int start, int length, string info, int tokensStart, int tokensLength);
void setTokens(vector<int>& tokens);
};
#endif // BOOK_H