DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
BitConverter.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "Common.h"
7#include "System/Object.h"
8#include "System/Array.h"
9#include "System/String.h"
10#include "System/Char.h"
11
12namespace DotNetDupe {
13 namespace System {
22 class BitConverter : public Object {
23 public:
25 DOTNETDUPE_API static const bool IsLittleEndian;
26
30 DOTNETDUPE_API static Array<byte> GetBytes(bool bValue);
31
35 DOTNETDUPE_API static Array<byte> GetBytes(char chValue);
36
40 DOTNETDUPE_API static Array<byte> GetBytes(double dValue);
41
45 DOTNETDUPE_API static Array<byte> GetBytes(short iValue);
46
50 DOTNETDUPE_API static Array<byte> GetBytes(int iValue);
51
55 DOTNETDUPE_API static Array<byte> GetBytes(long long llValue);
56
60 DOTNETDUPE_API static Array<byte> GetBytes(float fValue);
61
62 DOTNETDUPE_API static Array<byte> GetBytes(unsigned short iValue);
63 DOTNETDUPE_API static Array<byte> GetBytes(unsigned int iValue);
64 DOTNETDUPE_API static Array<byte> GetBytes(unsigned long long llValue);
65
69 DOTNETDUPE_API static bool ToBoolean(Array<byte>& arrValue, int iStartIndex);
70
71 DOTNETDUPE_API static char ToChar(Array<byte>& arrValue, int iStartIndex);
72 DOTNETDUPE_API static double ToDouble(Array<byte>& arrValue, int iStartIndex);
73 DOTNETDUPE_API static short ToInt16(Array<byte>& arrValue, int iStartIndex);
74 DOTNETDUPE_API static int ToInt32(Array<byte>& arrValue, int iStartIndex);
75 DOTNETDUPE_API static long long ToInt64(Array<byte>& arrValue, int iStartIndex);
76 DOTNETDUPE_API static float ToSingle(Array<byte>& arrValue, int iStartIndex);
77 DOTNETDUPE_API static unsigned short ToUInt16(Array<byte>& arrValue, int iStartIndex);
78 DOTNETDUPE_API static unsigned int ToUInt32(Array<byte>& arrValue, int iStartIndex);
79 DOTNETDUPE_API static unsigned long long ToUInt64(Array<byte>& arrValue, int iStartIndex);
80
84 DOTNETDUPE_API static String ToString(Array<byte>& arrValue);
85 DOTNETDUPE_API static String ToString(Array<byte>& arrValue, int iStartIndex);
86 DOTNETDUPE_API static String ToString(Array<byte>& arrValue, int iStartIndex, int iLength);
87
91 DOTNETDUPE_API static long long DoubleToInt64Bits(double dValue);
92
96 DOTNETDUPE_API static double Int64BitsToDouble(long long llValue);
97
101 DOTNETDUPE_API static int SingleToInt32Bits(float fValue);
102
106 DOTNETDUPE_API static float Int32BitsToSingle(int iValue);
107 };
108 }
109}
Provides methods for creating, manipulating, searching, and sorting arrays.
Represents a Unicode character code point mirroring .NET System.Char.
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Base object class for DotNetDupe mirroring .NET System.Object.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition Array.h:29
Converts base data types to arrays of bytes, and vice versa.
static int ToInt32(Array< byte > &arrValue, int iStartIndex)
static const bool IsLittleEndian
Indicates whether this computer architecture is little-endian.
static double ToDouble(Array< byte > &arrValue, int iStartIndex)
static float Int32BitsToSingle(int iValue)
Reinterprets the specified 32-bit signed integer bit pattern as a 32-bit single-precision floating po...
static unsigned short ToUInt16(Array< byte > &arrValue, int iStartIndex)
static unsigned int ToUInt32(Array< byte > &arrValue, int iStartIndex)
static float ToSingle(Array< byte > &arrValue, int iStartIndex)
static String ToString(Array< byte > &arrValue)
Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecima...
static bool ToBoolean(Array< byte > &arrValue, int iStartIndex)
Returns a Boolean value converted from one byte at a specified position in a byte array.
static unsigned long long ToUInt64(Array< byte > &arrValue, int iStartIndex)
static long long DoubleToInt64Bits(double dValue)
Converts the specified 64-bit double-precision floating point number to a 64-bit signed integer bit p...
static int SingleToInt32Bits(float fValue)
Converts the specified 32-bit single-precision floating point number to a 32-bit signed integer bit p...
static short ToInt16(Array< byte > &arrValue, int iStartIndex)
static double Int64BitsToDouble(long long llValue)
Reinterprets the specified 64-bit signed integer bit pattern as a 64-bit double-precision floating po...
static char ToChar(Array< byte > &arrValue, int iStartIndex)
static long long ToInt64(Array< byte > &arrValue, int iStartIndex)
static Array< byte > GetBytes(bool bValue)
Returns the specified Boolean value as a byte array.
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74