1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-16 15:24:10 +02:00

String.ToConstNativeW

This commit is contained in:
Brian Fiete 2022-02-13 06:53:14 -05:00
parent 6c714bacdc
commit b341b6d3b4
3 changed files with 16 additions and 2 deletions

View file

@ -7,6 +7,7 @@ using System.Collections;
using System.Diagnostics;
using System.Text;
using System.Threading;
using System.Interop;
using System;
namespace System
@ -2450,6 +2451,16 @@ namespace System
buf
}
[Comptime(ConstEval=true)]
public Span<c_wchar> ToConstNativeW()
{
int encodedLen = UTF16.GetEncodedLen(this);
var buf = new char16[encodedLen + 1]* ( ? );
UTF16.Encode(this, buf, encodedLen);
buf[encodedLen] = 0;
return .(buf, encodedLen + 1);
}
public static bool Equals(char8* str1, char8* str2)
{
for (int i = 0; true; i++)