Representation of an IPv4 address. More...
#include <ipaddress.h>
Public Member Functions | |
| ipaddress (void) | |
| ipaddress (unsigned int o) | |
| ipaddress (int o) | |
| ipaddress (const string &o) | |
| ipaddress (const char *o) | |
| ipaddress (const ipaddress &o) | |
| ipaddress (const value &o) | |
| ~ipaddress (void) | |
| ipaddress & | operator= (const ipaddress &o) |
| ipaddress & | operator= (const value &v) |
| ipaddress & | operator= (int i) |
| ipaddress & | operator= (const char *c) |
| operator unsigned int (void) const | |
| ipaddress & | operator++ (int i) |
| ipaddress & | operator-- (int i) |
| ipaddress & | operator+= (const ipaddress &o) |
| ipaddress & | operator-= (const ipaddress &o) |
| ipaddress & | operator&= (const ipaddress &o) |
| ipaddress & | operator|= (const ipaddress &o) |
| bool | operator== (int o) const |
| bool | operator!= (int o) const |
| bool | operator== (unsigned int o) const |
| bool | operator!= (unsigned int o) const |
| bool | operator== (const value &o) const |
| bool | operator!= (const value &o) const |
| bool | operator== (const ipaddress &o) const |
| bool | operator!= (const ipaddress &o) const |
Protected Attributes | |
| unsigned int | addr |
Representation of an IPv4 address.
This class is meant to be passed-by-value. It only contains a single unsigned int and mainly acts as a convenient type- indicator when handling with ip-addresses in the context of value objects, for different encoding standards where there needs to be a choice between writing an integer (shox, SQL) or a string (XML). A plain unsigned int doesn't have those needs and it is hard to dinstinguish the two if an ipaddress where just a typedef. The constructors and operators implemented should make this a drop-in replacement for wielding sockaddr_in or unsigned ints.
| ipaddress::ipaddress | ( | void | ) | [inline] |
| ipaddress::ipaddress | ( | const char * | o | ) | [inline] |
| ipaddress::ipaddress | ( | const value & | o | ) | [inline] |
Constructor from a value.
Just calls ipval().
References addr, and value::ipval().

| ipaddress& ipaddress::operator++ | ( | int | i | ) | [inline] |
| ipaddress& ipaddress::operator-- | ( | int | i | ) | [inline] |
1.6.1