Empty the rest of Santizer into Utilities

This commit is contained in:
Matt Nadareski
2020-12-09 22:33:49 -08:00
parent 7e86b6914d
commit d4dce53906
24 changed files with 107 additions and 114 deletions

View File

@@ -311,7 +311,7 @@ namespace SabreTools.DatFiles.Formats
case "size":
if (item.ItemType == ItemType.Rom)
(item as Rom).Size = Sanitizer.CleanLong(attrVal);
(item as Rom).Size = Utilities.CleanLong(attrVal);
break;
case "crc":

View File

@@ -224,7 +224,7 @@ namespace SabreTools.DatFiles.Formats
break;
case "size":
item.Size = Sanitizer.CleanLong(attrVal);
item.Size = Utilities.CleanLong(attrVal);
break;
case "crc":

View File

@@ -151,7 +151,7 @@ namespace SabreTools.DatFiles.Formats
Rom rom = new Rom()
{
Name = romname,
Size = Sanitizer.CleanLong(split[0]),
Size = Utilities.CleanLong(split[0]),
CRC = CleanListromHashData(split[1]),
SHA1 = CleanListromHashData(split[2]),
@@ -199,7 +199,7 @@ namespace SabreTools.DatFiles.Formats
Rom rom = new Rom()
{
Name = romname,
Size = Sanitizer.CleanLong(split[0]),
Size = Utilities.CleanLong(split[0]),
CRC = CleanListromHashData(split[2]),
SHA1 = CleanListromHashData(split[3]),
ItemStatus = ItemStatus.BadDump,
@@ -225,7 +225,7 @@ namespace SabreTools.DatFiles.Formats
Rom rom = new Rom()
{
Name = romname,
Size = Sanitizer.CleanLong(split[0]),
Size = Utilities.CleanLong(split[0]),
ItemStatus = ItemStatus.Nodump,
Machine = new Machine

View File

@@ -393,7 +393,7 @@ namespace SabreTools.DatFiles.Formats
Name = reader.GetAttribute("name"),
Tag = reader.GetAttribute("tag"),
ChipType = reader.GetAttribute("type").AsChipType(),
Clock = Sanitizer.CleanLong(reader.GetAttribute("clock")),
Clock = Utilities.CleanLong(reader.GetAttribute("clock")),
Source = new Source
{
@@ -457,7 +457,7 @@ namespace SabreTools.DatFiles.Formats
DeviceType = reader.GetAttribute("type").AsDeviceType(),
Tag = reader.GetAttribute("tag"),
FixedImage = reader.GetAttribute("fixed_image"),
Mandatory = Sanitizer.CleanLong(reader.GetAttribute("mandatory")),
Mandatory = Utilities.CleanLong(reader.GetAttribute("mandatory")),
Interface = reader.GetAttribute("interface"),
Source = new Source
@@ -544,17 +544,17 @@ namespace SabreTools.DatFiles.Formats
{
Tag = reader.GetAttribute("tag"),
DisplayType = reader.GetAttribute("type").AsDisplayType(),
Rotate = Sanitizer.CleanLong(reader.GetAttribute("rotate")),
Rotate = Utilities.CleanLong(reader.GetAttribute("rotate")),
FlipX = reader.GetAttribute("flipx").AsYesNo(),
Width = Sanitizer.CleanLong(reader.GetAttribute("width")),
Height = Sanitizer.CleanLong(reader.GetAttribute("height")),
PixClock = Sanitizer.CleanLong(reader.GetAttribute("pixclock")),
HTotal = Sanitizer.CleanLong(reader.GetAttribute("htotal")),
HBEnd = Sanitizer.CleanLong(reader.GetAttribute("hbend")),
HBStart = Sanitizer.CleanLong(reader.GetAttribute("hbstart")),
VTotal = Sanitizer.CleanLong(reader.GetAttribute("vtotal")),
VBEnd = Sanitizer.CleanLong(reader.GetAttribute("vbend")),
VBStart = Sanitizer.CleanLong(reader.GetAttribute("vbstart")),
Width = Utilities.CleanLong(reader.GetAttribute("width")),
Height = Utilities.CleanLong(reader.GetAttribute("height")),
PixClock = Utilities.CleanLong(reader.GetAttribute("pixclock")),
HTotal = Utilities.CleanLong(reader.GetAttribute("htotal")),
HBEnd = Utilities.CleanLong(reader.GetAttribute("hbend")),
HBStart = Utilities.CleanLong(reader.GetAttribute("hbstart")),
VTotal = Utilities.CleanLong(reader.GetAttribute("vtotal")),
VBEnd = Utilities.CleanLong(reader.GetAttribute("vbend")),
VBStart = Utilities.CleanLong(reader.GetAttribute("vbstart")),
Source = new Source
{
@@ -615,8 +615,8 @@ namespace SabreTools.DatFiles.Formats
{
Service = reader.GetAttribute("service").AsYesNo(),
Tilt = reader.GetAttribute("tilt").AsYesNo(),
Players = Sanitizer.CleanLong(reader.GetAttribute("players")),
Coins = Sanitizer.CleanLong(reader.GetAttribute("coins")),
Players = Utilities.CleanLong(reader.GetAttribute("players")),
Coins = Utilities.CleanLong(reader.GetAttribute("coins")),
Source = new Source
{
@@ -676,7 +676,7 @@ namespace SabreTools.DatFiles.Formats
{
Name = reader.GetAttribute("name"),
Bios = reader.GetAttribute("bios"),
Size = Sanitizer.CleanLong(reader.GetAttribute("size")),
Size = Utilities.CleanLong(reader.GetAttribute("size")),
CRC = reader.GetAttribute("crc"),
SHA1 = reader.GetAttribute("sha1"),
MergeTag = reader.GetAttribute("merge"),
@@ -752,7 +752,7 @@ namespace SabreTools.DatFiles.Formats
case "sound":
var sound = new Sound
{
Channels = Sanitizer.CleanLong(reader.GetAttribute("channels")),
Channels = Utilities.CleanLong(reader.GetAttribute("channels")),
Source = new Source
{
@@ -883,13 +883,13 @@ namespace SabreTools.DatFiles.Formats
var control = new Control
{
ControlType = reader.GetAttribute("type").AsControlType(),
Player = Sanitizer.CleanLong(reader.GetAttribute("player")),
Buttons = Sanitizer.CleanLong(reader.GetAttribute("buttons")),
RequiredButtons = Sanitizer.CleanLong(reader.GetAttribute("reqbuttons")),
Minimum = Sanitizer.CleanLong(reader.GetAttribute("minimum")),
Maximum = Sanitizer.CleanLong(reader.GetAttribute("maximum")),
Sensitivity = Sanitizer.CleanLong(reader.GetAttribute("sensitivity")),
KeyDelta = Sanitizer.CleanLong(reader.GetAttribute("keydelta")),
Player = Utilities.CleanLong(reader.GetAttribute("player")),
Buttons = Utilities.CleanLong(reader.GetAttribute("buttons")),
RequiredButtons = Utilities.CleanLong(reader.GetAttribute("reqbuttons")),
Minimum = Utilities.CleanLong(reader.GetAttribute("minimum")),
Maximum = Utilities.CleanLong(reader.GetAttribute("maximum")),
Sensitivity = Utilities.CleanLong(reader.GetAttribute("sensitivity")),
KeyDelta = Utilities.CleanLong(reader.GetAttribute("keydelta")),
Reverse = reader.GetAttribute("reverse").AsYesNo(),
Ways = reader.GetAttribute("ways"),
Ways2 = reader.GetAttribute("ways2"),
@@ -957,7 +957,7 @@ namespace SabreTools.DatFiles.Formats
var dipLocation = new Location
{
Name = reader.GetAttribute("name"),
Number = Sanitizer.CleanLong(reader.GetAttribute("number")),
Number = Utilities.CleanLong(reader.GetAttribute("number")),
Inverted = reader.GetAttribute("inverted").AsYesNo()
};
@@ -1089,7 +1089,7 @@ namespace SabreTools.DatFiles.Formats
var confLocation = new Location
{
Name = reader.GetAttribute("name"),
Number = Sanitizer.CleanLong(reader.GetAttribute("number")),
Number = Utilities.CleanLong(reader.GetAttribute("number")),
Inverted = reader.GetAttribute("inverted").AsYesNo()
};

View File

@@ -609,7 +609,7 @@ namespace SabreTools.DatFiles.Formats
DatItem rom = new Rom
{
Name = reader.GetAttribute("name"),
Size = Sanitizer.CleanLong(reader.GetAttribute("size")),
Size = Utilities.CleanLong(reader.GetAttribute("size")),
CRC = reader.GetAttribute("crc"),
MD5 = reader.GetAttribute("md5"),
#if NET_FRAMEWORK

View File

@@ -526,7 +526,7 @@ namespace SabreTools.DatFiles.Formats
break;
case "romsize":
size = Sanitizer.CleanLong(reader.ReadElementContentAsString());
size = Utilities.CleanLong(reader.ReadElementContentAsString());
break;
case "publisher":

View File

@@ -338,7 +338,7 @@ namespace SabreTools.DatFiles.Formats
Rom rom = new Rom
{
Name = rominfo[5],
Size = Sanitizer.CleanLong(rominfo[7]),
Size = Utilities.CleanLong(rominfo[7]),
CRC = rominfo[6],
ItemStatus = ItemStatus.None,

View File

@@ -337,8 +337,8 @@ namespace SabreTools.DatFiles.Formats
var dataArea = new DataArea
{
Name = reader.GetAttribute("name"),
Size = Sanitizer.CleanLong(reader.GetAttribute("size")),
Width = Sanitizer.CleanLong(reader.GetAttribute("width")),
Size = Utilities.CleanLong(reader.GetAttribute("size")),
Width = Utilities.CleanLong(reader.GetAttribute("width")),
Endianness = reader.GetAttribute("endianness").AsEndianness(),
};
@@ -464,7 +464,7 @@ namespace SabreTools.DatFiles.Formats
var rom = new Rom
{
Name = reader.GetAttribute("name"),
Size = Sanitizer.CleanLong(reader.GetAttribute("size")),
Size = Utilities.CleanLong(reader.GetAttribute("size")),
CRC = reader.GetAttribute("crc"),
SHA1 = reader.GetAttribute("sha1"),
Offset = reader.GetAttribute("offset"),