00001 /* Copyright (c) 2008, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 * 00007 * Author: Gennady Bystritsky 00008 */ 00009 00010 #ifndef _SK_NET_IP4_ADDRESS_H_ 00011 #define _SK_NET_IP4_ADDRESS_H_ 00012 00013 #include <sk/util/Object.h> 00014 00015 #include <sk/util/String.h> 00016 00017 namespace sk { 00018 namespace net { 00019 namespace ip4 { 00020 class Address 00021 : public virtual sk::util::Object 00022 { 00023 public: 00024 Address(); 00025 Address(const Address& other); 00026 Address(const sk::util::String& spec); 00027 Address(uint32_t number); 00028 virtual ~Address(); 00029 00030 static const Address hostname(const sk::util::String& name); 00031 static const Address ip(const sk::util::String& number); 00032 static const Address number(uint32_t number); 00033 static const Address localhost(); 00034 00035 const sk::util::String hostname() const; 00036 const sk::util::String ip() const; 00037 uint32_t number() const; 00038 00039 // sk::util::Object re-implementation. 00040 const sk::util::Class getClass() const; 00041 00042 private: 00043 Address& operator = (const Address& other); 00044 }; 00045 } 00046 } 00047 } 00048 00049 #endif /* _SK_NET_IP4_ADDRESS_H_ */