Toolbox snapshot
The Reactive C++ Toolbox
|
Functions | |
template<std::endian Native = std::endian::native> | |
constexpr std::uint16_t | get_length (const char *buf, std::endian net_byte_order) noexcept |
template<std::endian Native = std::endian::native> | |
void | put_length (char *buf, std::uint16_t len, std::endian net_byte_order) noexcept |
|
constexprnoexcept |
Reads a binary-encoded 2 byte integer from the input buffer. N.B. the Native template parameter is provided for testability.
Native | Endianness of native/target platform. |
buf | The input buffer, which must be at least 2 bytes in length. |
net_byte_order | Endianness used for network byte order decoding. |
|
inlinenoexcept |
Writes a binary-encoded 2 byte integer to the output buffer. N.B. the Native template parameter is provided for testability.
Native | Endianness of native/target platform. |
buf | The output buffer, which must be at least 2 bytes in length. |
len | The length to be encoded. |
net_byte_order | Endianness used for network byte order decoding. |