Contains methods that perform conversions of sequence of bytes to a value type and vice-versa. This is a static type with no instance services. You should never create instances of it by any means.
More...
|
| static bool | _IsLittleEndian () |
| | Indicates the endianness of the current architecture. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (bool value) |
| | Converts the specified boolean value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (char_t value) |
| | Converts the specified char_t value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (int16_t value) |
| | Converts the specified 16-bit integer value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (int value) |
| | Converts the specified 32-bit integer value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (int64_t value) |
| | Converts the specified 64-bit integer value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (uint16_t value) |
| | Converts the specified unsigned 16-bit integer value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (uint32_t value) |
| | Converts the specified unsigned 32-bit integer value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (uint64_t value) |
| | Converts the specified unsigned 64-bit integer value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (float value) |
| | Converts the specified single-precision floating-point value into an array of bytes. More...
|
| |
| static System::ArrayPtr< uint8_t > | GetBytes (double value) |
| | Converts the specified double-precision floating-point value into an array of bytes. More...
|
| |
| static bool | ToBoolean (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts one byte from the specified array starting at the specified index to boolean value. More...
|
| |
| static bool | ToBoolean (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts one byte from the specified array starting at the specified index to boolean value. More...
|
| |
| static char_t | ToChar (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts two bytes from the specified array starting at the specified index to char_t value. More...
|
| |
| static char_t | ToChar (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts two bytes from the specified array starting at the specified index to char_t value. More...
|
| |
| static int16_t | ToInt16 (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts two bytes from the specified array starting at the specified index to 16-bit integer value. More...
|
| |
| static int16_t | ToInt16 (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts two bytes from the specified array starting at the specified index to 16-bit integer value. More...
|
| |
| static int | ToInt32 (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts four bytes from the specified array starting at the specified index to 32-bit integer value. More...
|
| |
| static int | ToInt32 (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts four bytes from the specified array starting at the specified index to 32-bit integer value. More...
|
| |
| static int64_t | ToInt64 (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts eight bytes from the specified array starting at the specified index to 64-bit integer value. More...
|
| |
| static int64_t | ToInt64 (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts eight bytes from the specified array starting at the specified index to 64-bit integer value. More...
|
| |
| static uint16_t | ToUInt16 (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts two bytes from the specified array starting at the specified index to unsigned 16-bit integer value. More...
|
| |
| static uint16_t | ToUInt16 (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts two bytes from the specified array starting at the specified index to unsigned 16-bit integer value. More...
|
| |
| static uint32_t | ToUInt32 (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts four bytes from the specified array starting at the specified index to unsigned 32-bit integer value. More...
|
| |
| static uint32_t | ToUInt32 (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts four bytes from the specified array starting at the specified index to unsigned 32-bit integer value. More...
|
| |
| static uint64_t | ToUInt64 (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts eight bytes from the specified array starting at the specified index to unsigned 64-bit integer value. More...
|
| |
| static uint64_t | ToUInt64 (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts eight bytes from the specified array starting at the specified index to unsigned 64-bit integer value. More...
|
| |
| static float | ToSingle (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts four bytes from the specified array starting at the specified index to single-precision floating point value. More...
|
| |
| static float | ToSingle (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts four bytes from the specified array starting at the specified index to single-precision floating point value. More...
|
| |
| static double | ToDouble (const System::ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts eight bytes from the specified array starting at the specified index to double-precision floating point value. More...
|
| |
| static double | ToDouble (const System::Details::ArrayView< uint8_t > &value, int startIndex) |
| | Converts eight bytes from the specified array starting at the specified index to double-precision floating point value. More...
|
| |
| static String | ToString (const ArrayPtr< uint8_t > &value, bool uppercase=true, const String &separator=u"-") |
| | Converts all values of the specified byte array into their hexadecimal string representation. Case of letters to use in hexadecimal notation and separator inserted between each pair of neighbouring bytes are specified through corresponding arguments. More...
|
| |
| static String | ToString (const ArrayPtr< uint8_t > &value, int startIndex) |
| | Converts values of the specified byte array into their hexadecimal string representation starting at specified index. More...
|
| |
| static String | ToString (const ArrayPtr< uint8_t > &value, int startIndex, int length) |
| | Converts a range of values of the specified byte array into their hexadecimal string representation. More...
|
| |
| static int64_t | DoubleToInt64Bits (double value) |
| | Returns a 64-bit integer value whose binary representation is equal to binary representation of the specified double-precision floating point value. More...
|
| |
| static double | Int64BitsToDouble (int64_t value) |
| | Returns a double-precision floating point value whose value is equivalent to value. More...
|
| |
Contains methods that perform conversions of sequence of bytes to a value type and vice-versa. This is a static type with no instance services. You should never create instances of it by any means.
#include <system/bit_converter.h>
#include <system/smart_ptr.h>
template <typename T>
void Print(T arg)
{
std::cout << arg << ' ';
{
std::cout << std::hex << static_cast<int>(byte);
}
std::cout << std::endl;
}
int main()
{
int anInt = 1234567890;
double aDouble = 0.123456789;
Print(anInt);
Print(aDouble);
return 0;
}
static System::ArrayPtr< uint8_t > GetBytes(bool value)
Converts the specified boolean value into an array of bytes.
Definition: db_command.h:9