|
|
|
@@ -34,11 +34,9 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
/// <param name="keepext">True if original extension should be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="keepext">True if original extension should be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="useTags">True if tags from the DAT should be used to merge the output, false otherwise (default)</param>
|
|
|
|
/// <param name="useTags">True if tags from the DAT should be used to merge the output, false otherwise (default)</param>
|
|
|
|
public void Parse(string filename, int sysid, int srcid,
|
|
|
|
public void Parse(string filename, int sysid, int srcid, bool keep = false, bool clean = false, bool descAsName = false, bool keepext = false, bool useTags = false)
|
|
|
|
bool keep = false, bool clean = false, bool descAsName = false, bool keepext = false, bool useTags = false)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Parse(filename, sysid, srcid, new Filter(), SplitType.None, false, false, "",
|
|
|
|
Parse(filename, sysid, srcid, SplitType.None, keep: keep, clean: clean, descAsName: descAsName, keepext: keepext, useTags: useTags);
|
|
|
|
keep: keep, clean: clean, descAsName: descAsName, keepext: keepext, useTags: useTags);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
@@ -46,12 +44,8 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="splitType">Type of the split that should be performed (split, merged, fully merged)</param>
|
|
|
|
/// <param name="splitType">Type of the split that should be performed (split, merged, fully merged)</param>
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
@@ -63,14 +57,8 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
// Rom renaming
|
|
|
|
SplitType splitType,
|
|
|
|
SplitType splitType,
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool keep = false,
|
|
|
|
bool keep = false,
|
|
|
|
@@ -103,44 +91,44 @@ namespace SabreTools.Helper.Dats
|
|
|
|
switch (FileTools.GetDatFormat(filename))
|
|
|
|
switch (FileTools.GetDatFormat(filename))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case DatFormat.AttractMode:
|
|
|
|
case DatFormat.AttractMode:
|
|
|
|
ParseAttractMode(filename, sysid, srcid, filter, trim, single, root, keep, clean, descAsName);
|
|
|
|
ParseAttractMode(filename, sysid, srcid, keep, clean, descAsName);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.ClrMamePro:
|
|
|
|
case DatFormat.ClrMamePro:
|
|
|
|
case DatFormat.DOSCenter:
|
|
|
|
case DatFormat.DOSCenter:
|
|
|
|
ParseCMP(filename, sysid, srcid, filter, trim, single, root, keep, clean, descAsName);
|
|
|
|
ParseCMP(filename, sysid, srcid, keep, clean, descAsName);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.CSV:
|
|
|
|
case DatFormat.CSV:
|
|
|
|
ParseCSVTSV(filename, sysid, srcid, ',', filter, trim, single, root, keep, clean, descAsName);
|
|
|
|
ParseCSVTSV(filename, sysid, srcid, ',', keep, clean, descAsName);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.Logiqx:
|
|
|
|
case DatFormat.Logiqx:
|
|
|
|
case DatFormat.OfflineList:
|
|
|
|
case DatFormat.OfflineList:
|
|
|
|
case DatFormat.SabreDat:
|
|
|
|
case DatFormat.SabreDat:
|
|
|
|
case DatFormat.SoftwareList:
|
|
|
|
case DatFormat.SoftwareList:
|
|
|
|
ParseGenericXML(filename, sysid, srcid, filter, trim, single, root, keep, clean, descAsName);
|
|
|
|
ParseGenericXML(filename, sysid, srcid, keep, clean, descAsName);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.RedumpMD5:
|
|
|
|
case DatFormat.RedumpMD5:
|
|
|
|
ParseRedumpMD5(filename, sysid, srcid, filter, trim, single, root, clean);
|
|
|
|
ParseRedumpMD5(filename, sysid, srcid, clean);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.RedumpSFV:
|
|
|
|
case DatFormat.RedumpSFV:
|
|
|
|
ParseRedumpSFV(filename, sysid, srcid, filter, trim, single, root, clean);
|
|
|
|
ParseRedumpSFV(filename, sysid, srcid, clean);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.RedumpSHA1:
|
|
|
|
case DatFormat.RedumpSHA1:
|
|
|
|
ParseRedumpSHA1(filename, sysid, srcid, filter, trim, single, root, clean);
|
|
|
|
ParseRedumpSHA1(filename, sysid, srcid, clean);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.RedumpSHA256:
|
|
|
|
case DatFormat.RedumpSHA256:
|
|
|
|
ParseRedumpSHA256(filename, sysid, srcid, filter, trim, single, root, clean);
|
|
|
|
ParseRedumpSHA256(filename, sysid, srcid, clean);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.RedumpSHA384:
|
|
|
|
case DatFormat.RedumpSHA384:
|
|
|
|
ParseRedumpSHA384(filename, sysid, srcid, filter, trim, single, root, clean);
|
|
|
|
ParseRedumpSHA384(filename, sysid, srcid, clean);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.RedumpSHA512:
|
|
|
|
case DatFormat.RedumpSHA512:
|
|
|
|
ParseRedumpSHA512(filename, sysid, srcid, filter, trim, single, root, clean);
|
|
|
|
ParseRedumpSHA512(filename, sysid, srcid, clean);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.RomCenter:
|
|
|
|
case DatFormat.RomCenter:
|
|
|
|
ParseRC(filename, sysid, srcid, filter, trim, single, root, clean, descAsName);
|
|
|
|
ParseRC(filename, sysid, srcid, clean, descAsName);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DatFormat.TSV:
|
|
|
|
case DatFormat.TSV:
|
|
|
|
ParseCSVTSV(filename, sysid, srcid, '\t', filter, trim, single, root, keep, clean, descAsName);
|
|
|
|
ParseCSVTSV(filename, sysid, srcid, '\t', keep, clean, descAsName);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@@ -198,10 +186,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
@@ -211,14 +195,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool keep,
|
|
|
|
bool keep,
|
|
|
|
bool clean,
|
|
|
|
bool clean,
|
|
|
|
@@ -277,7 +253,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sr.Dispose();
|
|
|
|
sr.Dispose();
|
|
|
|
@@ -289,10 +265,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
@@ -302,14 +274,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool keep,
|
|
|
|
bool keep,
|
|
|
|
bool clean,
|
|
|
|
bool clean,
|
|
|
|
@@ -421,7 +385,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the sample
|
|
|
|
// Now process and add the sample
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
ParseAddHelper(item, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(item, clean, out key);
|
|
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -506,7 +470,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
ParseAddHelper(item, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(item, clean, out key);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -719,7 +683,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
ParseAddHelper(item, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(item, clean, out key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// If the line is anything but a rom or disk and we're in a block
|
|
|
|
// If the line is anything but a rom or disk and we're in a block
|
|
|
|
@@ -904,10 +868,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="delim">Delimiter for parsing individual lines</param>
|
|
|
|
/// <param name="delim">Delimiter for parsing individual lines</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if SL XML names should be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if SL XML names should be kept, false otherwise (default)</param>
|
|
|
|
@@ -918,14 +878,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
char delim,
|
|
|
|
char delim,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool keep,
|
|
|
|
bool keep,
|
|
|
|
bool clean,
|
|
|
|
bool clean,
|
|
|
|
@@ -1164,7 +1116,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ParseAddHelper(archive, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(archive, clean, out key);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ItemType.BiosSet:
|
|
|
|
case ItemType.BiosSet:
|
|
|
|
BiosSet biosset = new BiosSet()
|
|
|
|
BiosSet biosset = new BiosSet()
|
|
|
|
@@ -1178,7 +1130,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ParseAddHelper(biosset, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(biosset, clean, out key);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ItemType.Disk:
|
|
|
|
case ItemType.Disk:
|
|
|
|
Disk disk = new Disk()
|
|
|
|
Disk disk = new Disk()
|
|
|
|
@@ -1199,7 +1151,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
ItemStatus = status,
|
|
|
|
ItemStatus = status,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ParseAddHelper(disk, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(disk, clean, out key);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ItemType.Release:
|
|
|
|
case ItemType.Release:
|
|
|
|
Release release = new Release()
|
|
|
|
Release release = new Release()
|
|
|
|
@@ -1213,7 +1165,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ParseAddHelper(release, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(release, clean, out key);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ItemType.Rom:
|
|
|
|
case ItemType.Rom:
|
|
|
|
Rom rom = new Rom()
|
|
|
|
Rom rom = new Rom()
|
|
|
|
@@ -1236,7 +1188,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
ItemStatus = status,
|
|
|
|
ItemStatus = status,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(rom, clean, out key);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ItemType.Sample:
|
|
|
|
case ItemType.Sample:
|
|
|
|
Sample sample = new Sample()
|
|
|
|
Sample sample = new Sample()
|
|
|
|
@@ -1250,7 +1202,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ParseAddHelper(sample, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(sample, clean, out key);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -1262,10 +1214,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if SL XML names should be kept, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if SL XML names should be kept, false otherwise (default)</param>
|
|
|
|
@@ -1279,14 +1227,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool keep,
|
|
|
|
bool keep,
|
|
|
|
bool clean,
|
|
|
|
bool clean,
|
|
|
|
@@ -1325,7 +1265,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
Rom rom = new Rom("null", tempgame);
|
|
|
|
Rom rom = new Rom("null", tempgame);
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(rom, clean, out key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Regardless, end the current folder
|
|
|
|
// Regardless, end the current folder
|
|
|
|
@@ -1871,7 +1811,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(olrom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(olrom, clean, out key);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
// For Software List and MAME listxml only
|
|
|
|
// For Software List and MAME listxml only
|
|
|
|
@@ -1973,7 +1913,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(relrom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(relrom, clean, out key);
|
|
|
|
|
|
|
|
|
|
|
|
subreader.Read();
|
|
|
|
subreader.Read();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@@ -2016,7 +1956,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(biosrom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(biosrom, clean, out key);
|
|
|
|
|
|
|
|
|
|
|
|
subreader.Read();
|
|
|
|
subreader.Read();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@@ -2044,7 +1984,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(archiverom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(archiverom, clean, out key);
|
|
|
|
|
|
|
|
|
|
|
|
subreader.Read();
|
|
|
|
subreader.Read();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@@ -2072,7 +2012,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(samplerom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(samplerom, clean, out key);
|
|
|
|
|
|
|
|
|
|
|
|
subreader.Read();
|
|
|
|
subreader.Read();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@@ -2215,7 +2155,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(inrom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(inrom, clean, out key);
|
|
|
|
|
|
|
|
|
|
|
|
subreader.Read();
|
|
|
|
subreader.Read();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@@ -2390,7 +2330,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out key);
|
|
|
|
ParseAddHelper(rom, clean, out key);
|
|
|
|
|
|
|
|
|
|
|
|
xtr.Read();
|
|
|
|
xtr.Read();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@@ -2417,10 +2357,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
private void ParseRedumpMD5(
|
|
|
|
private void ParseRedumpMD5(
|
|
|
|
// Standard Dat parsing
|
|
|
|
// Standard Dat parsing
|
|
|
|
@@ -2428,14 +2364,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool clean)
|
|
|
|
bool clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -2464,7 +2392,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sr.Dispose();
|
|
|
|
sr.Dispose();
|
|
|
|
@@ -2476,10 +2404,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
private void ParseRedumpSFV(
|
|
|
|
private void ParseRedumpSFV(
|
|
|
|
// Standard Dat parsing
|
|
|
|
// Standard Dat parsing
|
|
|
|
@@ -2487,14 +2411,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool clean)
|
|
|
|
bool clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -2523,7 +2439,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sr.Dispose();
|
|
|
|
sr.Dispose();
|
|
|
|
@@ -2535,10 +2451,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
private void ParseRedumpSHA1(
|
|
|
|
private void ParseRedumpSHA1(
|
|
|
|
// Standard Dat parsing
|
|
|
|
// Standard Dat parsing
|
|
|
|
@@ -2546,14 +2458,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool clean)
|
|
|
|
bool clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -2582,7 +2486,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sr.Dispose();
|
|
|
|
sr.Dispose();
|
|
|
|
@@ -2594,10 +2498,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
private void ParseRedumpSHA256(
|
|
|
|
private void ParseRedumpSHA256(
|
|
|
|
// Standard Dat parsing
|
|
|
|
// Standard Dat parsing
|
|
|
|
@@ -2605,14 +2505,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool clean)
|
|
|
|
bool clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -2641,7 +2533,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sr.Dispose();
|
|
|
|
sr.Dispose();
|
|
|
|
@@ -2653,10 +2545,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
private void ParseRedumpSHA384(
|
|
|
|
private void ParseRedumpSHA384(
|
|
|
|
// Standard Dat parsing
|
|
|
|
// Standard Dat parsing
|
|
|
|
@@ -2664,14 +2552,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool clean)
|
|
|
|
bool clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -2700,7 +2580,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sr.Dispose();
|
|
|
|
sr.Dispose();
|
|
|
|
@@ -2712,10 +2592,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
private void ParseRedumpSHA512(
|
|
|
|
private void ParseRedumpSHA512(
|
|
|
|
// Standard Dat parsing
|
|
|
|
// Standard Dat parsing
|
|
|
|
@@ -2723,14 +2599,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool clean)
|
|
|
|
bool clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -2759,7 +2627,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sr.Dispose();
|
|
|
|
sr.Dispose();
|
|
|
|
@@ -2771,10 +2639,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="filename">Name of the file to be parsed</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="sysid">System ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="srcid">Source ID for the DAT</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
|
|
|
private void ParseRC(
|
|
|
|
private void ParseRC(
|
|
|
|
@@ -2783,14 +2647,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
int sysid,
|
|
|
|
int sysid,
|
|
|
|
int srcid,
|
|
|
|
int srcid,
|
|
|
|
|
|
|
|
|
|
|
|
// Rom filtering
|
|
|
|
|
|
|
|
Filter filter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rom renaming
|
|
|
|
|
|
|
|
bool trim,
|
|
|
|
|
|
|
|
bool single,
|
|
|
|
|
|
|
|
string root,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
// Miscellaneous
|
|
|
|
bool clean,
|
|
|
|
bool clean,
|
|
|
|
bool descAsName)
|
|
|
|
bool descAsName)
|
|
|
|
@@ -2931,7 +2787,7 @@ namespace SabreTools.Helper.Dats
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Now process and add the rom
|
|
|
|
// Now process and add the rom
|
|
|
|
ParseAddHelper(rom, filter, trim, single, root, clean, out string key);
|
|
|
|
ParseAddHelper(rom, clean, out string key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -2943,11 +2799,9 @@ namespace SabreTools.Helper.Dats
|
|
|
|
/// Add a rom to the Dat after checking
|
|
|
|
/// Add a rom to the Dat after checking
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="item">Item data to check against</param>
|
|
|
|
/// <param name="item">Item data to check against</param>
|
|
|
|
/// <param name="filter">Filter object for passing to the DatItem level</param>
|
|
|
|
/// <param name="clean">True if the names should be cleaned to WoD standards, false otherwise</param>
|
|
|
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
|
|
|
/// <param name="key">Output param containing the key for the item</param>
|
|
|
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
|
|
|
private void ParseAddHelper(DatItem item, bool clean, out string key)
|
|
|
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
|
|
|
|
|
|
|
private void ParseAddHelper(DatItem item, Filter filter, bool trim, bool single, string root, bool clean, out string key)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3046,28 +2900,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
item = itemDisk;
|
|
|
|
item = itemDisk;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// If the rom passes the filter, include it
|
|
|
|
|
|
|
|
if (filter.ItemPasses(item))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// If we are in single game mode, rename all games
|
|
|
|
|
|
|
|
if (single)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.Machine.Name = "!";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If we are in NTFS trim mode, trim the game name
|
|
|
|
|
|
|
|
if (trim)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Windows max name length is 260
|
|
|
|
|
|
|
|
int usableLength = 260 - item.Machine.Name.Length - root.Length;
|
|
|
|
|
|
|
|
if (item.Name.Length > usableLength)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string ext = Path.GetExtension(item.Name);
|
|
|
|
|
|
|
|
item.Name = item.Name.Substring(0, usableLength - ext.Length);
|
|
|
|
|
|
|
|
item.Name += ext;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the key and add statistical data
|
|
|
|
// Get the key and add statistical data
|
|
|
|
switch (item.Type)
|
|
|
|
switch (item.Type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -3120,7 +2952,6 @@ namespace SabreTools.Helper.Dats
|
|
|
|
// Add the item to the DAT
|
|
|
|
// Add the item to the DAT
|
|
|
|
Add(key, item);
|
|
|
|
Add(key, item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|