Advertisement
Guest User

Untitled

a guest
Dec 11th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 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.         void sortAlbums();
  21.  
  22.         friend ostream& operator<< (ostream& str, AlbumCollection& aC){
  23.             str << "Albums:\n\n";
  24.             for(vector<Album>::iterator it = aC.getAlbumList().begin(); it != aC.getAlbumList().end(); it++){
  25.                 Album& a = *it;
  26.                 str << a << "\n";
  27.             }
  28.             return str;
  29.         }
  30.     protected:
  31.     private:
  32.         vector<Album> albums;
  33. };
  34.  
  35. istream& operator>>(istream& is, AlbumCollection& albumCollection);
  36. ifstream& operator>>(ifstream& ifs,  AlbumCollection& albumCollection);
  37.  
  38. #endif // ALBUMCOLLECTION_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement