1 |
// Test Music Library |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#include <iostream> |
8 |
|
9 |
#include <foreach.hpp> |
10 |
#include <truck.hpp> |
11 |
|
12 |
#include "MusicLibrary.hpp" |
13 |
|
14 |
int main(int argc, char *argv[]) |
15 |
{ |
16 |
try |
17 |
{ |
18 |
MusicLibrary::Library library; |
19 |
|
20 |
/*_foreach (const _L<MusicLibrary::Artist>, artist, library.GetArtists()) |
21 |
{ |
22 |
std::cout << artist->GetId() << ' ' << artist->GetName() << std::endl; |
23 |
|
24 |
_foreach (const _L<MusicLibrary::Album>, album, artist->GetAlbums()) |
25 |
{ |
26 |
std::cout << album->GetId() << ' ' << album->GetName() << ' ' << album->GetYear() << std::endl; |
27 |
|
28 |
_foreach (const _L<MusicLibrary::Song>, song, album->GetSongs()) |
29 |
std::cout << song->GetId() << ' ' << song->GetName() << ' ' << song->GetPath() << ' ' << song->GetTrack() << std::endl; |
30 |
} |
31 |
}*/ |
32 |
|
33 |
_foreach (const _L<MusicLibrary::Song>, song, library.GetSongs()) |
34 |
std::cout << song->GetId() << ' ' << song->GetName() << ' ' << song->GetPath() << ' ' << song->GetTrack() << std::endl; |
35 |
} |
36 |
catch (const std::exception &exception) |
37 |
{ |
38 |
std::cerr << argv[0] << _B(": ") << exception.what() << std::endl; |
39 |
|
40 |
return 1; |
41 |
} |
42 |
|
43 |
return 0; |
44 |
} |