C++ Utilities  4.17.0
Useful C++ classes and routines such as argument parser, IO and conversion utilities
Typedefs | Functions
ConversionUtilities::BE Namespace Reference

Encapsulates binary conversion functions using the big endian byte order. More...

Typedefs

typedef std::int8_t sbyte
 signed byte More...
 
typedef std::uint8_t byte
 unsigned byte More...
 
typedef std::int16_t int16
 signed 16-bit integer More...
 
typedef std::int32_t int32
 signed 32-bit integer More...
 
typedef std::int64_t int64
 signed 64-bit integer More...
 
typedef std::intptr_t intptr
 signed pointer More...
 
typedef std::uint16_t uint16
 unsigned 16-bit integer More...
 
typedef std::uint32_t uint32
 unsigned 32-bit integer More...
 
typedef std::uint64_t uint64
 unsigned 64-bit integer More...
 
typedef std::uintptr_t uintptr
 unsigned pointer More...
 

Functions

CPP_UTILITIES_EXPORT constexpr int16 toInt16 (const char *value)
 Returns a 16-bit signed integer converted from two bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT constexpr uint16 toUInt16 (const char *value)
 Returns a 16-bit unsigned integer converted from two bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT constexpr int32 toInt32 (const char *value)
 Returns a 32-bit signed integer converted from four bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT constexpr uint32 toUInt24 (const char *value)
 Returns a 32-bit unsigned integer converted from three bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT constexpr uint32 toUInt32 (const char *value)
 Returns a 32-bit unsigned integer converted from four bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT constexpr int64 toInt64 (const char *value)
 Returns a 64-bit signed integer converted from eight bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT constexpr uint64 toUInt64 (const char *value)
 Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT float32 toFloat32 (const char *value)
 Returns a 32-bit floating point number converted from four bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT float64 toFloat64 (const char *value)
 Returns a 64-bit floating point number converted from eight bytes at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (int16 value, char *outputbuffer)
 Stores the specified 16-bit signed integer value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (uint16 value, char *outputbuffer)
 Stores the specified 16-bit unsigned integer value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes24 (uint32 value, char *outputbuffer)
 Stores the specified 24-bit unsigned integer value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (int32 value, char *outputbuffer)
 Stores the specified 32-bit signed integer value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (uint32 value, char *outputbuffer)
 Stores the specified 32-bit signed integer value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (int64 value, char *outputbuffer)
 Stores the specified 64-bit signed integer value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (uint64 value, char *outputbuffer)
 Stores the specified 64-bit unsigned integer value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (float32 value, char *outputbuffer)
 Stores the specified 32-bit floating point value at a specified position in a char array. More...
 
CPP_UTILITIES_EXPORT void getBytes (float64 value, char *outputbuffer)
 Stores the specified 64-bit floating point value at a specified position in a char array. More...
 

Detailed Description

Encapsulates binary conversion functions using the big endian byte order.

See also
Endianness - Wikipedia

Typedef Documentation

◆ byte

typedef std::uint8_t ConversionUtilities::BE::byte

unsigned byte

Definition at line 15 of file binaryconversion.h.

◆ int16

typedef std::int16_t ConversionUtilities::BE::int16

signed 16-bit integer

Definition at line 20 of file binaryconversion.h.

◆ int32

typedef std::int32_t ConversionUtilities::BE::int32

signed 32-bit integer

Definition at line 25 of file binaryconversion.h.

◆ int64

typedef std::int64_t ConversionUtilities::BE::int64

signed 64-bit integer

Definition at line 30 of file binaryconversion.h.

◆ intptr

typedef std::intptr_t ConversionUtilities::BE::intptr

signed pointer

Definition at line 35 of file binaryconversion.h.

◆ sbyte

typedef std::int8_t ConversionUtilities::BE::sbyte

signed byte

Definition at line 10 of file binaryconversion.h.

◆ uint16

typedef std::uint16_t ConversionUtilities::BE::uint16

unsigned 16-bit integer

Definition at line 40 of file binaryconversion.h.

◆ uint32

typedef std::uint32_t ConversionUtilities::BE::uint32

unsigned 32-bit integer

Definition at line 45 of file binaryconversion.h.

◆ uint64

typedef std::uint64_t ConversionUtilities::BE::uint64

unsigned 64-bit integer

Definition at line 50 of file binaryconversion.h.

◆ uintptr

typedef std::uintptr_t ConversionUtilities::BE::uintptr

unsigned pointer

Definition at line 55 of file binaryconversion.h.

Function Documentation

◆ getBytes() [1/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( int16  value,
char *  outputbuffer 
)
inline

Stores the specified 16-bit signed integer value at a specified position in a char array.

Definition at line 134 of file binaryconversion.h.

◆ getBytes() [2/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( uint16  value,
char *  outputbuffer 
)
inline

Stores the specified 16-bit unsigned integer value at a specified position in a char array.

Definition at line 148 of file binaryconversion.h.

◆ getBytes() [3/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( int32  value,
char *  outputbuffer 
)
inline

Stores the specified 32-bit signed integer value at a specified position in a char array.

Definition at line 179 of file binaryconversion.h.

◆ getBytes() [4/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( uint32  value,
char *  outputbuffer 
)
inline

Stores the specified 32-bit signed integer value at a specified position in a char array.

Definition at line 197 of file binaryconversion.h.

◆ getBytes() [5/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( int64  value,
char *  outputbuffer 
)
inline

Stores the specified 64-bit signed integer value at a specified position in a char array.

Definition at line 215 of file binaryconversion.h.

◆ getBytes() [6/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( uint64  value,
char *  outputbuffer 
)
inline

Stores the specified 64-bit unsigned integer value at a specified position in a char array.

Definition at line 241 of file binaryconversion.h.

◆ getBytes() [7/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( float32  value,
char *  outputbuffer 
)
inline

Stores the specified 32-bit floating point value at a specified position in a char array.

Definition at line 267 of file binaryconversion.h.

◆ getBytes() [8/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes ( float64  value,
char *  outputbuffer 
)
inline

Stores the specified 64-bit floating point value at a specified position in a char array.

Definition at line 277 of file binaryconversion.h.

◆ getBytes24()

CPP_UTILITIES_EXPORT void ConversionUtilities::BE::getBytes24 ( uint32  value,
char *  outputbuffer 
)
inline

Stores the specified 24-bit unsigned integer value at a specified position in a char array.

Remarks
Ignores the most significant byte.

Definition at line 163 of file binaryconversion.h.

◆ toFloat32()

CPP_UTILITIES_EXPORT float32 ConversionUtilities::BE::toFloat32 ( const char *  value)
inline

Returns a 32-bit floating point number converted from four bytes at a specified position in a char array.

Definition at line 114 of file binaryconversion.h.

◆ toFloat64()

CPP_UTILITIES_EXPORT float64 ConversionUtilities::BE::toFloat64 ( const char *  value)
inline

Returns a 64-bit floating point number converted from eight bytes at a specified position in a char array.

Definition at line 124 of file binaryconversion.h.

◆ toInt16()

CPP_UTILITIES_EXPORT constexpr int16 ConversionUtilities::BE::toInt16 ( const char *  value)

Returns a 16-bit signed integer converted from two bytes at a specified position in a char array.

Definition at line 12 of file binaryconversion.h.

◆ toInt32()

CPP_UTILITIES_EXPORT constexpr int32 ConversionUtilities::BE::toInt32 ( const char *  value)

Returns a 32-bit signed integer converted from four bytes at a specified position in a char array.

Definition at line 36 of file binaryconversion.h.

◆ toInt64()

CPP_UTILITIES_EXPORT constexpr int64 ConversionUtilities::BE::toInt64 ( const char *  value)

Returns a 64-bit signed integer converted from eight bytes at a specified position in a char array.

Definition at line 78 of file binaryconversion.h.

◆ toUInt16()

CPP_UTILITIES_EXPORT constexpr uint16 ConversionUtilities::BE::toUInt16 ( const char *  value)

Returns a 16-bit unsigned integer converted from two bytes at a specified position in a char array.

Definition at line 24 of file binaryconversion.h.

◆ toUInt24()

CPP_UTILITIES_EXPORT constexpr uint32 ConversionUtilities::BE::toUInt24 ( const char *  value)

Returns a 32-bit unsigned integer converted from three bytes at a specified position in a char array.

Definition at line 50 of file binaryconversion.h.

◆ toUInt32()

CPP_UTILITIES_EXPORT constexpr uint32 ConversionUtilities::BE::toUInt32 ( const char *  value)

Returns a 32-bit unsigned integer converted from four bytes at a specified position in a char array.

Definition at line 64 of file binaryconversion.h.

◆ toUInt64()

CPP_UTILITIES_EXPORT constexpr uint64 ConversionUtilities::BE::toUInt64 ( const char *  value)

Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a char array.

Definition at line 96 of file binaryconversion.h.