![]() |
jsocketpp 1.0
A cross-platform C++20 socket library.
|
Endianness utilities for network byte order conversion. More...
Functions | |
uint16_t | toNetwork (const uint16_t val) |
Converts a 16-bit unsigned integer from host to network byte order. | |
uint32_t | toNetwork (const uint32_t val) |
Converts a 32-bit unsigned integer from host to network byte order. | |
uint16_t | fromNetwork (const uint16_t val) |
Converts a 16-bit unsigned integer from network to host byte order. | |
uint32_t | fromNetwork (const uint32_t val) |
Converts a 32-bit unsigned integer from network to host byte order. |
Endianness utilities for network byte order conversion.
The jsocketpp::net namespace provides a collection of lightweight, header-only functions for safely converting between host and network byte order for integral types.
These functions are wrappers over platform-native byte order macros:
|
inline |
Converts a 16-bit unsigned integer from network to host byte order.
|
inline |
Converts a 32-bit unsigned integer from network to host byte order.
|
inline |
Converts a 16-bit unsigned integer from host to network byte order.
|
inline |
Converts a 32-bit unsigned integer from host to network byte order.