xentara-utils v2.0.4
The Xentara Utility Library
Loading...
Searching...
No Matches
xentara::utils::tools::byteSwap Namespace Reference

Functions

template<typename Value >
requires std::is_trivial_v<Value>
auto swap (Value value) -> Value
 Swaps the bytes of a value.
 
template<std::endian kEndian, typename Value >
requires std::is_trivial_v<Value>
auto convert (Value value) -> Value
 Converts a value to a certain endianness.
 

Function Documentation

◆ convert()

template<std::endian kEndian, typename Value >
requires std::is_trivial_v<Value>
auto xentara::utils::tools::byteSwap::convert ( Value  value) -> Value

Converts a value to a certain endianness.

Parameters
valuethe value
Returns
The value swapped to the correct endianness

◆ swap()

template<typename Value >
requires std::is_trivial_v<Value>
auto xentara::utils::tools::byteSwap::swap ( Value  value) -> Value

Swaps the bytes of a value.

Parameters
valuethe value
Returns
The value, with bytes swapped