MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::IPv4 Struct Reference

Represents an IP version 4 address (32 bits) Can be converted to an IPv6. More...

#include <ip.hpp>

Public Member Functions

Result< void, IpInitErrorinit (const Slice< const char > &str)
 
Result< void, IpInitErrorinit (const Slice< char > &str)
 
Result< void, IpInitErrorinit (const std::string_view &str)
 
Result< void, IpInitErrorinit (const std::string &str)
 
IPv6 to_v6 () const noexcept
 
std::strong_ordering operator<=> (const IPv4 &o) const noexcept
 
bool operator== (const IPv4 &o) const noexcept
 
bool operator!= (const IPv4 &o) const noexcept
 
bool operator<= (const IPv4 &o) const noexcept
 
bool operator>= (const IPv4 &o) const noexcept
 
bool operator< (const IPv4 &o) const noexcept
 
bool operator> (const IPv4 &o) const noexcept
 

Public Attributes

u32 bits = 0
 

Detailed Description

Represents an IP version 4 address (32 bits) Can be converted to an IPv6.

Definition at line 59 of file ip.hpp.

Member Function Documentation

◆ init() [1/4]

Result< void, IpInitError > mtcore::IPv4::init ( const Slice< char > & str)
nodiscard

◆ init() [2/4]

Result< void, IpInitError > mtcore::IPv4::init ( const Slice< const char > & str)
nodiscard

◆ init() [3/4]

Result< void, IpInitError > mtcore::IPv4::init ( const std::string & str)
nodiscard

◆ init() [4/4]

Result< void, IpInitError > mtcore::IPv4::init ( const std::string_view & str)
nodiscard

◆ operator!=()

bool mtcore::IPv4::operator!= ( const IPv4 & o) const
inlinenodiscardnoexcept

Definition at line 71 of file ip.hpp.

71{ return (*this <=> o) != 0; }

◆ operator<()

bool mtcore::IPv4::operator< ( const IPv4 & o) const
inlinenodiscardnoexcept

Definition at line 74 of file ip.hpp.

74{ return (*this <=> o) < 0; }

◆ operator<=()

bool mtcore::IPv4::operator<= ( const IPv4 & o) const
inlinenodiscardnoexcept

Definition at line 72 of file ip.hpp.

72{ return (*this <=> o) <= 0; }

◆ operator<=>()

std::strong_ordering mtcore::IPv4::operator<=> ( const IPv4 & o) const
inlinenodiscardnoexcept

Definition at line 69 of file ip.hpp.

69{ return bits <=> o.bits; }
u32 bits
Definition ip.hpp:60

◆ operator==()

bool mtcore::IPv4::operator== ( const IPv4 & o) const
inlinenodiscardnoexcept

Definition at line 70 of file ip.hpp.

70{ return (*this <=> o) == 0; }

◆ operator>()

bool mtcore::IPv4::operator> ( const IPv4 & o) const
inlinenodiscardnoexcept

Definition at line 75 of file ip.hpp.

75{ return (*this <=> o) > 0; }

◆ operator>=()

bool mtcore::IPv4::operator>= ( const IPv4 & o) const
inlinenodiscardnoexcept

Definition at line 73 of file ip.hpp.

73{ return (*this <=> o) >= 0; }

◆ to_v6()

IPv6 mtcore::IPv4::to_v6 ( ) const
nodiscardnoexcept

Member Data Documentation

◆ bits

u32 mtcore::IPv4::bits = 0

Definition at line 60 of file ip.hpp.


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