-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArtist.cpp
More file actions
68 lines (54 loc) · 1.26 KB
/
Artist.cpp
File metadata and controls
68 lines (54 loc) · 1.26 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
#include <iostream>
#include <string>
#include "Artist.h"
Artist::Artist() : artist_name("") {}
Artist::Artist(const std::string &a) : artist_name(a)
{
}
Artist::Artist(const Artist &a) : artist_name(a.artist_name)
{
}
void Artist::operator=(const Artist &a)
{
artist_name = a.artist_name;
}
Artist::~Artist()
{
}
bool Artist::operator==(const Artist &a) const
{
if (artist_name == a.artist_name)
return 1;
return 0;
}
std::ostream &operator<<(std::ostream &out, const Artist &a)
{
out << a.artist_name;
return out;
}
std::istream &operator>>(std::istream &in, Artist &a)
{
std::getline(in, a.artist_name);
return in;
}
FeaturedArtist::FeaturedArtist() : featured_artist_name("")
{
}
FeaturedArtist::FeaturedArtist(Artist &a, std::string fa) : Artist(a), featured_artist_name(fa)
{
}
FeaturedArtist::FeaturedArtist(const FeaturedArtist &fa) : featured_artist_name(fa.featured_artist_name)
{
}
FeaturedArtist::~FeaturedArtist()
{
}
std::ostream &operator<<(std::ostream &out, const FeaturedArtist &fa)
{
out << fa.featured_artist_name;
return out;
}
void FeaturedArtist::print() const
{
std::cout << artist_name << " (feat. " << featured_artist_name << ")";
}