C++ Utilities 5.24.8
Useful C++ classes and routines such as argument parser, IO and conversion utilities
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
binaryconversion.h File Reference
#include "../global.h"
#include "../misc/traits.h"
#include <cstdint>
#include <cstring>
#include "./binaryconversionprivate.h"
Include dependency graph for binaryconversion.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  CppUtilities
 Contains all utilities provides by the c++utilities library.
 
namespace  CppUtilities::BE
 Encapsulates binary conversion functions using the big endian byte order.
 
namespace  CppUtilities::LE
 Encapsulates binary conversion functions using the little endian byte order.
 

Macros

#define CONVERSION_UTILITIES_BINARY_CONVERSION_INTERNAL   0
 
#define CONVERSION_UTILITIES_BINARY_CONVERSION_INTERNAL   1
 

Functions

CPP_UTILITIES_EXPORT constexpr std::uint16_t CppUtilities::toFixed8 (float float32value)
 Returns the 8.8 fixed point representation converted from the specified 32-bit floating point number.
 
CPP_UTILITIES_EXPORT constexpr float CppUtilities::toFloat32 (std::uint16_t fixed8value)
 Returns a 32-bit floating point number converted from the specified 8.8 fixed point representation.
 
CPP_UTILITIES_EXPORT constexpr std::uint32_t CppUtilities::toFixed16 (float float32value)
 Returns the 16.16 fixed point representation converted from the specified 32-bit floating point number.
 
CPP_UTILITIES_EXPORT constexpr float CppUtilities::toFloat32 (std::uint32_t fixed16value)
 Returns a 32-bit floating point number converted from the specified 16.16 fixed point representation.
 
CPP_UTILITIES_EXPORT constexpr std::uint32_t CppUtilities::toSynchsafeInt (std::uint32_t normalInt)
 Returns a 32-bit synchsafe integer converted from a normal 32-bit integer.
 
CPP_UTILITIES_EXPORT constexpr std::uint32_t CppUtilities::toNormalInt (std::uint32_t synchsafeInt)
 Returns a normal 32-bit integer converted from a 32-bit synchsafe integer.
 
CPP_UTILITIES_EXPORT constexpr std::uint16_t CppUtilities::swapOrder (std::uint16_t value)
 Swaps the byte order of the specified 16-bit unsigned integer.
 
CPP_UTILITIES_EXPORT constexpr std::uint32_t CppUtilities::swapOrder (std::uint32_t value)
 Swaps the byte order of the specified 32-bit unsigned integer.
 
CPP_UTILITIES_EXPORT constexpr std::uint64_t CppUtilities::swapOrder (std::uint64_t value)
 Swaps the byte order of the specified 64-bit unsigned integer.
 
CPP_UTILITIES_EXPORT constexpr std::int16_t CppUtilities::swapOrder (std::int16_t value)
 Swaps the byte order of the specified 16-bit integer.
 
CPP_UTILITIES_EXPORT constexpr std::int32_t CppUtilities::swapOrder (std::int32_t value)
 Swaps the byte order of the specified 32-bit integer.
 
CPP_UTILITIES_EXPORT constexpr std::int64_t CppUtilities::swapOrder (std::int64_t value)
 Swaps the byte order of the specified 64-bit integer.
 

Macro Definition Documentation

◆ CONVERSION_UTILITIES_BINARY_CONVERSION_INTERNAL [1/2]

#define CONVERSION_UTILITIES_BINARY_CONVERSION_INTERNAL   0

Definition at line 209 of file binaryconversion.h.

◆ CONVERSION_UTILITIES_BINARY_CONVERSION_INTERNAL [2/2]

#define CONVERSION_UTILITIES_BINARY_CONVERSION_INTERNAL   1

Definition at line 209 of file binaryconversion.h.