ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Spectre2/Share.hpp
Revision: 428
Committed: 2005-03-24T17:38:00-08:00 (20 years, 3 months ago) by douglas
File size: 1440 byte(s)
Log Message:
Finally, I can commit!

File Contents

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

Properties

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