refactor: 更改为 XdbVersion
This commit is contained in:
parent
7fab19c46f
commit
4f39707beb
|
|
@ -1,20 +0,0 @@
|
||||||
using System.Buffers.Binary;
|
|
||||||
|
|
||||||
namespace IP2Region.Net.XDB;
|
|
||||||
|
|
||||||
public struct Version
|
|
||||||
{
|
|
||||||
public int IndexSize { get; set; }
|
|
||||||
|
|
||||||
public int Length { get; set; }
|
|
||||||
|
|
||||||
public uint GetVectorIndexStartPos(ReadOnlyMemory<byte> buffer)
|
|
||||||
{
|
|
||||||
return BinaryPrimitives.ReadUInt32LittleEndian(buffer.Span);
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint GetVectorIndexEndPos(ReadOnlyMemory<byte> buffer)
|
|
||||||
{
|
|
||||||
return BinaryPrimitives.ReadUInt32LittleEndian(buffer.Slice(Length).Span);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
namespace IP2Region.Net.XDB;
|
||||||
|
|
||||||
|
public record struct XdbVersion
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 版本号
|
||||||
|
/// </summary>
|
||||||
|
public ushort Ver { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 缓存策略
|
||||||
|
/// </summary>
|
||||||
|
public ushort CachePolice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 文件生成时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset CreatedTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 索引起始地址
|
||||||
|
/// </summary>
|
||||||
|
public uint StartIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 索引结束地址
|
||||||
|
/// </summary>
|
||||||
|
public uint EndIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 IP版本
|
||||||
|
/// </summary>
|
||||||
|
public ushort IPVer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 指针字节数
|
||||||
|
/// </summary>
|
||||||
|
public ushort BytesCount { get; set; }
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue