Async 1.5.0
|
A class for representing an IP address in an OS independent way. More...
#include <AsyncIpAddress.h>
Public Types | |
typedef struct in_addr | Ip4Addr |
The type for the OS specific representation of an IP address. | |
Public Member Functions | |
IpAddress (void) | |
Default constructor for the IpAddress class. | |
IpAddress (const std::string &addr) | |
Constructor for the IpAddress class. | |
IpAddress (const Ip4Addr &addr) | |
Constructor for the IpAddress class. | |
IpAddress (const IpAddress &addr) | |
Copy contructor. | |
~IpAddress (void) | |
Destructor. | |
Ip4Addr | ip4Addr (void) const |
Return the IP address in OS specific representation. | |
bool | isUnicast (void) const |
Check if this is a unicast IP address. | |
bool | isWithinSubet (const std::string &subnet) const |
Check if the IP address is within the given netmask. | |
bool | isEmpty (void) const |
Check if an invalid IP address has been assigned. | |
void | clear (void) |
Invalidate the IP address value. | |
std::string | toString (void) const |
Return the string representation of the IP address. | |
bool | setIpFromString (const std::string &str) |
Set the IP address from a string. | |
IpAddress & | operator= (const IpAddress &rhs) |
Assignment operator. | |
bool | operator== (const IpAddress &rhs) const |
Equality operator. | |
bool | operator!= (const IpAddress &rhs) const |
Unequality operator. | |
bool | operator< (const IpAddress &rhs) const |
Less than operator. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Async::IpAddress &ip) |
Output stream operator. | |
std::istream & | operator>> (std::istream &is, Async::IpAddress &ip) |
Input stream operator. | |
A class for representing an IP address in an OS independent way.
Definition at line 104 of file AsyncIpAddress.h.
The type for the OS specific representation of an IP address.
Definition at line 110 of file AsyncIpAddress.h.
Async::IpAddress::IpAddress | ( | const std::string & | addr | ) |
Constructor for the IpAddress class.
addr | The string representation of an IP address |
Constructor for the IpAddress class.
addr | The IP address in OS specific representation |
Copy contructor.
addr | An IpAddress object to construct the new object from |
Definition at line 133 of file AsyncIpAddress.h.
|
inline |
Destructor.
Definition at line 138 of file AsyncIpAddress.h.
Invalidate the IP address value.
Definition at line 172 of file AsyncIpAddress.h.
Return the IP address in OS specific representation.
Definition at line 144 of file AsyncIpAddress.h.
Check if an invalid IP address has been assigned.
Definition at line 167 of file AsyncIpAddress.h.
Check if this is a unicast IP address.
Check if the IP address is within the given netmask.
subnet | The subnet to use in the check. The subnet should be given on the form a.b.c.d/m (e.g. 192.168.1.0/24). |
Unequality operator.
rhs | Right hand side expression |
Definition at line 215 of file AsyncIpAddress.h.
Less than operator.
rhs | Right hand side expression |
Definition at line 226 of file AsyncIpAddress.h.
Assignment operator.
rhs | The address object to assign to this object |
Definition at line 192 of file AsyncIpAddress.h.
Equality operator.
rhs | Right hand side expression |
Definition at line 204 of file AsyncIpAddress.h.
Set the IP address from a string.
str | The string to parse (e.g. "192.168.0.1") |
std::string Async::IpAddress::toString | ( | void | ) | const |
Return the string representation of the IP address.
|
friend |
Output stream operator.
os | The stream to output data to |
ip | The IP address to output to the stream |
|
friend |
Input stream operator.
is | The stream to input data from |
ip | The IP address object to store information in |