checkpoint
This commit is contained in:
35
Alpm/UTF8OutMarshaler.cs
Normal file
35
Alpm/UTF8OutMarshaler.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace Foodsoft.Alpm
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
|
||||
internal readonly struct UTF8OutMarshaler : ICustomMarshaler
|
||||
{
|
||||
private static readonly UTF8OutMarshaler _instance = default;
|
||||
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once UnusedParameter.Local
|
||||
private static ICustomMarshaler GetInstance(string cookie)
|
||||
{
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public void CleanUpManagedData(object managedObj) { }
|
||||
|
||||
public void CleanUpNativeData(IntPtr pNativeData) { }
|
||||
|
||||
public int GetNativeDataSize() => -1;
|
||||
|
||||
public object MarshalNativeToManaged(IntPtr pNativeData)
|
||||
{
|
||||
return Marshal.PtrToStringUTF8(pNativeData)!;
|
||||
}
|
||||
|
||||
public IntPtr MarshalManagedToNative(object managedObj)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user