ipaddress 1.1.0
Loading...
Searching...
No Matches
scope Class Referencefinal

Represents the scope identifier for an IPv6 address. More...

#include <ipv6-address.hpp>

Public Member Functions

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ scope()

constexpr inline scope ( const fixed_string< IPADDRESS_IPV6_SCOPE_MAX_LENGTH > & scope_id)
inlinenoexcept

Constructs a scope object with a given scope identifier.

Parameters
[in]scope_idA fixed_string representing the scope identifier.

Member Function Documentation

◆ get_string()

inline std::string get_string ( ) const
inline

Retrieves the scope identifier as a string.

Returns
A std::string representing the scope identifier.

◆ get_uint32()

constexpr inline uint32_t get_uint32 ( ) const
inlinenoexcept

Retrieves the scope identifier as a numeric value.

Returns
A uint32_t representing the numeric value of the scope identifier.

◆ has_string()

constexpr inline bool has_string ( ) const
inlinenoexcept

Checks if the scope identifier has a string representation.

Returns
true if a string representation exists, false otherwise.

◆ has_uint32()

constexpr inline bool has_uint32 ( ) const
inlinenoexcept

Checks if the scope identifier has a numeric representation.

Returns
true if a numeric representation exists, false otherwise.

◆ operator bool()

constexpr inline operator bool ( ) const
inlineexplicitnoexcept

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
inline

Converts the scope object to a string representation.

Returns
A std::string representing the scope identifier.

◆ operator uint32_t()

constexpr inline operator uint32_t ( ) const
inlinenoexcept

Converts the scope object to a numeric representation.

Returns
A uint32_t representing the numeric value of the scope identifier.

◆ operator==()

constexpr inline bool operator== ( const scope & rhs) const
inlinenoexcept

Compares two scope objects for equality.

Parameters
[in]rhsThe right-hand side scope object for comparison.
Returns
true if both scope objects are equal, false otherwise.

◆ operator!=()

constexpr inline bool operator!= ( const scope & rhs) const
inlinenoexcept

Compares two scope objects for inequality.

Parameters
[in]rhsThe right-hand side scope object for comparison.
Returns
true if both scope objects are not equal, false otherwise.

◆ operator<()

constexpr inline bool operator< ( const scope & rhs) const
inlinenoexcept

Checks if one scope object is less than another.

Parameters
[in]rhsThe 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>()

constexpr inline bool operator> ( const scope & rhs) const
inlinenoexcept

Checks if one scope object is greater than another.

Parameters
[in]rhsThe 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<=()

constexpr inline bool operator<= ( const scope & rhs) const
inlinenoexcept

Checks if one scope object is less than or equal to another.

Parameters
[in]rhsThe 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>=()

constexpr inline bool operator>= ( const scope & rhs) const
inlinenoexcept

Checks if one scope object is greater than or equal to another.

Parameters
[in]rhsThe 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: