Corrade::Utility::Endianness class

Endianness related functions.

Contents

Public static functions

template<class T>
static auto swap(T value) -> T
Endian-swap bytes of given value.
static auto isBigEndian() -> bool constexpr
Whether actual system is Big-Endian.
template<class T>
static auto bigEndian(T value) -> T
Convert number from or to Big-Endian.
template<class... T>
static void bigEndianInPlace(T&... values)
Convert values from or to Big-Endian in-place.
template<class T>
static auto littleEndian(T number) -> T
Convert value from or to Little-Endian.
template<class... T>
static void littleEndianInPlace(T&... values)
Convert values from or to Little-Endian in-place.

Function documentation

template<class T>
static T Corrade::Utility::Endianness::bigEndian(T value)

Convert number from or to Big-Endian.

On Little-Endian systems calls swap(), on Big-Endian systems returns unchanged value.

template<class... T>
static void Corrade::Utility::Endianness::bigEndianInPlace(T&... values)

Convert values from or to Big-Endian in-place.

Calls bigEndian() for each value and saves the result back.

template<class T>
static T Corrade::Utility::Endianness::littleEndian(T number)

Convert value from or to Little-Endian.

On Big-Endian systems calls swap(), on Little-Endian systems returns unchanged value.

template<class... T>
static void Corrade::Utility::Endianness::littleEndianInPlace(T&... values)

Convert values from or to Little-Endian in-place.

Calls littleEndian() for each value and saves the result back.