ClanLib  2.3.7
List of all members
CL_Endian Class Reference

Endianess management class. More...

#include <cl_endian.h>

Static Public Member Functions

Operations
static void swap (void *data, int type_size, int total_times=1)
 Swaps larger amounts of data between little and big endian. More...
 
Attributes
static bool is_system_big ()
 Returns true if big endian system. More...
 
static bool is_system_64bit ()
 Returns true if 64 bit system. More...
 

Detailed Description

Endianess management class.

The CL_Endian class is used to convert between different endianess. There are also a set of defines to the lazy developer:

#define SWAP_IF_BIG(i)
#define SWAP_IF_LITTLE(i)
#define SWAP_IF_BIG_ALOT(i, times)
#define SWAP_IF_LITTLE_ALOT(i, times)
#define IS_SYSTEM_64BIT()

Each of these defines call CL_Endian::is_system_big() and CL_Endian::swap.

Member Function Documentation

static bool CL_Endian::is_system_64bit ( )
static

Returns true if 64 bit system.

Returns
True if 64 bit, false otherwise.
static bool CL_Endian::is_system_big ( )
static

Returns true if big endian system.

Returns
True if big endian system, false otherwise.
static void CL_Endian::swap ( void *  data,
int  type_size,
int  total_times = 1 
)
static

Swaps larger amounts of data between little and big endian.

Parameters
dataData to be swapped.
type_sizeSize of datatype to be swapped. (Must be an even number)
total_timesNumber of 'type_size' size data chunks to be swapped.

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