sptk2 logo
SPTK Home Page
Public Member Functions | Static Public Member Functions | List of all members
sptk::IPAddress Class Reference

IPv4 and IPv6 address presentation. More...

#include <IPAddress.h>

Public Member Functions

 IPAddress ()
 Default constructor.
 
 IPAddress (const sockaddr &address)
 Constructor. More...
 
 IPAddress (const IPAddress &other)
 Copy constructor. More...
 
IPAddressoperator= (const IPAddress &other)
 Assignment. More...
 
const sockaddr * address () const
 Get address data.
 
size_t length () const
 
const StringtoString () const
 

Static Public Member Functions

static size_t addressLength (const sockaddr &address)
 

Detailed Description

IPv4 and IPv6 address presentation.

Constructor & Destructor Documentation

◆ IPAddress() [1/2]

sptk::IPAddress::IPAddress ( const sockaddr &  address)
explicit

Constructor.

Parameters
addressconst sockaddr&, IPv4 address

◆ IPAddress() [2/2]

sptk::IPAddress::IPAddress ( const IPAddress other)

Copy constructor.

Parameters
otherconst IPAddress&, Other address

Member Function Documentation

◆ addressLength()

static size_t sptk::IPAddress::addressLength ( const sockaddr &  address)
inlinestatic

Return length of actual address

Parameters
addressconst sockaddr&, Address data
Returns
length of actual address

◆ length()

size_t sptk::IPAddress::length ( ) const
inline

Return length of address

Returns
length of address

◆ operator=()

IPAddress & sptk::IPAddress::operator= ( const IPAddress other)

Assignment.

Parameters
otherconst IPAddress&, Other address

◆ toString()

const String & sptk::IPAddress::toString ( ) const
inline

Return IP address as a string

Returns
string presentation of IP address

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

Fri Oct 14 2022 09:58:43: SPTK 5.4.1