xref: /haiku/src/add-ons/kernel/file_systems/netfs/headers/shared/ServerInfo.h (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1 // ServerInfo.h
2 
3 #ifndef NET_FS_SERVER_INFO_H
4 #define NET_FS_SERVER_INFO_H
5 
6 #include "HashString.h"
7 #include "Request.h"
8 #include "Vector.h"
9 
10 // ShareInfo
11 class ShareInfo : public FlattenableRequestMember {
12 public:
13 								ShareInfo();
14 
15 			bool				IsValid() const;
16 
17 	virtual	void				ShowAround(RequestMemberVisitor* visitor);
18 
19 	virtual	status_t			Flatten(RequestFlattener* flattener);
20 	virtual	status_t			Unflatten(RequestUnflattener* unflattener);
21 
22 			status_t			SetShareName(const char* shareName);
23 			const char*			GetShareName() const;
24 
25 private:
26 			HashString			fShareName;
27 };
28 
29 
30 // ServerInfo
31 class ServerInfo : public FlattenableRequestMember {
32 public:
33 								ServerInfo();
34 								ServerInfo(const ServerInfo& other);
35 
36 	virtual	void				ShowAround(RequestMemberVisitor* visitor);
37 
38 	virtual	status_t			Flatten(RequestFlattener* flattener);
39 	virtual	status_t			Unflatten(RequestUnflattener* unflattener);
40 
41 			status_t			SetServerName(const char* serverName);
42 			const char*			GetServerName() const;
43 
44 			status_t			SetConnectionMethod(
45 									const char* connectionMethod);
46 			const char*			GetConnectionMethod() const;
47 
48 			status_t			AddShare(const char* shareName);
49 			int32				CountShares() const;
50 			const ShareInfo&	ShareInfoAt(int32 index) const;
51 
52 			ServerInfo&			operator=(const ServerInfo& other);
53 
54 private:
55 			HashString			fServerName;
56 			HashString			fConnectionMethod;
57 			Vector<ShareInfo>	fShareInfos;
58 };
59 
60 #endif	// NET_FS_SERVER_INFO_H
61