19#if defined(__BIG_ENDIAN__)
21#elif defined(__LITTLE_ENDIAN__)
36template <
typename type>
65template <
typename storage_type>
72template <
typename storage_type, ByteOrder src, ByteOrder dst>
80template <
typename storage_type, ByteOrder
byte_order>
88template <
typename storage_type, ByteOrder src, ByteOrder dst>
96template <
typename storage_type>
103template <
typename storage_type, ByteOrder dst>
105 return byte_order::Convert<storage_type, kNativeEndian, dst>(
in);
110template <
typename storage_type, ByteOrder src>
112 return byte_order::Convert<storage_type, src, kNativeEndian>(
in);
117template <
typename storage_type>
119 return byte_order::Convert<storage_type, kNativeEndian, kBigEndian>(
in);
124template <
typename storage_type>
126 return byte_order::Convert<storage_type, kNativeEndian, kLittleEndian>(
in);
131template <
typename storage_type>
133 return byte_order::Convert<storage_type, kBigEndian, kNativeEndian>(
in);
138template <
typename storage_type>
140 return byte_order::Convert<storage_type, kLittleEndian, kNativeEndian>(
in);
Convert Endianness of shorts, longs, long longs, regardless of architecture/OS.
static uint32_t bswap32(uint32_t x)
static uint64_t bswap64(uint64_t x)
static uint16_t bswap16(uint16_t x)
constexpr storage_type Convert(storage_type in)
constexpr storage_type Swap(storage_type in)
constexpr storage_type bswap(storage_type in)
constexpr storage_type htole(storage_type in)
roo::basic_string_view< CharT, Traits > basic_string_view
constexpr storage_type toh(storage_type in)
constexpr storage_type hto(storage_type in)
constexpr storage_type htobe(storage_type in)
constexpr storage_type betoh(storage_type in)
constexpr storage_type letoh(storage_type in)
constexpr storage_type operator()(storage_type in) const
constexpr storage_type operator()(storage_type in) const
constexpr uint16_t operator()(uint16_t in) const
constexpr uint32_t operator()(uint32_t in) const
constexpr uint64_t operator()(uint64_t in) const
constexpr uint8_t operator()(uint8_t in) const