20 #ifndef _ANCH_UTILS_ENDIANNESS_H_ 21 #define _ANCH_UTILS_ENDIANNESS_H_ 40 const uint8_t* words =
reinterpret_cast<const uint8_t*
>(&src);
41 std::size_t size =
sizeof(T);
42 for(std::size_t i = 0 ; i < size ; i++) {
43 dest[i] = words[size - 1 - i];
57 const uint32_t byteOrderTest = 0x01;
58 return (reinterpret_cast<const uint8_t*>(&byteOrderTest)[0] == 0);
76 #endif // _ANCH_UTILS_ENDIANNESS_H_ AnCH framework base namespace.
Definition: base64.hpp:28
void byteSwap(T src, uint8_t *dest)
Definition: endianness.hpp:39
bool isBigEndian()
Definition: endianness.hpp:56
bool isLittleEndian()
Definition: endianness.hpp:70