ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Spectre2/Share.hpp
Revision: 431
Committed: 2005-03-26T22:35:26-08:00 (20 years, 2 months ago) by douglas
File size: 1699 byte(s)
Log Message:
Grr! Why must this thing decided to ask for all the memory in existance at a certain point?

File Contents

# Content
1 // Spectre 2
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #ifndef _Share_hpp_
8 #define _Share_hpp_
9
10 #include "Error.hpp"
11 #include "Daemon.hpp"
12
13 #ifdef MENES_PRAGMA_ONCE
14 #pragma once
15 #endif
16
17 class Share
18 {
19 private:
20 ext::String host, name, owner, user, group;
21 public:
22 Share::Share(const ext::String& host, const ext::String& name, const ext::String& owner = ext::String(), const ext::String& user = ext::String(), const ext::String& group = ext::String()) : host(host), name(name), owner(owner), user(user), group(group) {}
23 static ext::RedBlackMap<ext::String, ext::String> passwords;
24 static api::ThreadMutex passwordsLock;
25 const ext::String& getHost() const { return host; }
26 const ext::String& getName() const { return name; }
27 const ext::String& getOwner() const { return owner; }
28 const ext::String& getUser() const { return user; }
29 const ext::String& getGroup() const { return group; }
30 ext::String getPassword() const;
31 ext::String getUri() const { return "smb://" + operator ext::String(); }
32 ext::String getService() const;
33 ext::String getMount() const { return Spectre2::root + "/" + operator ext::String(); }
34 bool mounted() const;
35 bool mountable() const;
36 operator ext::String() const { return host + "/" + name; }
37 bool operator==(const Share& share) const { return operator ext::String() == share.operator ext::String(); }
38 bool operator!=(const Share& share) const { return operator ext::String() != share.operator ext::String(); }
39 bool operator<(const Share& share) const { return operator ext::String() < share.operator ext::String(); }
40 };
41
42 inline ios::PrintWriter& operator<<(ios::PrintWriter& out, const Share& share)
43 {
44 return out << share.operator ext::String();
45 }
46
47 #endif//_Share_hpp_

Properties

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