ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/Share.cpp
(Generate patch)

Comparing DecentralizedMedia/Share.cpp (file contents):
Revision 529 by douglas, 2005-06-27T18:01:23-07:00 vs.
Revision 555 by douglas, 2005-07-10T21:18:35-07:00

# Line 4 | Line 4
4   //
5   // $Id$
6  
7 < #include <menes/standard.hh>
7 > #include <menes/c++/standard.hh>
8  
9   #include "Share.hpp"
10  
11 < Share::Share(const _H<dbi::Connection>& connection, const ext::String& host, const ext::String& share) : connection(connection), host(host), share(share)
11 > Share::Share(const _R<Connector>& connector, const api::Address& host, const cse::String& share) : connector(connector), host(host), share(share)
12   {
13 <        api::Path shares(_B("Shares"));
13 >        cse::String address, port;
14  
15 <        if (!shares.Exists())
16 <                shares.CreateDirectory();
15 >        host.ToString(address, port);
16  
17 <        api::Path host_(shares.GetRealPath().GetChild(host));
17 >        api::Path host_(shares.GetChild(address));
18  
19          if (!host_.Exists())
20                  host_.CreateDirectory();
# Line 26 | Line 25 | Share::Share(const _H<dbi::Connection>&
25                  path.CreateDirectory();
26   }
27  
28 < void Share::Mount() const
28 > Share::~Share()
29   {
30 <        api::Cout << "MOUNT: //" << host << "/" << share << " TO " << path.GetPath() << ios::NewLine;
30 >        _R<dbi::Connection> connection(connector->Connect());
31  
33        // XXX: implement
34 }
35
36 void Share::Unmount() const
37 {
32          connection->Parse(_B("UPDATE files SET live = FALSE WHERE root = ?"))->Execute(path.GetPath());
33 <
40 <        api::Cout << "UNMOUNT: //" << path.GetPath() << ios::NewLine;
41 <
42 <        // XXX: implement
33 >        connector->Release(connection);
34   }
35 +
36 + api::Path Share::shares(_B("Shares"));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines