AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ByteConverter Namespace Reference

Functions

template<size_t T>
void convert (char *val)
 
template<>
void convert< 0 > (char *)
 
template<>
void convert< 1 > (char *)
 
template<typename T >
void apply (T *val)
 

Detailed Description

ByteConverter reverse your byte order. This is use for cross platform where they have different endians.

Function Documentation

◆ apply()

template<typename T >
void ByteConverter::apply ( T *  val)
inline
41 {
42 convert<sizeof(T)>((char*)(val));
43 }

◆ convert()

template<size_t T>
void ByteConverter::convert ( char *  val)
inline
32 {
33 std::swap(*val, *(val + T - 1));
34 convert < T - 2 > (val + 1);
35 }
void convert(char *val)
Definition: ByteConverter.h:31

References convert().

Referenced by convert().

◆ convert< 0 >()

template<>
void ByteConverter::convert< 0 > ( char *  )
inline
37{ }

◆ convert< 1 >()

template<>
void ByteConverter::convert< 1 > ( char *  )
inline
38{ } // ignore central byte