ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/Share.cpp
Revision: 535
Committed: 2005-06-30T02:02:44-07:00 (19 years, 11 months ago) by douglas
File size: 706 byte(s)
Log Message:
Yeah, that's right.

File Contents

# Content
1 // Share
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #include <menes/standard.hh>
8
9 #include "Share.hpp"
10
11 Share::Share(const _H<dbi::Connection>& connection, const api::Address& host, const cse::String& share) : connection(connection), host(host), share(share)
12 {
13 api::Path shares(_B("Shares"));
14
15 if (!shares.Exists())
16 shares.CreateDirectory();
17
18 cse::String address, port;
19
20 host.ToString(address, port);
21
22 api::Path host_(shares.GetRealPath().GetChild(address));
23
24 if (!host_.Exists())
25 host_.CreateDirectory();
26
27 path = host_.GetChild(share);
28
29 if (!path.Exists())
30 path.CreateDirectory();
31 }
32
33 Share::~Share()
34 {
35 connection->Parse(_B("UPDATE files SET live = FALSE WHERE root = ?"))->Execute(path.GetPath());
36 }

Properties

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