rcolyer.net
RC Lib  Version 202403231100
Static Public Member Functions | List of all members
RC::Endian Class Reference

Auto-detects the endianness of the compilation target, and provides automatic endian conversion features. More...

#include <Types.h>

Static Public Member Functions

static u16 Swap (u16 x)
 Reverse the byte order.
 
static u32 Swap (u32 x)
 Reverse the byte order.
 
static u64 Swap (u64 x)
 Reverse the byte order.
 
static u8 Swap (u8 x)
 Do nothing. (For consistency.)
 
static i8 Swap (i8 x)
 Do nothing. (For consistency.)
 
static i16 Swap (i16 x)
 Reverse the byte order.
 
static i32 Swap (i32 x)
 Reverse the byte order.
 
static i64 Swap (i64 x)
 Reverse the byte order.
 
template<class T >
static T ToLittle (const T &x)
 Converts x to little-endian.
 
template<class T >
static T FromLittle (const T &x)
 Converts x from little-endian.
 
template<class T >
static T ToBig (const T &x)
 Converts x to big-endian.
 
template<class T >
static T FromBig (const T &x)
 Converts x from big-endian.
 
static bool IsLittle ()
 True if this system is little-endian.
 
static bool IsBig ()
 True if this system is big-endian.
 

Detailed Description

Auto-detects the endianness of the compilation target, and provides automatic endian conversion features.


The documentation for this class was generated from the following file:
email address
— (c) 2015