ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/MediaFolder.cpp
Revision: 488
Committed: 2005-06-17T00:21:30-07:00 (20 years ago) by douglas
File size: 847 byte(s)
Log Message:
Let's try this.

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

Properties

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