-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBook.h
69 lines (56 loc) · 1.7 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef _BOOK_H_
#define _BOOK_H_
/*
Book.h
Author: M00734132
Created: 30/03/2021
Updated: 16/04/2021
*/
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include<iterator>
class Book{
private:
std::string title;
std::string author;
std::string isbn;
std::string qty;
public:
Book();
Book(std::string title, std::string author, std::string isbn, std::string qty);
Book* next;
std::string get_title();
std::string get_author();
std::string get_isbn();
std::string get_qty();
Book* get_next();
void set_title(std::string title);
void set_author(std::string author);
void set_isbn(std::string isbn);
void set_qty(std::string qty);
void set_next(Book *next);
};
class Hash_Table {
private:
unsigned int size;
Book** internal_array;
public:
Hash_Table();
Hash_Table(unsigned int size);
~Hash_Table();
unsigned int get_size();
unsigned long int hash_Func(std::string str);
bool addBook(std::string title, std::string author, std::string isbn, std::string qty);
std::vector<std::string> StringToVector(std::string title, char separator);
bool removeBook(std::string title);
bool searchBook(std::string title);
void printHash();
bool delete_table();
std::string ReadFile(std::string file_name);
std::string insertContentToFile(std::string title, std::string author, std::string isbn, std::string qty, std::string file_name);
std::string deleteFileContent(std::string title, std::string file_name);
};
#endif