2016-06-10 01:38:58 -07:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2016-05-16 11:59:33 -07:00
|
|
|
|
|
|
|
|
|
|
namespace SabreTools.Helper
|
2016-04-12 15:03:47 -07:00
|
|
|
|
{
|
2016-08-29 14:43:31 -07:00
|
|
|
|
#region Hash-to-Dat structs [Currently Unused]
|
|
|
|
|
|
|
|
|
|
|
|
/* Thought experiment
|
|
|
|
|
|
|
|
|
|
|
|
So, here's a connundrum: Should the internal structure of how DATs work (down to the hash level) mirror
|
|
|
|
|
|
how people see it (Dat to multiple games, game to multiple roms, rom to single hash) or
|
|
|
|
|
|
should it more closely mirror real life (Hash to multiple roms, rom to multiple games, game to single DAT)
|
|
|
|
|
|
|
|
|
|
|
|
If I use the "how people see it":
|
|
|
|
|
|
Things are pretty much how they are now with redundant data and the like
|
|
|
|
|
|
It makes sense to write things out to file, though. And life is easier when output is easier.
|
|
|
|
|
|
No code changes (big plus!)
|
|
|
|
|
|
|
|
|
|
|
|
If I use the "how it is":
|
|
|
|
|
|
Less data is likely to be mirrored
|
|
|
|
|
|
Refs to DAT files are possible so that there aren't duplicates
|
|
|
|
|
|
A lot of code will have to change...
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding and processing Hash data (NEW SYSTEM)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public struct HashData
|
|
|
|
|
|
{
|
|
|
|
|
|
public long Size;
|
|
|
|
|
|
public string CRC;
|
|
|
|
|
|
public string MD5;
|
|
|
|
|
|
public string SHA1;
|
|
|
|
|
|
public List<RomData> Roms;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding and processing Rom data (NEW SYSTEM)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public struct RomData
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
public ItemType Type;
|
|
|
|
|
|
public bool Nodump;
|
|
|
|
|
|
public string Date;
|
|
|
|
|
|
public List<MachineData> Machines;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding and processing Game/Machine data (NEW SYSTEM)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public struct MachineData
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
public string Comment;
|
|
|
|
|
|
public string Description;
|
|
|
|
|
|
public string Year;
|
|
|
|
|
|
public string Manufacturer;
|
|
|
|
|
|
public string RomOf;
|
|
|
|
|
|
public string CloneOf;
|
|
|
|
|
|
public string SampleOf;
|
|
|
|
|
|
public string SourceFile;
|
|
|
|
|
|
public bool IsBios;
|
|
|
|
|
|
public string Board;
|
|
|
|
|
|
public string RebuildTo;
|
|
|
|
|
|
public bool TorrentZipped;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding and processing DAT data (NEW SYSTEM)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public struct DatData
|
|
|
|
|
|
{
|
|
|
|
|
|
// Data common to most DAT types
|
|
|
|
|
|
public string FileName;
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
public string Description;
|
|
|
|
|
|
public string RootDir;
|
|
|
|
|
|
public string Category;
|
|
|
|
|
|
public string Version;
|
|
|
|
|
|
public string Date;
|
|
|
|
|
|
public string Author;
|
|
|
|
|
|
public string Email;
|
|
|
|
|
|
public string Homepage;
|
|
|
|
|
|
public string Url;
|
|
|
|
|
|
public string Comment;
|
|
|
|
|
|
public string Header;
|
|
|
|
|
|
public string Type; // Generally only used for SuperDAT
|
|
|
|
|
|
public ForceMerging ForceMerging;
|
|
|
|
|
|
public ForceNodump ForceNodump;
|
|
|
|
|
|
public ForcePacking ForcePacking;
|
|
|
|
|
|
public OutputFormat OutputFormat;
|
|
|
|
|
|
public bool MergeRoms;
|
|
|
|
|
|
|
|
|
|
|
|
// Data specific to the Miss DAT type
|
|
|
|
|
|
public bool UseGame;
|
|
|
|
|
|
public string Prefix;
|
|
|
|
|
|
public string Postfix;
|
|
|
|
|
|
public bool Quotes;
|
|
|
|
|
|
public string RepExt;
|
|
|
|
|
|
public string AddExt;
|
|
|
|
|
|
public bool GameName;
|
|
|
|
|
|
public bool Romba;
|
|
|
|
|
|
public bool? XSV; // true for tab-deliminated output, false for comma-deliminated output
|
|
|
|
|
|
|
|
|
|
|
|
// Statistical data related to the DAT
|
|
|
|
|
|
public long RomCount;
|
|
|
|
|
|
public long DiskCount;
|
|
|
|
|
|
public long TotalSize;
|
|
|
|
|
|
public long CRCCount;
|
|
|
|
|
|
public long MD5Count;
|
|
|
|
|
|
public long SHA1Count;
|
|
|
|
|
|
public long NodumpCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Dat-to-Hash structs
|
|
|
|
|
|
|
2016-08-29 13:05:32 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding and processing hash data
|
|
|
|
|
|
/// </summary>
|
2016-08-29 14:43:31 -07:00
|
|
|
|
public struct Hash : IEquatable<Hash>
|
2016-08-29 13:05:32 -07:00
|
|
|
|
{
|
|
|
|
|
|
public long Size;
|
|
|
|
|
|
public string CRC;
|
|
|
|
|
|
public string MD5;
|
|
|
|
|
|
public string SHA1;
|
|
|
|
|
|
|
2016-08-29 14:43:31 -07:00
|
|
|
|
public bool Equals(Hash other)
|
2016-08-29 13:05:32 -07:00
|
|
|
|
{
|
2016-08-29 13:23:47 -07:00
|
|
|
|
return this.Equals(other, false);
|
2016-08-29 13:05:32 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-08-29 14:43:31 -07:00
|
|
|
|
public bool Equals(Hash other, bool IsDisk)
|
2016-08-29 13:05:32 -07:00
|
|
|
|
{
|
2016-08-29 13:23:47 -07:00
|
|
|
|
bool equals = false;
|
2016-08-29 13:13:00 -07:00
|
|
|
|
|
2016-08-29 13:23:47 -07:00
|
|
|
|
if (!IsDisk &&
|
|
|
|
|
|
((String.IsNullOrEmpty(this.MD5) || String.IsNullOrEmpty(other.MD5)) || this.MD5 == other.MD5) &&
|
|
|
|
|
|
((String.IsNullOrEmpty(this.SHA1) || String.IsNullOrEmpty(other.SHA1)) || this.SHA1 == other.SHA1))
|
|
|
|
|
|
{
|
|
|
|
|
|
equals = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (!IsDisk &&
|
|
|
|
|
|
(this.Size == other.Size) &&
|
|
|
|
|
|
((String.IsNullOrEmpty(this.CRC) || String.IsNullOrEmpty(other.CRC)) || this.CRC == other.CRC) &&
|
|
|
|
|
|
((String.IsNullOrEmpty(this.MD5) || String.IsNullOrEmpty(other.MD5)) || this.MD5 == other.MD5) &&
|
|
|
|
|
|
((String.IsNullOrEmpty(this.SHA1) || String.IsNullOrEmpty(other.SHA1)) || this.SHA1 == other.SHA1))
|
|
|
|
|
|
{
|
|
|
|
|
|
equals = true;
|
2016-08-29 13:13:00 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-08-29 13:23:47 -07:00
|
|
|
|
return equals;
|
2016-08-29 13:05:32 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-12 15:03:47 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding and processing rom data
|
|
|
|
|
|
/// </summary>
|
2016-08-29 13:57:46 -07:00
|
|
|
|
public struct Rom : IComparable, IEquatable<Rom>
|
2016-04-12 15:03:47 -07:00
|
|
|
|
{
|
2016-08-29 13:42:27 -07:00
|
|
|
|
public Machine Machine;
|
2016-04-12 15:03:47 -07:00
|
|
|
|
public string Name;
|
2016-08-29 13:50:55 -07:00
|
|
|
|
public ItemType Type;
|
2016-08-29 14:43:31 -07:00
|
|
|
|
public Hash HashData;
|
2016-05-10 20:55:51 -07:00
|
|
|
|
public DupeType Dupe;
|
2016-05-18 16:59:34 -07:00
|
|
|
|
public bool Nodump;
|
2016-05-20 10:21:24 -07:00
|
|
|
|
public string Date;
|
2016-06-16 17:27:32 -07:00
|
|
|
|
public SourceMetadata Metadata;
|
2016-06-16 10:42:35 -07:00
|
|
|
|
|
|
|
|
|
|
public int CompareTo(object obj)
|
|
|
|
|
|
{
|
2016-07-12 10:42:29 -07:00
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
2016-06-16 10:42:35 -07:00
|
|
|
|
try
|
|
|
|
|
|
{
|
2016-08-29 13:57:46 -07:00
|
|
|
|
Rom comp = (Rom)obj;
|
2016-06-16 10:48:12 -07:00
|
|
|
|
|
2016-08-29 13:42:27 -07:00
|
|
|
|
if (this.Machine.Name == comp.Machine.Name)
|
2016-06-16 10:42:35 -07:00
|
|
|
|
{
|
2016-06-16 10:52:31 -07:00
|
|
|
|
if (this.Name == comp.Name)
|
2016-06-16 10:48:12 -07:00
|
|
|
|
{
|
2016-08-29 14:43:31 -07:00
|
|
|
|
ret = (this.Equals(comp) ? 0 : 1);
|
2016-06-16 10:48:12 -07:00
|
|
|
|
}
|
2016-07-12 10:42:29 -07:00
|
|
|
|
ret = String.Compare(this.Name, comp.Name);
|
2016-06-16 10:42:35 -07:00
|
|
|
|
}
|
2016-08-29 13:42:27 -07:00
|
|
|
|
ret = String.Compare(this.Machine.Name, comp.Machine.Name);
|
2016-06-16 10:42:35 -07:00
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
2016-07-12 10:42:29 -07:00
|
|
|
|
ret = 1;
|
2016-06-16 10:42:35 -07:00
|
|
|
|
}
|
2016-07-12 10:42:29 -07:00
|
|
|
|
|
|
|
|
|
|
return ret;
|
2016-06-16 10:42:35 -07:00
|
|
|
|
}
|
2016-06-16 10:52:31 -07:00
|
|
|
|
|
2016-08-29 13:57:46 -07:00
|
|
|
|
public bool Equals(Rom other)
|
2016-06-16 10:52:31 -07:00
|
|
|
|
{
|
2016-08-29 14:08:10 -07:00
|
|
|
|
bool dupefound = false;
|
2016-07-12 10:42:29 -07:00
|
|
|
|
|
2016-08-29 14:08:10 -07:00
|
|
|
|
// If either is a nodump, it's never a match
|
|
|
|
|
|
if (this.Nodump || other.Nodump)
|
|
|
|
|
|
{
|
|
|
|
|
|
return dupefound;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.Type == ItemType.Rom && other.Type == ItemType.Rom)
|
|
|
|
|
|
{
|
|
|
|
|
|
dupefound = this.HashData.Equals(other.HashData, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.Type == ItemType.Disk && other.Type == ItemType.Disk)
|
|
|
|
|
|
{
|
|
|
|
|
|
dupefound = this.HashData.Equals(other.HashData, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (this.Machine.Equals(other.Machine) &&
|
2016-06-16 10:52:31 -07:00
|
|
|
|
this.Name == other.Name &&
|
2016-08-29 14:08:10 -07:00
|
|
|
|
dupefound);
|
2016-06-16 10:52:31 -07:00
|
|
|
|
}
|
2016-04-12 15:03:47 -07:00
|
|
|
|
}
|
2016-05-15 14:34:06 -07:00
|
|
|
|
|
2016-06-16 17:17:29 -07:00
|
|
|
|
/// <summary>
|
2016-06-16 17:27:32 -07:00
|
|
|
|
/// Intermediate metadata kept with a RomData object representing source information
|
2016-06-16 17:17:29 -07:00
|
|
|
|
/// </summary>
|
2016-06-16 17:27:32 -07:00
|
|
|
|
public struct SourceMetadata
|
2016-06-16 17:17:29 -07:00
|
|
|
|
{
|
2016-06-16 17:27:32 -07:00
|
|
|
|
public int SystemID;
|
|
|
|
|
|
public string System;
|
|
|
|
|
|
public int SourceID;
|
|
|
|
|
|
public string Source;
|
2016-06-16 17:17:29 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-08-29 13:41:42 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding and processing Rom/Machine data
|
|
|
|
|
|
/// </summary>
|
2016-08-29 14:08:10 -07:00
|
|
|
|
public struct Machine : IEquatable<Machine>
|
2016-08-29 13:41:42 -07:00
|
|
|
|
{
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
public string Comment;
|
|
|
|
|
|
public string Description;
|
|
|
|
|
|
public string Year;
|
|
|
|
|
|
public string Manufacturer;
|
|
|
|
|
|
public string RomOf;
|
|
|
|
|
|
public string CloneOf;
|
|
|
|
|
|
public string SampleOf;
|
|
|
|
|
|
public string SourceFile;
|
|
|
|
|
|
public bool IsBios;
|
|
|
|
|
|
public string Board;
|
|
|
|
|
|
public string RebuildTo;
|
2016-08-29 14:01:07 -07:00
|
|
|
|
public bool TorrentZipped;
|
2016-08-29 14:08:10 -07:00
|
|
|
|
|
|
|
|
|
|
public bool Equals(Machine other)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.Name == other.Name)
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2016-08-29 13:41:42 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-05-15 14:34:06 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding DAT information
|
|
|
|
|
|
/// </summary>
|
2016-06-16 18:57:34 -07:00
|
|
|
|
public struct Dat : ICloneable
|
2016-05-15 14:34:06 -07:00
|
|
|
|
{
|
2016-05-16 21:52:49 -07:00
|
|
|
|
// Data common to most DAT types
|
2016-05-25 11:11:54 -07:00
|
|
|
|
public string FileName;
|
2016-05-15 14:34:06 -07:00
|
|
|
|
public string Name;
|
|
|
|
|
|
public string Description;
|
2016-07-25 10:19:20 -07:00
|
|
|
|
public string RootDir;
|
2016-05-15 14:34:06 -07:00
|
|
|
|
public string Category;
|
|
|
|
|
|
public string Version;
|
|
|
|
|
|
public string Date;
|
|
|
|
|
|
public string Author;
|
|
|
|
|
|
public string Email;
|
|
|
|
|
|
public string Homepage;
|
|
|
|
|
|
public string Url;
|
|
|
|
|
|
public string Comment;
|
|
|
|
|
|
public string Header;
|
2016-05-17 11:23:06 -07:00
|
|
|
|
public string Type; // Generally only used for SuperDAT
|
2016-05-15 14:34:06 -07:00
|
|
|
|
public ForceMerging ForceMerging;
|
|
|
|
|
|
public ForceNodump ForceNodump;
|
|
|
|
|
|
public ForcePacking ForcePacking;
|
|
|
|
|
|
public OutputFormat OutputFormat;
|
2016-05-16 11:59:33 -07:00
|
|
|
|
public bool MergeRoms;
|
2016-08-29 13:57:46 -07:00
|
|
|
|
public Dictionary<string, List<Rom>> Files;
|
2016-05-16 21:52:49 -07:00
|
|
|
|
|
|
|
|
|
|
// Data specific to the Miss DAT type
|
|
|
|
|
|
public bool UseGame;
|
|
|
|
|
|
public string Prefix;
|
|
|
|
|
|
public string Postfix;
|
|
|
|
|
|
public bool Quotes;
|
|
|
|
|
|
public string RepExt;
|
|
|
|
|
|
public string AddExt;
|
|
|
|
|
|
public bool GameName;
|
|
|
|
|
|
public bool Romba;
|
2016-08-29 13:54:53 -07:00
|
|
|
|
public bool? XSV; // true for tab-deliminated output, false for comma-deliminated output
|
2016-05-31 23:34:19 -07:00
|
|
|
|
|
|
|
|
|
|
// Statistical data related to the DAT
|
|
|
|
|
|
public long RomCount;
|
|
|
|
|
|
public long DiskCount;
|
|
|
|
|
|
public long TotalSize;
|
|
|
|
|
|
public long CRCCount;
|
|
|
|
|
|
public long MD5Count;
|
|
|
|
|
|
public long SHA1Count;
|
|
|
|
|
|
public long NodumpCount;
|
2016-06-10 01:38:58 -07:00
|
|
|
|
|
|
|
|
|
|
public object Clone()
|
|
|
|
|
|
{
|
2016-06-16 18:57:34 -07:00
|
|
|
|
return new Dat
|
2016-06-10 01:38:58 -07:00
|
|
|
|
{
|
|
|
|
|
|
FileName = this.FileName,
|
|
|
|
|
|
Name = this.Name,
|
|
|
|
|
|
Description = this.Description,
|
2016-07-25 11:40:00 -07:00
|
|
|
|
RootDir = this.RootDir,
|
2016-06-10 01:38:58 -07:00
|
|
|
|
Category = this.Category,
|
|
|
|
|
|
Version = this.Version,
|
|
|
|
|
|
Date = this.Date,
|
|
|
|
|
|
Author = this.Author,
|
|
|
|
|
|
Email = this.Email,
|
|
|
|
|
|
Homepage = this.Homepage,
|
|
|
|
|
|
Url = this.Url,
|
|
|
|
|
|
Comment = this.Comment,
|
|
|
|
|
|
Header = this.Header,
|
|
|
|
|
|
Type = this.Type,
|
|
|
|
|
|
ForceMerging = this.ForceMerging,
|
|
|
|
|
|
ForceNodump = this.ForceNodump,
|
|
|
|
|
|
ForcePacking = this.ForcePacking,
|
|
|
|
|
|
OutputFormat = this.OutputFormat,
|
|
|
|
|
|
MergeRoms = this.MergeRoms,
|
2016-08-29 13:52:13 -07:00
|
|
|
|
Files = this.Files,
|
2016-06-10 01:38:58 -07:00
|
|
|
|
UseGame = this.UseGame,
|
|
|
|
|
|
Prefix = this.Prefix,
|
|
|
|
|
|
Postfix = this.Postfix,
|
|
|
|
|
|
Quotes = this.Quotes,
|
|
|
|
|
|
RepExt = this.RepExt,
|
|
|
|
|
|
AddExt = this.AddExt,
|
|
|
|
|
|
GameName = this.GameName,
|
|
|
|
|
|
Romba = this.Romba,
|
2016-08-29 13:54:53 -07:00
|
|
|
|
XSV = this.XSV,
|
2016-06-10 01:38:58 -07:00
|
|
|
|
RomCount = this.RomCount,
|
|
|
|
|
|
DiskCount = this.DiskCount,
|
|
|
|
|
|
TotalSize = this.TotalSize,
|
|
|
|
|
|
CRCCount = this.CRCCount,
|
|
|
|
|
|
MD5Count = this.MD5Count,
|
|
|
|
|
|
SHA1Count = this.SHA1Count,
|
|
|
|
|
|
NodumpCount = this.NodumpCount,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
2016-06-20 14:45:20 -07:00
|
|
|
|
|
|
|
|
|
|
public object CloneHeader()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new Dat
|
|
|
|
|
|
{
|
|
|
|
|
|
FileName = this.FileName,
|
|
|
|
|
|
Name = this.Name,
|
|
|
|
|
|
Description = this.Description,
|
2016-07-25 11:40:00 -07:00
|
|
|
|
RootDir = this.RootDir,
|
2016-06-20 14:45:20 -07:00
|
|
|
|
Category = this.Category,
|
|
|
|
|
|
Version = this.Version,
|
|
|
|
|
|
Date = this.Date,
|
|
|
|
|
|
Author = this.Author,
|
|
|
|
|
|
Email = this.Email,
|
|
|
|
|
|
Homepage = this.Homepage,
|
|
|
|
|
|
Url = this.Url,
|
|
|
|
|
|
Comment = this.Comment,
|
|
|
|
|
|
Header = this.Header,
|
|
|
|
|
|
Type = this.Type,
|
|
|
|
|
|
ForceMerging = this.ForceMerging,
|
|
|
|
|
|
ForceNodump = this.ForceNodump,
|
|
|
|
|
|
ForcePacking = this.ForcePacking,
|
|
|
|
|
|
OutputFormat = this.OutputFormat,
|
|
|
|
|
|
MergeRoms = this.MergeRoms,
|
2016-08-29 13:57:46 -07:00
|
|
|
|
Files = new Dictionary<string, List<Rom>>(),
|
2016-06-20 14:45:20 -07:00
|
|
|
|
UseGame = this.UseGame,
|
|
|
|
|
|
Prefix = this.Prefix,
|
|
|
|
|
|
Postfix = this.Postfix,
|
|
|
|
|
|
Quotes = this.Quotes,
|
|
|
|
|
|
RepExt = this.RepExt,
|
|
|
|
|
|
AddExt = this.AddExt,
|
|
|
|
|
|
GameName = this.GameName,
|
|
|
|
|
|
Romba = this.Romba,
|
2016-08-29 13:54:53 -07:00
|
|
|
|
XSV = this.XSV,
|
2016-06-20 14:45:20 -07:00
|
|
|
|
};
|
|
|
|
|
|
}
|
2016-05-15 14:34:06 -07:00
|
|
|
|
}
|
2016-06-16 19:36:05 -07:00
|
|
|
|
|
2016-08-29 14:43:31 -07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Skipper structs
|
|
|
|
|
|
|
2016-06-16 22:17:58 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding header skipper information
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public struct Skipper
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
public string Author;
|
|
|
|
|
|
public string Version;
|
|
|
|
|
|
public List<SkipperRule> Rules;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-06-16 19:36:05 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding header skipper rule information
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public struct SkipperRule
|
|
|
|
|
|
{
|
2016-06-16 22:17:58 -07:00
|
|
|
|
public long? StartOffset; // null is EOF
|
|
|
|
|
|
public long? EndOffset; // null if EOF
|
|
|
|
|
|
public HeaderSkipOperation Operation;
|
|
|
|
|
|
public List<SkipperTest> Tests;
|
2016-06-16 19:36:05 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Intermediate struct for holding header test information
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public struct SkipperTest
|
|
|
|
|
|
{
|
2016-06-16 22:17:58 -07:00
|
|
|
|
public HeaderSkipTest Type;
|
|
|
|
|
|
public long? Offset; // null is EOF
|
|
|
|
|
|
public byte[] Value;
|
|
|
|
|
|
public bool Result;
|
|
|
|
|
|
public byte[] Mask;
|
|
|
|
|
|
public long? Size; // null is PO2, "power of 2" filesize
|
|
|
|
|
|
public HeaderSkipTestFileOperator Operator;
|
2016-06-16 19:36:05 -07:00
|
|
|
|
}
|
2016-08-29 14:43:31 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2016-04-12 15:03:47 -07:00
|
|
|
|
}
|