mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-04-05 17:37:51 +08:00
36 lines
583 B
C#
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}]";
|
|
}
|
|
}
|
|
}
|