CppSharp icon indicating copy to clipboard operation
CppSharp copied to clipboard

Wrap pointer to array and array size to plain C# array

Open hellozyemlya opened this issue 2 years ago • 1 comments

Brief Description

Is it possible to instruct CppSharp to wrap pair of (unsigned char* elements, size_t size) arguments as byte[] type in C#.

Used headers

void DoTheBestJobEver(unsigned char* elements, size_t size);

Expected C# signature

void DoTheBestJobEver(byte[] elements);

hellozyemlya avatar Nov 11 '22 13:11 hellozyemlya

Not right now, but it would be possible to either add a new pass for this to your project or contribute it to the core.

Another option is to just extend the bindings with an extension method to do this.

tritao avatar Nov 11 '22 18:11 tritao