Public Types | Public Member Functions | Public Attributes

CxUtils::IP4Address Class Reference

Simple IPv4 Network Address structure. More...

#include <ip4address.h>

Inheritance diagram for CxUtils::IP4Address:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::set< IP4AddressSet
typedef std::vector< IP4AddressList
typedef std::list< IP4AddressQueue

Public Member Functions

 IP4Address ()
 Constructor.
 IP4Address (const char *ipAddress)
 Creates from IPv4 Address string.
 IP4Address (const std::string &ipAddress)
 Creates from IPv4 Address string.
 IP4Address (const IP4Address &ipAddress)
 Copy Constructor.
 ~IP4Address ()
 Destructor.
bool SetAddress (const std::string &ipAddress)
 Sets the IP address string and octect data from an IP address string.
bool SetAddress (const unsigned char a, const unsigned char b, const unsigned char c, const unsigned char d)
 Sets the IP address values "a.b.c.d".
IP4Addressoperator= (const IP4Address &ipAddress)
 Sets equal to.
IP4Addressoperator= (const std::string &ipAddress)
 Sets equal to.
bool operator== (const IP4Address &ipAddress) const
 True if equal.
bool operator!= (const IP4Address &ipAddress) const
 True if not equal.
bool operator< (const IP4Address &ipAddress) const
 Compares the IP address for sorting.
bool operator<= (const IP4Address &ipAddress) const
 Compares the IP address for sorting.
virtual void Clear ()
 Clears data.

Public Attributes

std::string mString
unsigned char mData [4]

Detailed Description

Simple IPv4 Network Address structure.

Definition at line 54 of file ip4address.h.


Member Typedef Documentation

typedef std::vector<IP4Address> CxUtils::IP4Address::List

Definition at line 58 of file ip4address.h.

Definition at line 59 of file ip4address.h.

Definition at line 57 of file ip4address.h.


Constructor & Destructor Documentation

IP4Address::IP4Address (  )

Constructor.

Definition at line 51 of file ip4address.cpp.

IP4Address::IP4Address ( const char *  ipAddress )

Creates from IPv4 Address string.

Definition at line 63 of file ip4address.cpp.

IP4Address::IP4Address ( const std::string &  ipAddress )

Creates from IPv4 Address string.

Definition at line 74 of file ip4address.cpp.

IP4Address::IP4Address ( const IP4Address ipAddress )

Copy Constructor.

Definition at line 85 of file ip4address.cpp.

IP4Address::~IP4Address (  )

Destructor.

Definition at line 97 of file ip4address.cpp.


Member Function Documentation

void IP4Address::Clear (  ) [virtual]

Clears data.

Implements CxUtils::IPAddress.

Definition at line 262 of file ip4address.cpp.

bool IP4Address::operator!= ( const IP4Address ipAddress ) const

True if not equal.

Definition at line 247 of file ip4address.cpp.

bool IP4Address::operator< ( const IP4Address ipAddress ) const

Compares the IP address for sorting.

Definition at line 211 of file ip4address.cpp.

bool IP4Address::operator<= ( const IP4Address ipAddress ) const

Compares the IP address for sorting.

Definition at line 222 of file ip4address.cpp.

IP4Address & IP4Address::operator= ( const std::string &  ipAddress )

Sets equal to.

Definition at line 200 of file ip4address.cpp.

IP4Address & IP4Address::operator= ( const IP4Address ipAddress )

Sets equal to.

Definition at line 188 of file ip4address.cpp.

bool IP4Address::operator== ( const IP4Address ipAddress ) const

True if equal.

Definition at line 233 of file ip4address.cpp.

bool IP4Address::SetAddress ( const std::string &  ipAddress )

Sets the IP address string and octect data from an IP address string.

Parameters:
[in]ipAddressIP Address data "127.0.0.1", "132.170.190.84", etc.
Returns:
True on success, false on failure.

Definition at line 112 of file ip4address.cpp.

bool IP4Address::SetAddress ( const unsigned char  a,
const unsigned char  b,
const unsigned char  c,
const unsigned char  d 
)

Sets the IP address values "a.b.c.d".

Parameters:
[in]aPart of IP address.
[in]bPart of IP address.
[in]cPart of IP address.
[in]dPart of IP address.
Returns:
True on success, false on failure.

Definition at line 167 of file ip4address.cpp.


Member Data Documentation

unsigned char CxUtils::IP4Address::mData[4]

Definition at line 79 of file ip4address.h.

Definition at line 78 of file ip4address.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines