- wxIPV4address();
- wxIPV4address(const wxIPV4address& other);
- virtual ~wxIPV4address();
-
- bool Hostname(const wxString& name);
- bool Hostname(unsigned long addr);
- bool Service(const wxString& name);
- bool Service(unsigned short port);
- bool LocalHost();
- bool AnyAddress();
-
- wxString Hostname();
- wxString OrigHostname() { return m_origHostname; }
- unsigned short Service();
- wxString IPAddress() const;
-
- virtual int Type() { return wxSockAddress::IPV4; }
- virtual wxSockAddress *Clone() const;
-
- bool operator==(wxIPV4address& addr);
+ wxIPaddress() : wxSockAddress() { }
+ wxIPaddress(const wxIPaddress& other)
+ : wxSockAddress(other),
+ m_origHostname(other.m_origHostname)
+ {
+ }
+
+ bool operator==(const wxIPaddress& addr) const;
+
+ bool Hostname(const wxString& name);
+ bool Service(const wxString& name);
+ bool Service(unsigned short port);
+
+ bool LocalHost();
+ virtual bool IsLocalHost() const = 0;
+
+ bool AnyAddress();
+
+ virtual wxString IPAddress() const = 0;
+
+ wxString Hostname() const;
+ unsigned short Service() const;
+
+ wxString OrigHostname() const { return m_origHostname; }
+
+protected:
+ // get m_impl initialized to the right family if it hadn't been done yet
+ wxSockAddressImpl& GetImpl();
+ const wxSockAddressImpl& GetImpl() const
+ {
+ return const_cast<wxIPaddress *>(this)->GetImpl();
+ }
+
+ // host name originally passed to Hostname()
+ wxString m_origHostname;