-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibrary.h
58 lines (41 loc) · 837 Bytes
/
Library.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
/*
CSI-240-52
Joe Healy
Final Assignment
Library Class
*/
#ifndef __LIBRARY_
#define __LIBRARY_
#include "song.h"
#include <algorithm>
using namespace std;
struct LLNode
{
Song data;
LLNode* prev;
LLNode* next;
};
class Library
{
public:
//public member functions
//default constructor
Library();
//adds a song to the library
void addSong(Song s);
// Removes a song from the library
void removeSong(Song s);
//removes all songs from library
//void clearLibrary();
//Sorts the list alpabetically by song name
void sort();
//Swaps two nodes in list
void swapNodes(LLNode* a, LLNode* b);
//returns a string representation of the library
string toString();
protected:
LLNode* head;
LLNode* current;
LLNode* tail;
};
#endif // __LIBRARY_