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

Encapsulates binary conversion functions using the little endian byte order. 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 little endian byte order.

See also
Endianness - Wikipedia

Function Documentation

◆ getBytes() [1/8]

CPP_UTILITIES_EXPORT void ConversionUtilities::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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::LE::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.