-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinkedList.h
More file actions
71 lines (49 loc) · 1.64 KB
/
LinkedList.h
File metadata and controls
71 lines (49 loc) · 1.64 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
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include <string>
#include <fstream>
#include <QFile>
#include <QTextStream>
using namespace std;
class LinkedList
{
public:
LinkedList();
LinkedList(const LinkedList& origList);
~LinkedList();
const LinkedList& operator=(const LinkedList& rightSide);
bool Empty();
void insert(string dataKey, int dataVal, string dateValue, bool statusVal = false);
void Remove(string dataKey, int dataVal, string date);
void Display(int prioritylevel, QFile& File) const;
void displayOneNode(ostream& out, string keyTo_display, int valueTo_display);
bool Exists(const string& key, const int& value, const string& date);
void sortByPriority();
QStringList Search(string dataKey);
void markAsDone(const string& key, const int& value);
void uncheck(const string& key, const int& value);
void clearMarkedAsDone();
private:
class Node {
public:
int value;
string key;
bool Done;
string Date;
Node* next;
Node()
: value(), key(), Done(), Date(), next(nullptr)
{}
Node(string keyValue, int dataValue, string dateValue)
: value(dataValue), key(keyValue), Done(false), Date(dateValue), next(nullptr)
{}
Node(string keyValue, int dataValue, string dateValue, bool dataDone)
: value(dataValue), key(keyValue), Done(dataDone), Date(dateValue), next(nullptr)
{}
};
fstream File;
typedef Node* NodePointer;
NodePointer first;
int mySize;
};
#endif // LINKEDLIST_H