/* Name: song.h * Purpose: Header for Song Class * Author: Dr. Michael A. Redmond * Date Written: 03/06/2k * Date Revised: 03/27/2k - improved << and added == to allow use of list remove function * NOTES: */ #ifndef SONG_H #define SONG_H // in song.h #include // allows string handling #include using namespace std; class Song { public: // constructors Song(); Song(const string& titl, const string &art, int min = 3, int sec = 0); // inspectors // in-line string GetTitle() const{ return title; } string GetArtist() const{ return artist; } int GetMins() const { return lenMins; } int GetSecs() const{ return lenSecs; } // return total length in seconds int GetLength() const{ return (60 * lenMins) + lenSecs; } // mutators // void SetTitle(const string & titl) { title = titl; } void SetArtist(const string & art) { artist = art; } // set minutes and seconds bool SetLen(const int min, const int sec = 0); protected: private: string title; string artist; int lenMins; int lenSecs; }; // allows outputting all info about song ostream& operator << (ostream & strOut, const Song & mySong); // allows checking equality between songs bool operator == (const Song & lhs, const Song & rhs); #endif