Namespace: WCharT
API:
//Buffer is created manually by user to support max flexibility from ReadOnlySpan
string Buffer.ReadString(ReadOnlySpan<WCharT>)
string Buffer.ReadStringNullTerminated(WCharT*);
void Buffer.Fill(string, Span<WCharT>);
int Buffer.GetSize(string); //some Unicode emojis can be 2 characters long.
[WcharT.String("Test")] //Generates code, separate DLL?
ReadOnlySpan<WCharT> WcharT.Strings.Test //Generated property
...
API ideas:
Namespace: WCharT
API:
stackallocLibraryImportis doing string marshalling especially in regard to length determination. (It uses a source generator so it is easy to look at the code).stringis Unicode but probably misses the null terminationWCharT*is read to avoid getting the length before actual conversion? A loop could read char by char.API ideas: