A model of an IPv4 address.
More...
#include <ipv4address.h>
|
| IPv4Address (unsigned char first, unsigned char second, unsigned char third, unsigned char fourth) |
| Constructs an IPv4Address.
|
|
| IPv4Address (unsigned long address) |
| Constructs an IPv4Address.
|
|
unsigned char | getFirst () const |
| Gets the first byte of the address.
|
|
unsigned char | getSecond () const |
| Gets the second byte of the address.
|
|
unsigned char | getThird () const |
| Gets the third byte of the address.
|
|
unsigned char | getFourth () const |
| Gets the fourth byte of the address.
|
|
unsigned long | getNetworkByteOrder () const |
| Gets the address in network byte order.
|
|
std::string | str () const |
| Gets the string representation of the address.
|
|
A model of an IPv4 address.
◆ IPv4Address() [1/2]
Nickvision::Network::IPv4Address::IPv4Address |
( |
unsigned char | first, |
|
|
unsigned char | second, |
|
|
unsigned char | third, |
|
|
unsigned char | fourth ) |
Constructs an IPv4Address.
- Parameters
-
first | The first byte of the address |
second | The second byte of the address |
third | The third byte of the address |
fourth | The fourth byte of the address |
◆ IPv4Address() [2/2]
Nickvision::Network::IPv4Address::IPv4Address |
( |
unsigned long | address | ) |
|
Constructs an IPv4Address.
- Parameters
-
address | The address as a long |
◆ getFirst()
unsigned char Nickvision::Network::IPv4Address::getFirst |
( |
| ) |
const |
Gets the first byte of the address.
- Returns
- The first byte of the address
◆ getFourth()
unsigned char Nickvision::Network::IPv4Address::getFourth |
( |
| ) |
const |
Gets the fourth byte of the address.
- Returns
- The fourth byte of the address
◆ getNetworkByteOrder()
unsigned long Nickvision::Network::IPv4Address::getNetworkByteOrder |
( |
| ) |
const |
Gets the address in network byte order.
- Returns
- The address in network byte order
◆ getSecond()
unsigned char Nickvision::Network::IPv4Address::getSecond |
( |
| ) |
const |
Gets the second byte of the address.
- Returns
- The second byte of the address
◆ getThird()
unsigned char Nickvision::Network::IPv4Address::getThird |
( |
| ) |
const |
Gets the third byte of the address.
- Returns
- The third byte of the address
◆ parse()
static std::optional< IPv4Address > Nickvision::Network::IPv4Address::parse |
( |
const std::string & | address | ) |
|
|
static |
Parses an IPv4Address from a string.
- Parameters
-
address | The string address to parse |
- Returns
- The parsed address if successful, else std::nullopt
◆ str()
std::string Nickvision::Network::IPv4Address::str |
( |
| ) |
const |
Gets the string representation of the address.
- Returns
- The string representation of the address
The documentation for this class was generated from the following file: