Represents the scope identifier for an IPv6 address.
More...
#include <ipv6-address.hpp>
|
constexpr inline | scope (const fixed_string< IPADDRESS_IPV6_SCOPE_MAX_LENGTH > &scope_id) noexcept |
| Constructs a scope object with a given scope identifier.
|
|
inline std::string | get_string () const |
| Retrieves the scope identifier as a string.
|
|
constexpr inline uint32_t | get_uint32 () const noexcept |
| Retrieves the scope identifier as a numeric value.
|
|
constexpr inline bool | has_string () const noexcept |
| Checks if the scope identifier has a string representation.
|
|
constexpr inline bool | has_uint32 () const noexcept |
| Checks if the scope identifier has a numeric representation.
|
|
constexpr inline | operator bool () const noexcept |
| Converts the scope object to a boolean value based on the presence of a scope representation.
|
|
inline | operator std::string () const |
| Converts the scope object to a string representation.
|
|
constexpr inline | operator uint32_t () const noexcept |
| Converts the scope object to a numeric representation.
|
|
constexpr inline bool | operator== (const scope &rhs) const noexcept |
| Compares two scope objects for equality.
|
|
constexpr inline bool | operator!= (const scope &rhs) const noexcept |
| Compares two scope objects for inequality.
|
|
constexpr inline bool | operator< (const scope &rhs) const noexcept |
| Checks if one scope object is less than another.
|
|
constexpr inline bool | operator> (const scope &rhs) const noexcept |
| Checks if one scope object is greater than another.
|
|
constexpr inline bool | operator<= (const scope &rhs) const noexcept |
| Checks if one scope object is less than or equal to another.
|
|
constexpr inline bool | operator>= (const scope &rhs) const noexcept |
| Checks if one scope object is greater than or equal to another.
|
|
Represents the scope identifier for an IPv6 address.
The scope identifier is used to distinguish between different zones for the same address, such as link-local or site-local scopes. This class provides methods to set, retrieve, and compare scope identifiers in both string and numeric formats.
◆ scope()
Constructs a scope object with a given scope identifier.
- Parameters
-
[in] | scope_id | A fixed_string representing the scope identifier. |
◆ get_string()
inline std::string get_string |
( |
| ) |
const |
|
inlinenodiscard |
Retrieves the scope identifier as a string.
- Returns
- A
std::string
representing the scope identifier.
◆ get_uint32()
inline uint32_t get_uint32 |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Retrieves the scope identifier as a numeric value.
- Returns
- A uint32_t representing the numeric value of the scope identifier.
◆ has_string()
inline bool has_string |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Checks if the scope identifier has a string representation.
- Returns
true
if a string representation exists, false
otherwise.
◆ has_uint32()
inline bool has_uint32 |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Checks if the scope identifier has a numeric representation.
- Returns
true
if a numeric representation exists, false
otherwise.
◆ operator bool()
inline operator bool |
( |
| ) |
const |
|
inlineexplicitnodiscardnoexcept |
Converts the scope object to a boolean value based on the presence of a scope representation.
- Returns
true
if a scope exists, false
otherwise.
◆ operator std::string()
inline operator std::string |
( |
| ) |
const |
|
inlinenodiscard |
Converts the scope object to a string representation.
- Returns
- A std::string representing the scope identifier.
◆ operator uint32_t()
inline operator uint32_t |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Converts the scope object to a numeric representation.
- Returns
- A uint32_t representing the numeric value of the scope identifier.
◆ operator==()
inline bool operator== |
( |
const scope & | rhs | ) |
const |
|
inlinenodiscardnoexcept |
Compares two scope objects for equality.
- Parameters
-
[in] | rhs | The right-hand side scope object for comparison. |
- Returns
true
if both scope objects are equal, false
otherwise.
◆ operator!=()
inline bool operator!= |
( |
const scope & | rhs | ) |
const |
|
inlinenodiscardnoexcept |
Compares two scope objects for inequality.
- Parameters
-
[in] | rhs | The right-hand side scope object for comparison. |
- Returns
true
if both scope objects are not equal, false
otherwise.
◆ operator<()
inline bool operator< |
( |
const scope & | rhs | ) |
const |
|
inlinenodiscardnoexcept |
Checks if one scope object is less than another.
- Parameters
-
[in] | rhs | The right-hand side scope object for comparison. |
- Returns
true
if the left-hand side scope object is less than the right-hand side, false
otherwise.
◆ operator>()
inline bool operator> |
( |
const scope & | rhs | ) |
const |
|
inlinenodiscardnoexcept |
Checks if one scope object is greater than another.
- Parameters
-
[in] | rhs | The right-hand side scope object for comparison. |
- Returns
true
if the left-hand side scope object is greater than the right-hand side, false
otherwise.
◆ operator<=()
inline bool operator<= |
( |
const scope & | rhs | ) |
const |
|
inlinenodiscardnoexcept |
Checks if one scope object is less than or equal to another.
- Parameters
-
[in] | rhs | The right-hand side scope object for comparison. |
- Returns
true
if the left-hand side scope object is less than or equal to the right-hand side, false
otherwise.
◆ operator>=()
inline bool operator>= |
( |
const scope & | rhs | ) |
const |
|
inlinenodiscardnoexcept |
Checks if one scope object is greater than or equal to another.
- Parameters
-
[in] | rhs | The right-hand side scope object for comparison. |
- Returns
true
if the left-hand side scope object is greater than or equal to the right-hand side, false
otherwise.
The documentation for this class was generated from the following file: