ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/MediaFolder.cpp
Revision: 491
Committed: 2005-06-17T02:19:32-07:00 (20 years ago) by douglas
File size: 915 byte(s)
Log Message:
Whoa!

File Contents

# User Rev Content
1 douglas 476 // Media Folder
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #include "MediaFolder.hpp"
8 douglas 478
9 douglas 489 #include <menes-dbi/resultset.hpp>
10    
11 douglas 485 MediaFolder::MediaFolder(_H<dbi::Connection>& connection, const api::Path& path) : connection(connection), path(path)
12 douglas 478 {
13     // XXX: implement
14     }
15    
16     _L<MediaFile> MediaFolder::GetFiles() const
17     {
18 douglas 491 _H<dbi::ResultSet> paths(connection->Parse(_B("SELECT path FROM files WHERE live = TRUE AND folder = ?"))->Execute(path.GetPath()));
19 douglas 478 _L<MediaFile> files;
20    
21 douglas 488 while (paths->MoveNext())
22     files.InsertLast(MediaFile(connection, paths->GetString(_B("path"))));
23 douglas 478
24     return files;
25     }
26    
27     _L<MediaFolder> MediaFolder::GetFolders() const
28     {
29 douglas 491 _H<dbi::ResultSet> paths(connection->Parse(_B("SELECT path FROM folders WHERE live = TRUE AND folder = ?"))->Execute(path.GetPath()));
30 douglas 478 _L<MediaFolder> folders;
31    
32 douglas 488 while (paths->MoveNext())
33     folders.InsertLast(MediaFolder(connection, paths->GetString(_B("path"))));
34 douglas 478
35     return folders;
36     }

Properties

Name Value
svn:eol-style native
svn:keywords Id