IPAddress Class Reference

Stores an IP address and converts between string and numeric formats. More...

#include <socket.hpp>

List of all members.

Public Member Functions

 IPAddress ()
 Initialize the address as 0.0.0.0.
 IPAddress (unsigned int)
 Initialize the address to the integer value.
 IPAddress (unsigned char, unsigned char, unsigned char, unsigned char)
 Initialize the address using 4 octets.
 IPAddress (const char *)
 Initialize the address using a string (eg 255.255.255.255).
 IPAddress (in_addr)
 Initialize the address using a POSIX in_addr struct.
 IPAddress (std::string)
 Initialize the address using a string (eg 255.255.255.255).
IPAddressoperator= (unsigned int)
 Set the address to an integer value.
IPAddressoperator= (const char *)
 Set the address using a string (eg 255.255.255.255).
IPAddressoperator= (in_addr)
 Set the address using a POSIX in_addr struct.
IPAddressoperator= (std::string)
 Set the address using a string (eg 255.255.255.255).
 operator unsigned int ()
 Return the IP address as an integer.
 operator in_addr ()
 Return the IP address as a POSIX in_addr struct.
 operator std::string ()
 Return the IP address as a string (eg 255.255.255.255).
bool operator== (const IPAddress &)

Protected Member Functions

std::string GetString ()
 Return the IP address as a string (eg 255.255.255.255).

Protected Attributes

uint32_t address
 Integer version of the IP address.


Detailed Description

Stores an IP address and converts between string and numeric formats.

Constructor & Destructor Documentation

IPAddress::IPAddress (  ) 

Initialize the address as 0.0.0.0.

IPAddress::IPAddress ( unsigned int  addr  ) 

Initialize the address to the integer value.

IPAddress::IPAddress ( unsigned char  o1,
unsigned char  o2,
unsigned char  o3,
unsigned char  o4 
)

Initialize the address using 4 octets.

IPAddress::IPAddress ( const char *  str_addr  ) 

Initialize the address using a string (eg 255.255.255.255).

IPAddress::IPAddress ( in_addr  addr  ) 

Initialize the address using a POSIX in_addr struct.

IPAddress::IPAddress ( std::string  str_addr  ) 

Initialize the address using a string (eg 255.255.255.255).


Member Function Documentation

std::string IPAddress::GetString (  )  [protected]

Return the IP address as a string (eg 255.255.255.255).

IPAddress & IPAddress::operator= ( unsigned int  addr  ) 

Set the address to an integer value.

IPAddress & IPAddress::operator= ( const char *  str_addr  ) 

Set the address using a string (eg 255.255.255.255).

IPAddress& IPAddress::operator= ( in_addr   ) 

Set the address using a POSIX in_addr struct.

IPAddress & IPAddress::operator= ( std::string  str_addr  ) 

Set the address using a string (eg 255.255.255.255).

IPAddress::operator unsigned int (  ) 

Return the IP address as an integer.

IPAddress::operator in_addr (  ) 

Return the IP address as a POSIX in_addr struct.

IPAddress::operator std::string (  ) 

Return the IP address as a string (eg 255.255.255.255).

bool IPAddress::operator== ( const IPAddress other  ) 


Member Data Documentation

uint32_t IPAddress::address [protected]

Integer version of the IP address.


The documentation for this class was generated from the following files:

Generated on Sun Apr 5 20:28:23 2009 for EOServ by  doxygen 1.5.7.1