Closed AArnott closed 1 year ago
Unfortunately generating StringBuilder
overloads will be more complicated. It's not possible to get a pointer to its internal buffer (which may not even be contiguous!). The .NET interop marshaler does magic to make it work, which we'll have to re-implement in our 'friendly' methods.
Using string
for in parameters is straightforward, but there is exactly one method so far that defines a [Friendly(FriendlyFlags.In | FriendlyFlags.Array)] char*
parameter as required to get the new behavior, so we need to audit all the char*
parameters that are not decorated to see if they would benefit from the friendly attribute so they get a string
overload.
We should also audit all the extern
methods that accept string
to consider revising them to use [Friendly(FriendlyFlags.In | FriendlyFlags.Array)] char*
instead.
As @vbfox said: