Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef ALBUMCOLLECTION_H
- #define ALBUMCOLLECTION_H
- #include "Album.h"
- #include <vector>
- #include <fstream>
- using std::vector;
- using namespace std;
- class AlbumCollection
- {
- public:
- AlbumCollection();
- AlbumCollection(vector<Album> a);
- Album getAlbum(int i);
- void addAlbum(Album a);
- vector<Album>& getAlbumList();
- Album& getAlbum(string title);
- friend ostream& operator<< (ostream& str, AlbumCollection& aC){
- str << "Albums:\n\n";
- for(vector<Album>::iterator it = aC.getAlbumList().begin(); it != aC.getAlbumList().end(); it++){
- Album& a = *it;
- str << a << "\n";
- }
- return str;
- }
- protected:
- private:
- vector<Album> albums;
- };
- istream& operator>>(istream& is, AlbumCollection& albumCollection);
- ifstream& operator>>(ifstream& ifs, AlbumCollection& albumCollection);
- #endif // ALBUMCOLLECTION_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement