Contains static methods for converting the byte order between different endiannesses. More...

Static Public Member Functions

static JUCE_CONSTEXPR uint16 swap (uint16 value) noexcept
 Swaps the upper and lower bytes of a 16-bit integer. More...
 
static uint32 swap (uint32 value) noexcept
 Reverses the order of the 4 bytes in a 32-bit integer. More...
 
static uint64 swap (uint64 value) noexcept
 Reverses the order of the 8 bytes in a 64-bit integer. More...
 
static JUCE_CONSTEXPR uint16 swapIfBigEndian (uint16 value) noexcept
 Swaps the byte order of a 16-bit unsigned int if the CPU is big-endian. More...
 
static uint32 swapIfBigEndian (uint32 value) noexcept
 Swaps the byte order of a 32-bit unsigned int if the CPU is big-endian. More...
 
static uint64 swapIfBigEndian (uint64 value) noexcept
 Swaps the byte order of a 64-bit unsigned int if the CPU is big-endian. More...
 
static JUCE_CONSTEXPR int16 swapIfBigEndian (int16 value) noexcept
 Swaps the byte order of a 16-bit signed int if the CPU is big-endian. More...
 
static int32 swapIfBigEndian (int32 value) noexcept
 Swaps the byte order of a 32-bit signed int if the CPU is big-endian. More...
 
static int64 swapIfBigEndian (int64 value) noexcept
 Swaps the byte order of a 64-bit signed int if the CPU is big-endian. More...
 
static float swapIfBigEndian (float value) noexcept
 Swaps the byte order of a 32-bit float if the CPU is big-endian. More...
 
static double swapIfBigEndian (double value) noexcept
 Swaps the byte order of a 64-bit float if the CPU is big-endian. More...
 
static JUCE_CONSTEXPR uint16 swapIfLittleEndian (uint16 value) noexcept
 Swaps the byte order of a 16-bit unsigned int if the CPU is little-endian. More...
 
static uint32 swapIfLittleEndian (uint32 value) noexcept
 Swaps the byte order of a 32-bit unsigned int if the CPU is little-endian. More...
 
static uint64 swapIfLittleEndian (uint64 value) noexcept
 Swaps the byte order of a 64-bit unsigned int if the CPU is little-endian. More...
 
static JUCE_CONSTEXPR int16 swapIfLittleEndian (int16 value) noexcept
 Swaps the byte order of a 16-bit signed int if the CPU is little-endian. More...
 
static int32 swapIfLittleEndian (int32 value) noexcept
 Swaps the byte order of a 32-bit signed int if the CPU is little-endian. More...
 
static int64 swapIfLittleEndian (int64 value) noexcept
 Swaps the byte order of a 64-bit signed int if the CPU is little-endian. More...
 
static float swapIfLittleEndian (float value) noexcept
 Swaps the byte order of a 32-bit float if the CPU is little-endian. More...
 
static double swapIfLittleEndian (double value) noexcept
 Swaps the byte order of a 64-bit float if the CPU is little-endian. More...
 
static uint32 littleEndianInt (const void *bytes) noexcept
 Turns 4 bytes into a little-endian integer. More...
 
static JUCE_CONSTEXPR uint32 littleEndianInt (char c1, char c2, char c3, char c4) noexcept
 Turns 4 characters into a little-endian integer. More...
 
static uint64 littleEndianInt64 (const void *bytes) noexcept
 Turns 8 bytes into a little-endian integer. More...
 
static uint16 littleEndianShort (const void *bytes) noexcept
 Turns 2 bytes into a little-endian integer. More...
 
static uint32 bigEndianInt (const void *bytes) noexcept
 Turns 4 bytes into a big-endian integer. More...
 
static uint64 bigEndianInt64 (const void *bytes) noexcept
 Turns 8 bytes into a big-endian integer. More...
 
static uint16 bigEndianShort (const void *bytes) noexcept
 Turns 2 bytes into a big-endian integer. More...
 
static int littleEndian24Bit (const void *bytes) noexcept
 Converts 3 little-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits). More...
 
static int bigEndian24Bit (const void *bytes) noexcept
 Converts 3 big-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits). More...
 
static void littleEndian24BitToChars (int value, void *destBytes) noexcept
 Copies a 24-bit number to 3 little-endian bytes. More...
 
static void bigEndian24BitToChars (int value, void *destBytes) noexcept
 Copies a 24-bit number to 3 big-endian bytes. More...
 
static JUCE_CONSTEXPR bool isBigEndian () noexcept
 Returns true if the current CPU is big-endian. More...
 

Detailed Description

Contains static methods for converting the byte order between different endiannesses.


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