ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostUpdate/Host.hpp
(Generate patch)

Comparing HostUpdate/Host.hpp (file contents):
Revision 10 by Douglas Thrift, 2003-11-06T20:35:29-08:00 vs.
Revision 15 by Douglas Thrift, 2003-11-09T16:51:42-08:00

# Line 1 | Line 1
1 < // Host Update
2 < //
3 < // Douglas Thrift
4 < //
5 < // $Id$
6 <
7 < #ifndef _Host_h_
8 < #define _Host_h_
9 <
10 < #include "HostUpdate.hpp"
11 <
12 < #ifndef _WIN32
13 <
14 < #include <sys/types.h>
15 < #include <sys/socket.h>
16 < #include <netdb.h>
17 <
18 < #else
19 <
20 < #include <Winsock2.h>
21 < #include <Ws2tcpip.h>
22 <
23 < typedef unsigned long in_addr_t;
24 <
25 < #endif
26 <
27 < class Host
28 < {
29 < private:
30 < #ifdef _WIN32
31 <        static unsigned count;
32 <        static WSADATA data;
33 < #endif
34 <        string host;
35 <        string name;
36 <        struct in_addr* address;
37 < public:
38 <        Host(const string& host = "", const string& name = "",
39 <                const string& address = "");
40 <        ~Host();
41 <        void setHost(const string& host) { this->host = host; }
42 <        void setName(const string& name, bool lookup = false);
43 <        void setAddress(const string& address, bool lookup = false);
44 <        string getHost() const { return host; }
45 <        string getName() const { return name; }
46 <        string getAddress() const { return inet_ntoa(*address); }
47 <        void operator++();
48 <        void operator++(int) { operator++(); }
49 <        void operator--();
50 <        void operator--(int) { operator++(); }
51 < };
52 <
53 < #endif // _Host_h_
1 > // Host Update
2 > //
3 > // Douglas Thrift
4 > //
5 > // $Id$
6 >
7 > #ifndef _Host_hpp_
8 > #define _Host_hpp_
9 >
10 > #include "HostUpdate.hpp"
11 >
12 > #ifndef _WIN32
13 >
14 > #include <sys/socket.h>
15 > #include <netdb.h>
16 > #include <netinet/in.h>
17 > #include <arpa/inet.h>
18 >
19 > #else
20 >
21 > #include <Winsock2.h>
22 > #include <Ws2tcpip.h>
23 >
24 > typedef unsigned long in_addr_t;
25 >
26 > #endif
27 >
28 > class Host
29 > {
30 > private:
31 > #ifdef _WIN32
32 >        static unsigned count;
33 >        static WSADATA data;
34 > #endif
35 >        string host;
36 >        string name;
37 >        struct in_addr address;
38 >        string platform;
39 > public:
40 >        Host(const string& host, const string& name = "", const string& address =
41 >                "", const string& platform = "Unknown");
42 >        ~Host();
43 >        void setHost(const string& host) { this->host = host; }
44 >        void setName(const string& name, bool lookup = false);
45 >        void setAddress(const string& address, bool lookup = false);
46 >        void setPlatform(const string& platform) { this->platform = platform; }
47 >        string getHost() const { return host; }
48 >        string getName() const { return name; }
49 >        string getAddress() const { return inet_ntoa(address); }
50 >        string getPlatform() const { return platform; }
51 >        bool operator==(const Host& host) const;
52 >        bool operator!=(const Host& host) const { return !(*this == host); }
53 >        bool operator<(const Host& host) const { return this->host < host.host; }
54 >        bool operator>(const Host& host) const { return this->host > host.host; }
55 >        Host operator++();
56 >        Host operator++(int);
57 >        Host operator--();
58 >        Host operator--(int);
59 > };
60 >
61 > #endif // _Host_hpp_

Comparing HostUpdate/Host.hpp (property svn:eol-style):
Revision 10 by Douglas Thrift, 2003-11-06T20:35:29-08:00 vs.
Revision 15 by Douglas Thrift, 2003-11-09T16:51:42-08:00

# Line 0 | Line 1
1 + native

Comparing HostUpdate/Host.hpp (property svn:keywords):
Revision 10 by Douglas Thrift, 2003-11-06T20:35:29-08:00 vs.
Revision 15 by Douglas Thrift, 2003-11-09T16:51:42-08:00

# Line 0 | Line 1
1 + Id

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines