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 489 by douglas, 2005-06-17T00:38:17-07:00

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines