// Share // // Douglas Thrift // // $Id$ #include #include "Share.hpp" Share::Share(const _H& connection, const ext::String& host, const ext::String& share) : connection(connection), host(host), share(share) { api::Path shares(_B("Shares")); if (!shares.Exists()) shares.CreateDirectory(); api::Path host_(shares.GetRealPath().GetChild(host)); if (!host_.Exists()) host_.CreateDirectory(); path = host_.GetChild(share); if (!path.Exists()) path.CreateDirectory(); } void Share::Mount() const { api::Cout << "MOUNT: //" << host << "/" << share << " TO " << path.GetPath() << ios::NewLine; // XXX: implement } void Share::Unmount() const { connection->Parse(_B("UPDATE files SET live = FALSE WHERE root = ?"))->Execute(path.GetPath()); api::Cout << "UNMOUNT: //" << path.GetPath() << ios::NewLine; // XXX: implement }