-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMusicData.h
51 lines (38 loc) · 1.58 KB
/
MusicData.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
// This class provides functions for adding artists to an ArtistTree, as
// well as adding AlbumLists to TreeNodes of the ArtistTree.
#pragma once
#ifndef MUSICDATA_H
#define MUSICDATA_H
#include <iostream>
#include <string>
#include "ArtistTree.h"
#include "AlbumList.h"
class MusicData {
ArtistTree *artists;
public:
MusicData();
MusicData(std::string); // allow constuction from just an artist's name
MusicData(ArtistTree*);
// adds the argument string to artists as a new TreeNode*
void add_artist(std::string);
// searches artists for a TreeNode with the argument string;
// returns nullptr if not found
TreeNode *get_artist(std::string);
// searches artists for TreeNode *T with artist art; if found, checks if
// T->AlbumList is nullptr; if it is nullptr, make it point to a new AlbumList
// with (yr, alb) at its head -- otherwise, add (yr, alb) to the end of the
// existing AlbumList
void add_album(std::string art, int yr, std::string alb);
// calls artists->print_inorder() if artists is not nullptr
void print_artists();
// searches artists for TreeNode *T with artist art; if found, prints the
// contents of T->AlbumList
void print_albums(std::string art);
// return a vector with alphabetized artist names from the ArtistTree
// (used for printing within the graphics interface)
std::vector<std::string> get_artist_strings();
// return a vector with alphabetized album names for a given artist
// from the ArtistTree (used for printing within the graphics interface)
std::vector<std::string> get_album_strings(std::string);
};
#endif MUSICDATA_H