mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2026-01-25 17:16:11 +00:00
47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace DbMaker
|
|
{
|
|
/// <summary>
|
|
/// data block class
|
|
/// </summary>
|
|
public class DataBlock
|
|
{
|
|
/// <summary>
|
|
/// construct method
|
|
/// </summary>
|
|
/// <param name="cityId"></param>
|
|
/// <param name="region"></param>
|
|
/// <param name="dataPtr"></param>
|
|
public DataBlock(int cityId, string region, int dataPtr)
|
|
{
|
|
CityId = cityId;
|
|
Region = region;
|
|
DataPtr = dataPtr;
|
|
}
|
|
|
|
public DataBlock(int cityId, string region) : this(cityId, region, 0)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// city id
|
|
/// </summary>
|
|
public int CityId { get; set; }
|
|
|
|
/// <summary>
|
|
/// region address
|
|
/// </summary>
|
|
public string Region { get; set; }
|
|
|
|
/// <summary>
|
|
/// region ptr in the db file
|
|
/// </summary>
|
|
public int DataPtr { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
return String.Join("|", this.CityId, this.Region, this.DataPtr);
|
|
}
|
|
}
|
|
} |