mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
24 lines
882 B
C#
24 lines
882 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
|
|
namespace Indy.IL2CPU.CustomImplementation.System {
|
|
public static class StringImpl {
|
|
[MethodAlias(Name = "System.String..ctor(System.Char[],System.Int32,System.Int32)")]
|
|
public static void Ctor(String aThis, [FieldAccess(Name = "$$Storage$$")]ref Char[] aStorage, Char[] aChars, int aStartIndex, int aLength) {
|
|
Char[] newChars = new Char[aLength];
|
|
Array.Copy(aChars, aStartIndex, newChars, 0, aLength);
|
|
aStorage = newChars;
|
|
}
|
|
|
|
[MethodAlias(Name = "System.String..ctor(System.Char[])")]
|
|
public static void Ctor(String aThis, [FieldAccess(Name = "$$Storage$$")] ref Char[] aStorage, Char[] aChars) {
|
|
aStorage = aChars;
|
|
}
|
|
|
|
[DllImport("test.dll")]
|
|
public static extern uint GetStorage(uint aString);
|
|
}
|
|
}
|