Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Codegen should produce friendly string overloads #286

Closed
AArnott opened this issue Sep 12, 2016 · 2 comments
Closed

Codegen should produce friendly string overloads #286

AArnott opened this issue Sep 12, 2016 · 2 comments
Assignees

Comments

@AArnott
Copy link
Collaborator

AArnott commented Sep 12, 2016

As @vbfox said:

Always generating StringBuilder for "out + char_" and string for "in + char_" seem like good defaults

@AArnott
Copy link
Collaborator Author

AArnott commented Dec 24, 2019

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.

@AArnott
Copy link
Collaborator Author

AArnott commented Oct 27, 2020

We should also audit all the extern methods that accept string to consider revising them to use [Friendly(FriendlyFlags.In | FriendlyFlags.Array)] char* instead.

@AArnott AArnott closed this as completed Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant