HEBI C++ API  3.9.0
hebi::IpAddress Class Referencefinal

A simple wrapper class for IpAddress objects. More...

#include <ip_address.hpp>

Public Member Functions

 IpAddress ()=default
 Creates IPv4 address 0.0.0.0. More...
 
 IpAddress (uint32_t address_raw)
 
bool setToString (const std::string &ip_str)
 Sets the value of the current IpAddress to the value given in 'ip_str'. More...
 
std::string toString () const
 Returns a string representation of the IP address. More...
 
uint32_t getLittleEndian () const
 Returns the IP Address as a little endian uint32_t. More...
 
uint32_t getBigEndian () const
 Returns the IP Address as a big endian (network order) uint32_t. More...
 

Static Public Member Functions

static IpAddress fromBytes (uint8_t a, uint8_t b, uint8_t c, uint8_t d)
 Creates an IpAddress from individual bytes. More...
 
static IpAddress fromLittleEndian (uint32_t raw)
 Creates an IpAddress from a little endian uint32_t. More...
 

Detailed Description

A simple wrapper class for IpAddress objects.

Constructor & Destructor Documentation

◆ IpAddress() [1/2]

hebi::IpAddress::IpAddress ( )
default

Creates IPv4 address 0.0.0.0.

◆ IpAddress() [2/2]

hebi::IpAddress::IpAddress ( uint32_t  address_raw)
inline

Member Function Documentation

◆ fromBytes()

static IpAddress hebi::IpAddress::fromBytes ( uint8_t  a,
uint8_t  b,
uint8_t  c,
uint8_t  d 
)
inlinestatic

Creates an IpAddress from individual bytes.

◆ fromLittleEndian()

static IpAddress hebi::IpAddress::fromLittleEndian ( uint32_t  raw)
inlinestatic

Creates an IpAddress from a little endian uint32_t.

◆ setToString()

bool hebi::IpAddress::setToString ( const std::string &  ip_str)
inline

Sets the value of the current IpAddress to the value given in 'ip_str'.

This value must be a valid string of format a.b.c.d, where 'a' - 'd' are integers from 0-255.

Returns
'true' on success (valid ip_str), 'false' on failure.

◆ toString()

std::string hebi::IpAddress::toString ( ) const
inline

Returns a string representation of the IP address.

◆ getLittleEndian()

uint32_t hebi::IpAddress::getLittleEndian ( ) const
inline

Returns the IP Address as a little endian uint32_t.

◆ getBigEndian()

uint32_t hebi::IpAddress::getBigEndian ( ) const
inline

Returns the IP Address as a big endian (network order) uint32_t.


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