ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/MediaFile.cpp
(Generate patch)

Comparing DecentralizedMedia/MediaFile.cpp (file contents):
Revision 478 by douglas, 2005-06-08T17:16:59-07:00 vs.
Revision 489 by douglas, 2005-06-17T00:38:17-07:00

# Line 6 | Line 6
6  
7   #include "MediaFile.hpp"
8  
9 < MediaFile::MediaFile(const ext::String& name) : name(name)
9 > #include <menes-dbi/resultset.hpp>
10 >
11 > MediaFile::MediaFile(_H<dbi::Connection>& connection, const api::Path& path) : connection(connection), path(path)
12   {
13 <        // XXX: implement
13 >        _H<dbi::ResultSet> info(connection->Parse(_B("SELECT artist, title, album, genre FROM files WHERE path = ?"))->Execute(path.GetPath()));
14 >
15 >        if (info->MoveNext())
16 >        {
17 >                artist = info->GetString(_B("artist"));
18 >                title = info->GetString(_B("title"));
19 >                album = info->GetString(_B("album"));
20 >                genre = info->GetString(_B("genre"));
21 >        }
22 >        else
23 >                throw;
24   }
25  
26 < MediaFile::MediaFile(const ext::String& name, const ext::String& artist, const ext::String& title, const ext::String& album, const ext::String& genre) : name(name), artist(artist), title(title), album(album), genre(genre)
26 > MediaFile::MediaFile(_H<dbi::Connection>& connection, const api::Path& path, const ext::String& artist, const ext::String& title, const ext::String& album, const ext::String& genre) : connection(connection), path(path), artist(artist), title(title), album(album), genre(genre)
27   {
28          // XXX: implement
29   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines