CPF/CPF.Mac/Mac/CoreFoundation/CFRange.cs
2023-11-21 23:05:03 +08:00

36 lines
583 B
C#

using System;
namespace CPF.Mac.CoreFoundation
{
public struct CFRange
{
private IntPtr loc;
private IntPtr len;
public int Location => loc.ToInt32();
public int Length => len.ToInt32();
public long LongLocation => loc.ToInt64();
public long LongLength => len.ToInt64();
public CFRange(int loc, int len)
{
this = new CFRange((long)loc, (long)len);
}
public CFRange(long l, long len)
{
loc = new IntPtr(l);
this.len = new IntPtr(len);
}
public override string ToString()
{
return $"CFRange [Location: {loc} Length: {len}]";
}
}
}