14 throw gcnew ArgumentNullException(
"memory");
17 return gcnew array<int>(0);
19 array<int>^ arr = gcnew array<int>(count);
21 pin_ptr<int> arrPin = &arr[0];
23 memcpy_s(arrPin, count *
sizeof(
int), memory, count *
sizeof(
int));
30 throw gcnew ArgumentNullException(
"memory");
34 return gcnew array<int>(0);
37 array<int>^ arr = gcnew array<int>(count);
39 for (
int i = 0; i < count; i++) {
40 arr[i] =
static_cast<int>(memory[i]);
48 throw gcnew ArgumentNullException(
"memory");
52 return gcnew array<uint8_t>(0);
55 array<uint8_t>^ arr = gcnew array<uint8_t>(count);
57 pin_ptr<uint8_t> arrPin = &arr[0];
59 memcpy_s(arrPin, count *
sizeof(uint8_t), memory, count *
sizeof(uint8_t));
66 throw gcnew ArgumentNullException(
"memory");
70 return gcnew array<uint16_t>(0);
73 array<uint16_t>^ arr = gcnew array<uint16_t>(count);
75 pin_ptr<uint16_t> arrPin = &arr[0];
77 memcpy_s(arrPin, count *
sizeof(uint16_t), memory, count *
sizeof(uint16_t));
84 throw gcnew ArgumentNullException(
"memory");
88 return gcnew array<std::uint32_t>(0);
91 array<std::uint32_t>^ arr = gcnew array<std::uint32_t>(count);
93 pin_ptr<std::uint32_t> arrPin = &arr[0];
95 memcpy_s(arrPin, count *
sizeof(std::uint32_t), memory, count *
sizeof(std::uint32_t));
102 throw gcnew ArgumentNullException(
"memory");
105 return gcnew array<double>(0);
107 array<double>^ arr = gcnew array<double>(count);
109 pin_ptr<double> arrPin = &arr[0];
110 memcpy_s(arrPin, count *
sizeof(
double), memory, count *
sizeof(
double));
116 throw gcnew ArgumentNullException(
"memory");
119 return gcnew array<float>(0);
121 array<float>^ arr = gcnew array<float>(count);
123 pin_ptr<float> arrPin = &arr[0];
124 memcpy_s(arrPin, count *
sizeof(
float), memory, count *
sizeof(
float));
130 throw gcnew ArgumentNullException(
"memory");
133 return gcnew array<unsigned char>(0);
135 array<unsigned char>^ arr = gcnew array<unsigned char>(count);
137 pin_ptr<unsigned char> arrPin = &arr[0];
138 memcpy_s(arrPin, count *
sizeof(
unsigned char), memory, count *
sizeof(
unsigned char));
144 throw gcnew ArgumentNullException(
"memory");
147 return gcnew array<char>(0);
149 array<char>^ arr = gcnew array<char>(count);
151 pin_ptr<char> arrPin = &arr[0];
152 memcpy_s(arrPin, count *
sizeof(
char), memory, count *
sizeof(
char));
158 return Marshal::PtrToStringAnsi((IntPtr)(
char*)
string);
163 return (
char*)Marshal::StringToHGlobalAnsi(
string).ToPointer();
168 const char* str = (
const char*)(Marshal::StringToHGlobalAnsi(
string)).ToPointer();
static array< int > LongToIntegerManagedArray(long *memory, int count)
Definition Utility.h:28
static array< unsigned char > UCharManagedArray(unsigned char *memory, int count)
Definition Utility.h:128
static array< char > CharManagedArray(char *memory, int count)
Definition Utility.h:142
static array< int > IntegerManagedArray(int *memory, int count)
Definition Utility.h:12
static array< float > FloatManagedArray(float *memory, int count)
Definition Utility.h:114
static const char * string_to_char_array(String^ string)
Definition Utility.h:166
static array< unsigned char > UnsignedCharManagedArray(uint8_t *memory, int count)
Definition Utility.h:46
static array< uint16_t > UnsignedShortManagedArray(uint16_t *memory, int count)
Definition Utility.h:64
static String ToManagedString(const char *string)
Definition Utility.h:156
static array< double > DoubleManagedArray(double *memory, int count)
Definition Utility.h:100
static char * ToUnmanagedString(String^ string)
Definition Utility.h:161
static array< std::uint32_t > UnsignedIntegerManagedArray(std::uint32_t *memory, int count)
Definition Utility.h:82