MPD: system/ByteOrder.hxx File Reference

MPD 0.20.15

Macros | Functions
ByteOrder.hxx File Reference
`#include "Compiler.h"`
`#include <stdint.h>`
`#include <endian.h>`
Include dependency graph for ByteOrder.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros
#define | IS_LITTLE_ENDIAN true
#define | IS_BIG_ENDIAN false

## Functions
static constexpr bool | IsLittleEndian ()
static constexpr bool | IsBigEndian ()
static constexpr uint16_t | GenericByteSwap16 (uint16_t value)
static constexpr uint32_t | GenericByteSwap32 (uint32_t value)
static constexpr uint64_t | GenericByteSwap64 (uint64_t value)
static constexpr uint16_t | ByteSwap16 (uint16_t value)
static constexpr uint32_t | ByteSwap32 (uint32_t value)
static constexpr uint64_t | ByteSwap64 (uint64_t value)
static constexpr uint16_t | FromBE16 (uint16_t value)
| Converts a 16bit value from big endian to the system's byte order. More...
static constexpr uint32_t | FromBE32 (uint32_t value)
| Converts a 32bit value from big endian to the system's byte order. More...
static constexpr uint64_t | FromBE64 (uint64_t value)
| Converts a 64bit value from big endian to the system's byte order. More...
static constexpr uint16_t | FromLE16 (uint16_t value)
| Converts a 16bit value from little endian to the system's byte order. More...
static constexpr uint32_t | FromLE32 (uint32_t value)
| Converts a 32bit value from little endian to the system's byte order. More...
static constexpr uint64_t | FromLE64 (uint64_t value)
| Converts a 64bit value from little endian to the system's byte order. More...
static constexpr uint16_t | ToBE16 (uint16_t value)
| Converts a 16bit value from the system's byte order to big endian. More...
static constexpr uint32_t | ToBE32 (uint32_t value)
| Converts a 32bit value from the system's byte order to big endian. More...
static constexpr uint64_t | ToBE64 (uint64_t value)
| Converts a 64bit value from the system's byte order to big endian. More...
static constexpr uint16_t | ToLE16 (uint16_t value)
| Converts a 16bit value from the system's byte order to little endian. More...
static constexpr uint32_t | ToLE32 (uint32_t value)
| Converts a 32bit value from the system's byte order to little endian. More...
static constexpr uint64_t | ToLE64 (uint64_t value)
| Converts a 64bit value from the system's byte order to little endian. More...

## Macro Definition Documentation

## ◆ IS_BIG_ENDIAN

#define IS_BIG_ENDIAN false

Definition at line 69 of file ByteOrder.hxx.

## ◆ IS_LITTLE_ENDIAN

#define IS_LITTLE_ENDIAN true

Definition at line 68 of file ByteOrder.hxx.

## Function Documentation

## ◆ ByteSwap16()

static constexpr uint16_t ByteSwap16 | ( | uint16_t | value | ) |
| inlinestatic

Definition at line 109 of file ByteOrder.hxx.

## ◆ ByteSwap32()

static constexpr uint32_t ByteSwap32 | ( | uint32_t | value | ) |
| inlinestatic

Definition at line 119 of file ByteOrder.hxx.

## ◆ ByteSwap64()

static constexpr uint64_t ByteSwap64 | ( | uint64_t | value | ) |
| inlinestatic

Definition at line 129 of file ByteOrder.hxx.

## ◆ FromBE16()

static constexpr uint16_t FromBE16 | ( | uint16_t | value | ) |
| inlinestatic

Converts a 16bit value from big endian to the system's byte order.

Definition at line 142 of file ByteOrder.hxx.

## ◆ FromBE32()

static constexpr uint32_t FromBE32 | ( | uint32_t | value | ) |
| inlinestatic

Converts a 32bit value from big endian to the system's byte order.

Definition at line 151 of file ByteOrder.hxx.

## ◆ FromBE64()

static constexpr uint64_t FromBE64 | ( | uint64_t | value | ) |
| inlinestatic

Converts a 64bit value from big endian to the system's byte order.

Definition at line 160 of file ByteOrder.hxx.

## ◆ FromLE16()

static constexpr uint16_t FromLE16 | ( | uint16_t | value | ) |
| inlinestatic

Converts a 16bit value from little endian to the system's byte order.

Definition at line 169 of file ByteOrder.hxx.

## ◆ FromLE32()

static constexpr uint32_t FromLE32 | ( | uint32_t | value | ) |
| inlinestatic

Converts a 32bit value from little endian to the system's byte order.

Definition at line 178 of file ByteOrder.hxx.

## ◆ FromLE64()

static constexpr uint64_t FromLE64 | ( | uint64_t | value | ) |
| inlinestatic

Converts a 64bit value from little endian to the system's byte order.

Definition at line 187 of file ByteOrder.hxx.

## ◆ GenericByteSwap16()

static constexpr uint16_t GenericByteSwap16 | ( | uint16_t | value | ) |
| inlinestatic

Definition at line 89 of file ByteOrder.hxx.

## ◆ GenericByteSwap32()

static constexpr uint32_t GenericByteSwap32 | ( | uint32_t | value | ) |
| inlinestatic

Definition at line 95 of file ByteOrder.hxx.

## ◆ GenericByteSwap64()

static constexpr uint64_t GenericByteSwap64 | ( | uint64_t | value | ) |
| inlinestatic

Definition at line 102 of file ByteOrder.hxx.

## ◆ IsBigEndian()

static constexpr bool IsBigEndian | ( |  | ) |
| inlinestatic

Definition at line 83 of file ByteOrder.hxx.

## ◆ IsLittleEndian()

static constexpr bool IsLittleEndian | ( |  | ) |
| inlinestatic

Definition at line 77 of file ByteOrder.hxx.

## ◆ ToBE16()

static constexpr uint16_t ToBE16 | ( | uint16_t | value | ) |
| inlinestatic

Converts a 16bit value from the system's byte order to big endian.

Definition at line 196 of file ByteOrder.hxx.

## ◆ ToBE32()

static constexpr uint32_t ToBE32 | ( | uint32_t | value | ) |
| inlinestatic

Converts a 32bit value from the system's byte order to big endian.

Definition at line 205 of file ByteOrder.hxx.

## ◆ ToBE64()

static constexpr uint64_t ToBE64 | ( | uint64_t | value | ) |
| inlinestatic

Converts a 64bit value from the system's byte order to big endian.

Definition at line 214 of file ByteOrder.hxx.

## ◆ ToLE16()

static constexpr uint16_t ToLE16 | ( | uint16_t | value | ) |
| inlinestatic

Converts a 16bit value from the system's byte order to little endian.

Definition at line 223 of file ByteOrder.hxx.

## ◆ ToLE32()

static constexpr uint32_t ToLE32 | ( | uint32_t | value | ) |
| inlinestatic

Converts a 32bit value from the system's byte order to little endian.

Definition at line 232 of file ByteOrder.hxx.

## ◆ ToLE64()

static constexpr uint64_t ToLE64 | ( | uint64_t | value | ) |
| inlinestatic

Converts a 64bit value from the system's byte order to little endian.

Definition at line 241 of file ByteOrder.hxx.