-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashmap.h
More file actions
58 lines (37 loc) · 1.34 KB
/
Hashmap.h
File metadata and controls
58 lines (37 loc) · 1.34 KB
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
#ifndef HASHMAP_H
#define HASHMAP_H
#include "LinkedList.h"
#include <iostream>
#include <fstream>
#include <string>
#include <QFile>
using namespace std;
class MainWindow;
class HashMap {
public:
HashMap(int maxSize = 50);
HashMap(const HashMap& other);
const HashMap& operator=(const HashMap& rightHandSide);
~HashMap();
bool isEmpty() const;
int hashFunction(string key) const;
void insert(string key, int value, string date = "", bool status = false);
void Remove(const string& key, const int& value, const string& date);
void Edit(const string& oldkey, const int& oldvalue, const string& oldDate, int& newValue, const string& newKey, const string& newdate);
QStringList Search(const string& key);
bool Exists(const string& key, const int& value, const string& date = "");
void display(ostream& out) const;
void displayOneNode(ostream& out, string keyTo_display, int valueTo_display);
void writeToFile(QFile& File) const;
void readFromFile(QFile& file);
void markAsDone(const string& key, const int& value);
void uncheck(const string& key, const int& value);
void clearMarkedAsDone();
void deleteEntireList();
QFile File;
private:
LinkedList* map;
int mapCapacity;
int mapSize;
};
#endif // HASHMAP_H