OpenShot Audio Library | OpenShotAudio 0.3.2

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
juce::ByteOrder Class Reference

`#include <juce_ByteOrder.h>`

## Static Public Member Functions
static JUCE_CONSTEXPR uint16 | swap (uint16 value) noexcept
static JUCE_CONSTEXPR int16 | swap (int16 value) noexcept
static uint32 | swap (uint32 value) noexcept
static int32 | swap (int32 value) noexcept
static uint64 | swap (uint64 value) noexcept
static int64 | swap (int64 value) noexcept
static float | swap (float value) noexcept
static double | swap (double value) noexcept
template<typename Type >
static Type | swapIfBigEndian (Type value) noexcept
template<typename Type >
static Type | swapIfLittleEndian (Type value) noexcept
static JUCE_CONSTEXPR uint32 | littleEndianInt (const void *bytes) noexcept
static JUCE_CONSTEXPR uint64 | littleEndianInt64 (const void *bytes) noexcept
static JUCE_CONSTEXPR uint16 | littleEndianShort (const void *bytes) noexcept
static JUCE_CONSTEXPR int | littleEndian24Bit (const void *bytes) noexcept
static void | littleEndian24BitToChars (int32 value, void *destBytes) noexcept
static JUCE_CONSTEXPR uint32 | bigEndianInt (const void *bytes) noexcept
static JUCE_CONSTEXPR uint64 | bigEndianInt64 (const void *bytes) noexcept
static JUCE_CONSTEXPR uint16 | bigEndianShort (const void *bytes) noexcept
static JUCE_CONSTEXPR int | bigEndian24Bit (const void *bytes) noexcept
static void | bigEndian24BitToChars (int32 value, void *destBytes) noexcept
static JUCE_CONSTEXPR uint16 | makeInt (uint8 leastSig, uint8 mostSig) noexcept
static JUCE_CONSTEXPR uint32 | makeInt (uint8 leastSig, uint8 byte1, uint8 byte2, uint8 mostSig) noexcept
static JUCE_CONSTEXPR uint64 | makeInt (uint8 leastSig, uint8 byte1, uint8 byte2, uint8 byte3, uint8 byte4, uint8 byte5, uint8 byte6, uint8 mostSig) noexcept
static JUCE_CONSTEXPR bool | isBigEndian () noexcept

## Detailed Description

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

Definition at line 32 of file juce_ByteOrder.h.

## Member Function Documentation

## ◆ bigEndian24Bit()

JUCE_CONSTEXPR int32 juce::ByteOrder::bigEndian24Bit | ( | const void * | bytes | ) |
| inline static noexcept

Converts 3 big-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits).

Definition at line 215 of file juce_ByteOrder.h.

## ◆ bigEndian24BitToChars()

void juce::ByteOrder::bigEndian24BitToChars | ( | int32 | value,
|  | void * | destBytes
| ) |  |
| inline static noexcept

Copies a 24-bit number to 3 big-endian bytes.

Definition at line 218 of file juce_ByteOrder.h.

## ◆ bigEndianInt()

JUCE_CONSTEXPR uint32 juce::ByteOrder::bigEndianInt | ( | const void * | bytes | ) |
| inline static noexcept

Turns 4 bytes into a big-endian integer.

Definition at line 207 of file juce_ByteOrder.h.

Referenced by juce::Uuid::getNode(), juce::Uuid::getTimeLow(), juce::MidiFile::readFrom(), juce::InputStream::readIntBigEndian(), and juce::MidiFile::writeTo().

## ◆ bigEndianInt64()

JUCE_CONSTEXPR uint64 juce::ByteOrder::bigEndianInt64 | ( | const void * | bytes | ) |
| inline static noexcept

Turns 8 bytes into a big-endian integer.

Definition at line 209 of file juce_ByteOrder.h.

## ◆ bigEndianShort()

JUCE_CONSTEXPR uint16 juce::ByteOrder::bigEndianShort | ( | const void * | bytes | ) |
| inline static noexcept

Turns 2 bytes into a big-endian integer.

Definition at line 206 of file juce_ByteOrder.h.

Referenced by juce::Uuid::getNode(), juce::Uuid::getTimeHighAndVersion(), juce::Uuid::getTimeMid(), and juce::InputStream::readShortBigEndian().

## ◆ isBigEndian()

static JUCE_CONSTEXPR bool juce::ByteOrder::isBigEndian | ( |  | ) |
| inline static noexcept

Returns true if the current CPU is big-endian.

Definition at line 128 of file juce_ByteOrder.h.

## ◆ littleEndian24Bit()

JUCE_CONSTEXPR int32 juce::ByteOrder::littleEndian24Bit | ( | const void * | bytes | ) |
| inline static noexcept

Converts 3 little-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits).

Definition at line 214 of file juce_ByteOrder.h.

## ◆ littleEndian24BitToChars()

void juce::ByteOrder::littleEndian24BitToChars | ( | int32 | value,
|  | void * | destBytes
| ) |  |
| inline static noexcept

Copies a 24-bit number to 3 little-endian bytes.

Definition at line 217 of file juce_ByteOrder.h.

## ◆ littleEndianInt()

JUCE_CONSTEXPR uint32 juce::ByteOrder::littleEndianInt | ( | const void * | bytes | ) |
| inline static noexcept

Turns 4 bytes into a little-endian integer.

Definition at line 199 of file juce_ByteOrder.h.

Referenced by juce::BigInteger::loadFromMemoryBlock(), juce::InputStream::readCompressedInt(), and juce::InputStream::readInt().

## ◆ littleEndianInt64()

JUCE_CONSTEXPR uint64 juce::ByteOrder::littleEndianInt64 | ( | const void * | bytes | ) |
| inline static noexcept

Turns 8 bytes into a little-endian integer.

Definition at line 201 of file juce_ByteOrder.h.

## ◆ littleEndianShort()

JUCE_CONSTEXPR uint16 juce::ByteOrder::littleEndianShort | ( | const void * | bytes | ) |
| inline static noexcept

Turns 2 bytes into a little-endian integer.

Definition at line 198 of file juce_ByteOrder.h.

Referenced by juce::InputStream::readShort().

## ◆ makeInt() [1/3]

JUCE_CONSTEXPR uint64 juce::ByteOrder::makeInt | ( | uint8 | leastSig,
|  | uint8 | byte1,
|  | uint8 | byte2,
|  | uint8 | byte3,
|  | uint8 | byte4,
|  | uint8 | byte5,
|  | uint8 | byte6,
|  | uint8 | mostSig
| ) |  |
| inline static noexcept

Constructs a 64-bit integer from its constituent bytes, in order of significance.

Definition at line 192 of file juce_ByteOrder.h.

## ◆ makeInt() [2/3]

JUCE_CONSTEXPR uint32 juce::ByteOrder::makeInt | ( | uint8 | leastSig,
|  | uint8 | byte1,
|  | uint8 | byte2,
|  | uint8 | mostSig
| ) |  |
| inline static noexcept

Constructs a 32-bit integer from its constituent bytes, in order of significance.

Definition at line 186 of file juce_ByteOrder.h.

## ◆ makeInt() [3/3]

JUCE_CONSTEXPR uint16 juce::ByteOrder::makeInt | ( | uint8 | leastSig,
|  | uint8 | mostSig
| ) |  |
| inline static noexcept

Constructs a 16-bit integer from its constituent bytes, in order of significance.

Definition at line 181 of file juce_ByteOrder.h.

## ◆ swap() [1/8]

double juce::ByteOrder::swap | ( | double | value | ) |
| inline static noexcept

Returns a garbled double which has the reverse byte-order of the original.

Definition at line 148 of file juce_ByteOrder.h.

## ◆ swap() [2/8]

float juce::ByteOrder::swap | ( | float | value | ) |
| inline static noexcept

Returns a garbled float which has the reverse byte-order of the original.

Definition at line 147 of file juce_ByteOrder.h.

## ◆ swap() [3/8]

JUCE_CONSTEXPR int16 juce::ByteOrder::swap | ( | int16 | value | ) |
| inline static noexcept

Swaps the upper and lower bytes of a 16-bit integer.

Definition at line 144 of file juce_ByteOrder.h.

## ◆ swap() [4/8]

int32 juce::ByteOrder::swap | ( | int32 | value | ) |
| inline static noexcept

Reverses the order of the 4 bytes in a 32-bit integer.

Definition at line 145 of file juce_ByteOrder.h.

## ◆ swap() [5/8]

int64 juce::ByteOrder::swap | ( | int64 | value | ) |
| inline static noexcept

Reverses the order of the 8 bytes in a 64-bit integer.

Definition at line 146 of file juce_ByteOrder.h.

## ◆ swap() [6/8]

JUCE_CONSTEXPR uint16 juce::ByteOrder::swap | ( | uint16 | value | ) |
| inline static noexcept

Swaps the upper and lower bytes of a 16-bit integer.

Definition at line 143 of file juce_ByteOrder.h.

## ◆ swap() [7/8]

uint32 juce::ByteOrder::swap | ( | uint32 | value | ) |
| inline static noexcept

Reverses the order of the 4 bytes in a 32-bit integer.

Definition at line 154 of file juce_ByteOrder.h.

## ◆ swap() [8/8]

uint64 juce::ByteOrder::swap | ( | uint64 | value | ) |
| inline static noexcept

Reverses the order of the 8 bytes in a 64-bit integer.

Definition at line 170 of file juce_ByteOrder.h.

## ◆ swapIfBigEndian()

template<typename Type >

static Type juce::ByteOrder::swapIfBigEndian | ( | Type | value | ) |
| inline static noexcept

Swaps the byte order of a signed or unsigned integer if the CPU is big-endian

Definition at line 63 of file juce_ByteOrder.h.

Referenced by juce::String::createStringFromData(), juce::InputStream::readInt64(), and juce::InterprocessConnection::sendMessage().

## ◆ swapIfLittleEndian()

template<typename Type >

static Type juce::ByteOrder::swapIfLittleEndian | ( | Type | value | ) |
| inline static noexcept

Swaps the byte order of a signed or unsigned integer if the CPU is little-endian

Definition at line 74 of file juce_ByteOrder.h.

Referenced by juce::String::createStringFromData(), and juce::InputStream::readInt64BigEndian().

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

- juce_ByteOrder.h