Implemented Database storage for library.
[someplayer] / src / filestorage.h
1 #ifndef FILE_STORAGE
2 #define FILE_STORAGE
3
4 #include "someplayer.h"
5 #include "storage.h"
6 #include "playlist.h"
7
8 #define _CURRENT_PLAYLIST_NAME_ "___current"
9 #define _PLAYLIST_FILE_EXTENSION_ ".m3u"
10
11 // represents file-level storage
12 // it store data into separate files (e.g. playlist)
13
14 using SomePlayer::DataObjects::Playlist;
15
16 namespace SomePlayer {
17         namespace Storage {
18
19                 class FileStorage : public Storage {
20                 public:
21                         FileStorage(QString path);
22
23                         QList<Playlist> getPlaylists();
24                         void savePlaylist(Playlist playlist);
25                         void removePlaylist(Playlist playlist);
26                         void removePlaylist(QString name);
27
28                         Playlist getCurrentPlaylist();
29                         void saveCurrentPlaylist(Playlist playlist);
30                 private:
31                         QString _path_prefix;
32                 };
33
34         };
35 };
36
37 #endif