A model of an IPv4 address.  
 More...
#include <ipv4address.h>
 | 
|   | IPv4Address (unsigned char first, unsigned char second, unsigned char third, unsigned char fourth) noexcept | 
|   | Constructs an IPv4Address.  
  | 
|   | IPv4Address (unsigned long address) noexcept | 
|   | Constructs an IPv4Address.  
  | 
| unsigned char  | getFirst () const noexcept | 
|   | Gets the first byte of the address.  
  | 
| unsigned char  | getSecond () const noexcept | 
|   | Gets the second byte of the address.  
  | 
| unsigned char  | getThird () const noexcept | 
|   | Gets the third byte of the address.  
  | 
| unsigned char  | getFourth () const noexcept | 
|   | Gets the fourth byte of the address.  
  | 
| unsigned long  | getNetworkByteOrder () const noexcept | 
|   | Gets the address in network byte order.  
  | 
| std::string  | str () const noexcept | 
|   | 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 ) | 
         
       
   | 
  
noexcept   | 
  
 
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 | ) | 
           | 
         
       
   | 
  
noexcept   | 
  
 
Constructs an IPv4Address. 
- Parameters
 - 
  
    | address | The address as a long  | 
  
   
 
 
◆ getFirst()
  
  
      
        
          | unsigned char Nickvision::Network::IPv4Address::getFirst  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
noexcept   | 
  
 
Gets the first byte of the address. 
- Returns
 - The first byte of the address 
 
 
 
◆ getFourth()
  
  
      
        
          | unsigned char Nickvision::Network::IPv4Address::getFourth  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
noexcept   | 
  
 
Gets the fourth byte of the address. 
- Returns
 - The fourth byte of the address 
 
 
 
◆ getNetworkByteOrder()
  
  
      
        
          | unsigned long Nickvision::Network::IPv4Address::getNetworkByteOrder  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
noexcept   | 
  
 
Gets the address in network byte order. 
- Returns
 - The address in network byte order 
 
 
 
◆ getSecond()
  
  
      
        
          | unsigned char Nickvision::Network::IPv4Address::getSecond  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
noexcept   | 
  
 
Gets the second byte of the address. 
- Returns
 - The second byte of the address 
 
 
 
◆ getThird()
  
  
      
        
          | unsigned char Nickvision::Network::IPv4Address::getThird  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
noexcept   | 
  
 
Gets the third byte of the address. 
- Returns
 - The third byte of the address 
 
 
 
◆ parse()
  
  
      
        
          | std::optional< IPv4Address > Nickvision::Network::IPv4Address::parse  | 
          ( | 
          const std::string & |           address | ) | 
           | 
         
       
   | 
  
staticnoexcept   | 
  
 
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 | 
         
       
   | 
  
noexcept   | 
  
 
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: