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  Type { LittleEndian = 0, BigEndian = 1 }
 Enumerates possible endianness types. More...
 
enum  Target { SYSTEM_ENDIANNESS = 0, INVERSE_SYSTEM_ENDIANNESS = 1 }
 Enumerates the possible endianness types relative to the current platform. More...
 

Static Public Member Functions

static Type GetSystemEndianness ()
 Retrieves the endianness of the current platform. More...
 
static Type GetInverseSystemEndianness ()
 Retrieves the endianness opposite to that of the current platform. More...
 
static Type GetInverseEndianness (Type endianness)
 Retrieves the endianness opposite to the specified type. More...
 
static Type GetEndiannessFromMem32 (const KyUInt32 *mem)
 Retrieves the endianness from a 4-byte memory location. More...
 
static void SetEndiannessToMem32 (Type endianness, KyUInt32 *mem)
 Sets a 4-byte memory location to the specified endianness. More...
 
static void SwapEndiannessInMem32 (KyUInt32 *mem)
 Swaps the endianness in a 4-byte memory location. More...
 
static void Swap16 (void *x)
 Swaps the endianness of the data in a 16-bit buffer. More...
 
static void Swap32 (void *x)
 Swaps the endianness of the data in a 32-bit buffer. More...
 
static void Swap64 (void *x)
 Swaps the endianness of the data in a 64-bit buffer. More...
 

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: