Advertisement
Guest User

Untitled

a guest
Dec 10th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #ifndef ALBUMCOLLECTION_H
  2. #define ALBUMCOLLECTION_H
  3. #include "Album.h"
  4. #include <vector>
  5. #include <fstream>
  6.  
  7.  
  8. using std::vector;
  9. using namespace std;
  10.  
  11. class AlbumCollection
  12. {
  13.     public:
  14.         AlbumCollection();
  15.         AlbumCollection(vector<Album> a);
  16.         Album getAlbum(int i);
  17.         void addAlbum(Album a);
  18.         vector<Album>& getAlbumList();
  19.         Album& getAlbum(string title);
  20.  
  21.         friend ostream& operator<< (ostream& str, AlbumCollection& aC){
  22.             str << "Albums:\n\n";
  23.             for(vector<Album>::iterator it = aC.getAlbumList().begin(); it != aC.getAlbumList().end(); it++){
  24.                 Album& a = *it;
  25.                 str << a << "\n";
  26.             }
  27.             return str;
  28.         }
  29.     protected:
  30.     private:
  31.         vector<Album> albums;
  32. };
  33.  
  34. istream& operator>>(istream& is, AlbumCollection& albumCollection);
  35. ifstream& operator>>(ifstream& ifs,  AlbumCollection& albumCollection);
  36.  
  37. #endif // ALBUMCOLLECTION_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement