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

Comparing DecentralizedMedia/MediaFolder.cpp (file contents):
Revision 476 by douglas, 2005-06-08T13:41:10-07:00 vs.
Revision 488 by douglas, 2005-06-17T00:21:30-07:00

# Line 5 | Line 5
5   // $Id$
6  
7   #include "MediaFolder.hpp"
8 +
9 + MediaFolder::MediaFolder(_H<dbi::Connection>& connection, const api::Path& path) : connection(connection), path(path)
10 + {
11 +        // XXX: implement
12 + }
13 +
14 + _L<MediaFile> MediaFolder::GetFiles() const
15 + {
16 +        _H<dbi::ResultSet> paths(connection->Parse(_B("SELECT path FROM files WHERE folder = ?"))->Execute(path.GetPath()));
17 +        _L<MediaFile> files;
18 +
19 +        while (paths->MoveNext())
20 +                files.InsertLast(MediaFile(connection, paths->GetString(_B("path"))));
21 +
22 +        return files;
23 + }
24 +
25 + _L<MediaFolder> MediaFolder::GetFolders() const
26 + {
27 +        _H<dbi::ResultSet> paths(connection->Parse(_B("SELECT path FROM folders WHERE folder = ?"))->Execute(path.GetPath()));
28 +        _L<MediaFolder> folders;
29 +
30 +        while (paths->MoveNext())
31 +                folders.InsertLast(MediaFolder(connection, paths->GetString(_B("path"))));
32 +        
33 +        return folders;
34 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines