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 12class ServerInfo; 13class ShareInfo; 14 15// ExtendedShareInfo 16class ExtendedShareInfo : public BReferenceable { 17public: 18 ExtendedShareInfo(); 19 20 status_t SetTo(const ShareInfo* shareInfo); 21 22 const char* GetShareName() const; 23 24private: 25 HashString fShareName; 26}; 27 28// ExtendedServerInfo 29class ExtendedServerInfo : public BReferenceable { 30public: 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 48private: 49 status_t _AddShare(const ShareInfo* info); 50 51private: 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