Files
cuetools.net/CUETools.CTDB/DBEntry.cs

62 lines
1.7 KiB
C#
Raw Normal View History

using System.Net;
using CUETools.AccurateRip;
using CUETools.CDImage;
namespace CUETools.CTDB
{
public class DBEntry
{
2011-10-27 20:50:11 +00:00
public ushort[,] syndrome;
public int conf;
public int stride;
public int offset;
public uint crc;
public bool hasErrors;
public bool canRecover;
public CDRepairFix repair;
public HttpStatusCode httpStatus;
2011-10-30 23:39:20 +00:00
public long id;
public CDImageLayout toc;
public string hasParity;
2011-10-30 23:39:20 +00:00
public DBEntry(ushort[,] syndrome, int conf, int stride, uint crc, long id, CDImageLayout toc, string hasParity)
{
2011-10-27 20:50:11 +00:00
this.syndrome = syndrome;
this.id = id;
this.conf = conf;
this.crc = crc;
this.stride = stride;
this.toc = toc;
this.hasParity = hasParity;
}
2011-10-27 20:50:11 +00:00
public int Npar
{
get
{
return syndrome.GetLength(1);
}
}
public string Status
{
get
{
if (!hasErrors)
{
return string.Format("verified OK, confidence {0}", conf);
}
if (canRecover)
{
return string.Format("differs in {1} samples, confidence {0}", conf, repair.CorrectableErrors);
}
if (httpStatus == HttpStatusCode.OK)
{
return "could not be verified";
}
return "could not be verified: " + httpStatus.ToString();
}
}
}
}