TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

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

+ Here is the caller graph for this function:

template<size_t T>
void ByteConverter::convert ( char *  val)
inline
33  {
34  std::swap(*val, *(val + T - 1));
35  convert<T - 2>(val + 1);
36  }
void convert(char *val)
Definition: ByteConverter.h:32
template<>
void ByteConverter::convert< 0 > ( char *  )
inline
38 { }
template<>
void ByteConverter::convert< 1 > ( char *  )
inline
39 { } // ignore central byte