#include <IPAddress.hpp>
Public Member Functions | |
sfIPAddress () | |
Default constructor. | |
sfIPAddress (const std::string &Address) | |
Construct the address from a string. | |
sfIPAddress (sfUint8 Byte0, sfUint8 Byte1, sfUint8 Byte2, sfUint8 Byte3) | |
Construct the address from 4 bytes. | |
bool | IsValid () const |
Tell if the address is a valid one. | |
std::string | ToString () const |
Get a string representation of the address. | |
bool | operator== (const sfIPAddress &Other) const |
Comparison operator ==. | |
bool | operator!= (const sfIPAddress &Other) const |
Comparison operator !=. | |
bool | operator< (const sfIPAddress &Other) const |
Comparison operator <. | |
bool | operator> (const sfIPAddress &Other) const |
Comparison operator >. | |
bool | operator<= (const sfIPAddress &Other) const |
Comparison operator <=. | |
bool | operator>= (const sfIPAddress &Other) const |
Comparison operator >=. | |
Static Public Member Functions | |
static sfIPAddress | GetLocalAddress () |
Get the computer's local IP address (from the LAN point of view). | |
static sfIPAddress | GetPublicAddress () |
Get the computer's public IP address (from the web point of view). | |
Static Public Attributes | |
static const sfIPAddress | LocalHost |
Local host address (to connect to the same computer). |
Definition at line 40 of file IPAddress.hpp.
sfIPAddress::sfIPAddress | ( | ) |
sfIPAddress::sfIPAddress | ( | const std::string & | Address | ) |
Construct the address from a string.
Address | : IP address ("xxx.xxx.xxx.xxx") or network name |
Definition at line 51 of file IPAddress.cpp.
sfIPAddress::sfIPAddress | ( | sfUint8 | Byte0, | |
sfUint8 | Byte1, | |||
sfUint8 | Byte2, | |||
sfUint8 | Byte3 | |||
) |
Construct the address from 4 bytes.
Byte0 | : First byte of the address | |
Byte1 | : Second byte of the address | |
Byte2 | : Third byte of the address | |
Byte3 | : Fourth byte of the address |
Definition at line 77 of file IPAddress.cpp.
bool sfIPAddress::IsValid | ( | ) | const |
Tell if the address is a valid one.
Definition at line 86 of file IPAddress.cpp.
std::string sfIPAddress::ToString | ( | ) | const |
Get a string representation of the address.
Definition at line 95 of file IPAddress.cpp.
sfIPAddress sfIPAddress::GetLocalAddress | ( | ) | [static] |
Get the computer's local IP address (from the LAN point of view).
Definition at line 107 of file IPAddress.cpp.
sfIPAddress sfIPAddress::GetPublicAddress | ( | ) | [static] |
Get the computer's public IP address (from the web point of view).
The only way to get a public address is to ask it to a distant website ; as a consequence, this function may be very slow -- use it as few as possible !
Definition at line 155 of file IPAddress.cpp.
bool sfIPAddress::operator== | ( | const sfIPAddress & | Other | ) | const |
Comparison operator ==.
Other | : Address to compare |
Definition at line 224 of file IPAddress.cpp.
bool sfIPAddress::operator!= | ( | const sfIPAddress & | Other | ) | const |
Comparison operator !=.
Other | : Address to compare |
Definition at line 233 of file IPAddress.cpp.
bool sfIPAddress::operator< | ( | const sfIPAddress & | Other | ) | const |
Comparison operator <.
Other | : Address to compare |
Definition at line 242 of file IPAddress.cpp.
bool sfIPAddress::operator> | ( | const sfIPAddress & | Other | ) | const |
Comparison operator >.
Other | : Address to compare |
Definition at line 251 of file IPAddress.cpp.
bool sfIPAddress::operator<= | ( | const sfIPAddress & | Other | ) | const |
Comparison operator <=.
Other | : Address to compare |
Definition at line 260 of file IPAddress.cpp.
bool sfIPAddress::operator>= | ( | const sfIPAddress & | Other | ) | const |
Comparison operator >=.
Other | : Address to compare |
Definition at line 269 of file IPAddress.cpp.
const sfIPAddress sfIPAddress::LocalHost [static] |