Kaim::Endianness Class Reference

Kaim::Endianness Class Reference

#include <endianness.h>

Class Description

Collects endianness types and utilities used in the blob serialization framework.

Endianness is a class with static functions only.

Public Types

enum  Target { SYSTEM_ENDIANNESS = 0, INVERSE_SYSTEM_ENDIANNESS = 1 }
 
enum  Type { LittleEndian = 0, BigEndian = 1 }
 

Static Public Member Functions

static Type GetEndiannessFromMem32 (const KyUInt32 *mem)
 
static Type GetInverseEndianness (Type endianness)
 
static Type GetInverseSystemEndianness ()
 
static Type GetSystemEndianness ()
 
static void SetEndiannessToMem32 (Type endianness, KyUInt32 *mem)
 
static void Swap16 (void *x)
 
static void Swap32 (void *x)
 
static void Swap64 (void *x)
 
static void SwapEndiannessInMem32 (KyUInt32 *mem)
 

Member Enumeration Documentation

Enumerates the possible endianness types relative to the current platform.

Enumerator
SYSTEM_ENDIANNESS 

The same endianness type as the current platform.

INVERSE_SYSTEM_ENDIANNESS 

The opposite endianness type from the current platform.

Enumerates possible endianness types.

Enumerator
LittleEndian 

Little-endian format (used, for example, for Windows, Linux).

BigEndian 

Big-endian format (used, for example, for PlayStation 3, Xbox 360).

Member Function Documentation

static Type Kaim::Endianness::GetEndiannessFromMem32 ( const KyUInt32 mem)
inlinestatic

Retrieves the endianness from a 4-byte memory location.

static Type Kaim::Endianness::GetInverseEndianness ( Type  endianness)
inlinestatic

Retrieves the endianness opposite to the specified type.

static Type Kaim::Endianness::GetInverseSystemEndianness ( )
inlinestatic

Retrieves the endianness opposite to that of the current platform.

static Type Kaim::Endianness::GetSystemEndianness ( )
inlinestatic

Retrieves the endianness of the current platform.

static void Kaim::Endianness::SetEndiannessToMem32 ( Type  endianness,
KyUInt32 mem 
)
inlinestatic

Sets a 4-byte memory location to the specified endianness.

static void Kaim::Endianness::Swap16 ( void *  x)
inlinestatic

Swaps the endianness of the data in a 16-bit buffer.

static void Kaim::Endianness::Swap32 ( void *  x)
inlinestatic

Swaps the endianness of the data in a 32-bit buffer.

static void Kaim::Endianness::Swap64 ( void *  x)
inlinestatic

Swaps the endianness of the data in a 64-bit buffer.

static void Kaim::Endianness::SwapEndiannessInMem32 ( KyUInt32 mem)
inlinestatic

Swaps the endianness in a 4-byte memory location.


The documentation for this class was generated from the following file: