31 lines
678 B
C++
31 lines
678 B
C++
#ifndef ENDIANUTILS_HPP
|
|
#define ENDIANUTILS_HPP
|
|
|
|
class EndianUtils{
|
|
|
|
private:
|
|
|
|
EndianUtils();
|
|
|
|
public:
|
|
|
|
static unsigned int isLittleEndian();
|
|
|
|
static unsigned long long reverseBytes(unsigned long long arg, unsigned int dataSize);
|
|
|
|
static unsigned long long reverseBytes(unsigned long long arg);
|
|
|
|
static unsigned int reverseBytes(unsigned int arg);
|
|
|
|
static unsigned short reverseBytes(unsigned short arg);
|
|
|
|
static unsigned long long toNativeEndian(unsigned long long arg);
|
|
|
|
static unsigned int toNativeEndian(unsigned int arg);
|
|
|
|
static unsigned short toNativeEndian(unsigned short arg);
|
|
|
|
};
|
|
|
|
#endif
|