MCPcopy Create free account
hub / github.com/crazytuzi/UnrealCSharp / GetString

Method GetString

Script/Interop/Bridge/StringBridge.cs:19–43  ·  view source on GitHub ↗
(nint InHandle, char* InBuffer, int InSize)

Source from the content-addressed store, hash-verified

17 }
18
19 [UnmanagedCallersOnly]
20 public static int GetString(nint InHandle, char* InBuffer, int InSize)
21 {
22 if (InBuffer != null && InSize > 0)
23 {
24 if (HandleData.GetObject(InHandle) is string String)
25 {
26 var Length = String.Length;
27
28 if (Length < InSize)
29 {
30 fixed (char* Ptr = String)
31 {
32 Buffer.MemoryCopy(Ptr, InBuffer, (InSize - 1) * sizeof(char), Length * sizeof(char));
33 }
34
35 InBuffer[Length] = '\0';
36
37 return Length;
38 }
39 }
40 }
41
42 return -1;
43 }
44 }
45}

Callers

nothing calls this directly

Calls 1

GetObjectMethod · 0.45

Tested by

no test coverage detected