core/memory/endianness.hpp file

Endianness utility functions.

Namespaces

namespace cubos
Cubos libraries namespace.
namespace cubos::core
Core namespace.
namespace cubos::core::memory
Memory module.

Functions

template<typename T>
auto swapBytes(T value) -> T
Swaps the bytes of a value, changing its endianness.
auto isLittleEndian() -> bool
Checks if the current platform is little endian.
template<typename T>
auto fromLittleEndian(T value) -> T
Converts a value from little endianness to local endianness.
template<typename T>
auto toLittleEndian(T value) -> T
Converts a value from local endianness to little endianness.
template<typename T>
auto fromBigEndian(T value) -> T
Converts a value from big endianness to local endianness.
template<typename T>
auto toBigEndian(T value) -> T
Converts a value from local endianness to big endianness.