Files
DotNetAlpm/Alpm/File.cs
2020-04-30 20:42:46 -04:00

29 lines
689 B
C#

using System;
using System.Runtime.InteropServices;
namespace Foodsoft.Alpm
{
public readonly struct File
{
public string Name { get; }
public long Size { get; }
public uint Mode { get; }
[StructLayout(LayoutKind.Sequential)]
internal readonly unsafe struct NativeFile
{
internal readonly sbyte* Name;
internal readonly long size;
internal readonly uint mode;
}
internal unsafe File(IntPtr ptr)
{
var native = (NativeFile*) ptr;
Name = new string(native->Name);
Size = native->size;
Mode = native->mode;
}
}
}