xref: /haiku/src/add-ons/kernel/file_systems/netfs/client/ExtendedServerInfo.h (revision 220d04022750f40f8bac8f01fa551211e28d04f2)
1 // ExtendedServerInfo.h
2 
3 #ifndef NET_FS_EXTENDED_SERVER_INFO_H
4 #define NET_FS_EXTENDED_SERVER_INFO_H
5 
6 #include <HashString.h>
7 #include <Referenceable.h>
8 
9 #include "NetAddress.h"
10 #include "Vector.h"
11 
12 class ServerInfo;
13 class ShareInfo;
14 
15 // ExtendedShareInfo
16 class ExtendedShareInfo : public BReferenceable {
17 public:
18 								ExtendedShareInfo();
19 
20 			status_t			SetTo(const ShareInfo* shareInfo);
21 
22 			const char*			GetShareName() const;
23 
24 private:
25 			HashString			fShareName;
26 };
27 
28 // ExtendedServerInfo
29 class ExtendedServerInfo : public BReferenceable {
30 public:
31 								ExtendedServerInfo(const NetAddress& address);
32 								~ExtendedServerInfo();
33 
34 			const NetAddress&	GetAddress() const;
35 			const char*			GetServerName() const;
36 			const char*			GetConnectionMethod() const;
37 
38 			int32				CountShares() const;
39 			ExtendedShareInfo*	ShareInfoAt(int32 index) const;
40 			ExtendedShareInfo*	GetShareInfo(const char* name);
41 
42 			status_t			SetTo(ServerInfo* serverInfo);
43 
44 			void				SetState(uint32 state);
45 			uint32				GetState() const;
46 				// used by the ServerManager only
47 
48 private:
49 			status_t			_AddShare(const ShareInfo* info);
50 
51 private:
52 		NetAddress				fAddress;
53 		HashString				fServerName;
54 		HashString				fConnectionMethod;
55 		Vector<ExtendedShareInfo*> fShareInfos;
56 		uint32					fState;
57 };
58 
59 #endif	// NET_FS_EXTENDED_SERVER_INFO_H
60