checkpoint

This commit is contained in:
2020-04-30 13:33:30 -04:00
parent 19a9fc06ba
commit 9bc522180d
21 changed files with 337 additions and 276 deletions

View File

@@ -0,0 +1,33 @@
using System;
using System.Runtime.InteropServices;
namespace Foodsoft.Alpm.Marshalling
{
internal readonly struct UTF8Return : ICustomMarshaler
{
private static readonly UTF8Return _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();
}
}
}