sead
Loading...
Searching...
No Matches
sead::Endian Class Reference

#include <seadEndian.h>

Classes

struct  ConvFuncTable

Public Types

enum  Types { cBig = 0 , cLittle = 1 }

Static Public Member Functions

static u8 swapU8 (u8 x)
static u16 swapU16 (u16 x)
static u32 swapU32 (u32 x)
static u64 swapU64 (u64 x)
static s8 swapS8 (s8 x)
static s16 swapS16 (s16 x)
static s32 swapS32 (s32 x)
static s64 swapS64 (s64 x)
static f32 swapF32 (f32 x)
static u8 convertU8 (Types from, Types to, u8 x)
static u16 convertU16 (Types from, Types to, u16 x)
static u32 convertU32 (Types from, Types to, u32 x)
static u64 convertU64 (Types from, Types to, u64 x)
static s8 convertS8 (Types from, Types to, s8 x)
static s16 convertS16 (Types from, Types to, s16 x)
static s32 convertS32 (Types from, Types to, s32 x)
static s64 convertS64 (Types from, Types to, s64 x)
static u32 convertF32 (Types from, Types to, const void *x)
static u8 toHostU8 (Types from, u8 x)
static u16 toHostU16 (Types from, u16 x)
static u32 toHostU32 (Types from, u32 x)
static u64 toHostU64 (Types from, u64 x)
static u8 fromHostU8 (Types to, u8 x)
static u16 fromHostU16 (Types to, u16 x)
static u32 fromHostU32 (Types to, u32 x)
static u64 fromHostU64 (Types to, u64 x)
static s8 toHostS8 (Types from, s8 x)
static s16 toHostS16 (Types from, s16 x)
static s32 toHostS32 (Types from, s32 x)
static s64 toHostS64 (Types from, s64 x)
static s8 fromHostS8 (Types to, s8 x)
static s16 fromHostS16 (Types to, s16 x)
static s32 fromHostS32 (Types to, s32 x)
static s64 fromHostS64 (Types to, s64 x)
static f32 toHostF32 (Types from, const u32 *x)
static u32 fromHostF32 (Types to, const f32 *x)
static Types getHostEndian ()
static Types markToEndian (u16 mark)
static u16 endianToMark (Types endian)

Private Types

typedef u8(* CONV8FUNC) (u8)
typedef u16(* CONV16FUNC) (u16)
typedef u32(* CONV32FUNC) (u32)
typedef u64(* CONV64FUNC) (u64)

Static Private Attributes

static const Types cHostEndian = Endian::markToEndian(0xfeff)
static const ConvFuncTable cConvFuncTable = { &Null8, &Swap8, &Null16, &Swap16, &Null32, &Swap32, &Null64, &Swap64 }

Member Typedef Documentation

◆ CONV8FUNC

typedef u8(* sead::Endian::CONV8FUNC) (u8)
private

◆ CONV16FUNC

typedef u16(* sead::Endian::CONV16FUNC) (u16)
private

◆ CONV32FUNC

typedef u32(* sead::Endian::CONV32FUNC) (u32)
private

◆ CONV64FUNC

typedef u64(* sead::Endian::CONV64FUNC) (u64)
private

Member Enumeration Documentation

◆ Types

Enumerator
cBig 
cLittle 

Member Function Documentation

◆ swapU8()

u8 sead::Endian::swapU8 ( u8 x)
inlinestatic

◆ swapU16()

u16 sead::Endian::swapU16 ( u16 x)
inlinestatic

◆ swapU32()

u32 sead::Endian::swapU32 ( u32 x)
inlinestatic

◆ swapU64()

u64 sead::Endian::swapU64 ( u64 x)
inlinestatic

◆ swapS8()

s8 sead::Endian::swapS8 ( s8 x)
inlinestatic

◆ swapS16()

s16 sead::Endian::swapS16 ( s16 x)
inlinestatic

◆ swapS32()

s32 sead::Endian::swapS32 ( s32 x)
inlinestatic

◆ swapS64()

s64 sead::Endian::swapS64 ( s64 x)
inlinestatic

◆ swapF32()

f32 sead::Endian::swapF32 ( f32 x)
inlinestatic

◆ convertU8()

u8 sead::Endian::convertU8 ( Types from,
Types to,
u8 x )
inlinestatic

◆ convertU16()

u16 sead::Endian::convertU16 ( Types from,
Types to,
u16 x )
inlinestatic

◆ convertU32()

u32 sead::Endian::convertU32 ( Types from,
Types to,
u32 x )
inlinestatic

◆ convertU64()

u64 sead::Endian::convertU64 ( Types from,
Types to,
u64 x )
inlinestatic

◆ convertS8()

s8 sead::Endian::convertS8 ( Types from,
Types to,
s8 x )
inlinestatic

◆ convertS16()

s16 sead::Endian::convertS16 ( Types from,
Types to,
s16 x )
inlinestatic

◆ convertS32()

s32 sead::Endian::convertS32 ( Types from,
Types to,
s32 x )
inlinestatic

◆ convertS64()

s64 sead::Endian::convertS64 ( Types from,
Types to,
s64 x )
inlinestatic

◆ convertF32()

u32 sead::Endian::convertF32 ( Types from,
Types to,
const void * x )
inlinestatic

◆ toHostU8()

u8 sead::Endian::toHostU8 ( Types from,
u8 x )
inlinestatic

◆ toHostU16()

u16 sead::Endian::toHostU16 ( Types from,
u16 x )
inlinestatic

◆ toHostU32()

u32 sead::Endian::toHostU32 ( Types from,
u32 x )
inlinestatic

◆ toHostU64()

u64 sead::Endian::toHostU64 ( Types from,
u64 x )
inlinestatic

◆ fromHostU8()

u8 sead::Endian::fromHostU8 ( Types to,
u8 x )
inlinestatic

◆ fromHostU16()

u16 sead::Endian::fromHostU16 ( Types to,
u16 x )
inlinestatic

◆ fromHostU32()

u32 sead::Endian::fromHostU32 ( Types to,
u32 x )
inlinestatic

◆ fromHostU64()

u64 sead::Endian::fromHostU64 ( Types to,
u64 x )
inlinestatic

◆ toHostS8()

s8 sead::Endian::toHostS8 ( Types from,
s8 x )
inlinestatic

◆ toHostS16()

s16 sead::Endian::toHostS16 ( Types from,
s16 x )
inlinestatic

◆ toHostS32()

s32 sead::Endian::toHostS32 ( Types from,
s32 x )
inlinestatic

◆ toHostS64()

s64 sead::Endian::toHostS64 ( Types from,
s64 x )
inlinestatic

◆ fromHostS8()

s8 sead::Endian::fromHostS8 ( Types to,
s8 x )
inlinestatic

◆ fromHostS16()

s16 sead::Endian::fromHostS16 ( Types to,
s16 x )
inlinestatic

◆ fromHostS32()

s32 sead::Endian::fromHostS32 ( Types to,
s32 x )
inlinestatic

◆ fromHostS64()

s64 sead::Endian::fromHostS64 ( Types to,
s64 x )
inlinestatic

◆ toHostF32()

f32 sead::Endian::toHostF32 ( Types from,
const u32 * x )
inlinestatic

◆ fromHostF32()

u32 sead::Endian::fromHostF32 ( Types to,
const f32 * x )
inlinestatic

◆ getHostEndian()

Types sead::Endian::getHostEndian ( )
inlinestatic

◆ markToEndian()

Types sead::Endian::markToEndian ( u16 mark)
inlinestatic

◆ endianToMark()

u16 sead::Endian::endianToMark ( Types endian)
inlinestatic

Member Data Documentation

◆ cHostEndian

const Endian::Types sead::Endian::cHostEndian = Endian::markToEndian(0xfeff)
staticprivate

◆ cConvFuncTable

const Endian::ConvFuncTable sead::Endian::cConvFuncTable = { &Null8, &Swap8, &Null16, &Swap16, &Null32, &Swap32, &Null64, &Swap64 }
staticprivate