ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/Share.cpp
Revision: 529
Committed: 2005-06-27T18:01:23-07:00 (19 years, 11 months ago) by douglas
File size: 883 byte(s)
Log Message:
Updated to new api::Path changes.

File Contents

# User Rev Content
1 douglas 514 // Share
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7 douglas 516 #include <menes/standard.hh>
8 douglas 514
9 douglas 516 #include "Share.hpp"
10    
11 douglas 514 Share::Share(const _H<dbi::Connection>& connection, const ext::String& host, const ext::String& share) : connection(connection), host(host), share(share)
12     {
13 douglas 529 api::Path shares(_B("Shares"));
14 douglas 514
15     if (!shares.Exists())
16 douglas 529 shares.CreateDirectory();
17 douglas 514
18 douglas 529 api::Path host_(shares.GetRealPath().GetChild(host));
19 douglas 514
20     if (!host_.Exists())
21 douglas 529 host_.CreateDirectory();
22 douglas 514
23     path = host_.GetChild(share);
24    
25     if (!path.Exists())
26 douglas 529 path.CreateDirectory();
27 douglas 514 }
28    
29     void Share::Mount() const
30     {
31     api::Cout << "MOUNT: //" << host << "/" << share << " TO " << path.GetPath() << ios::NewLine;
32    
33     // XXX: implement
34     }
35    
36     void Share::Unmount() const
37     {
38     connection->Parse(_B("UPDATE files SET live = FALSE WHERE root = ?"))->Execute(path.GetPath());
39    
40     api::Cout << "UNMOUNT: //" << path.GetPath() << ios::NewLine;
41    
42     // XXX: implement
43     }

Properties

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