mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Update to NETStandard and NETCore, include 462 still
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.DatItems;
|
||||
@@ -5095,7 +5095,7 @@ namespace SabreTools.Library.DatFiles
|
||||
string expName = name.Replace("/", " - ").Replace("\\", " - ");
|
||||
|
||||
// Now set the new output values
|
||||
datFile.FileName = HttpUtility.HtmlDecode(String.IsNullOrWhiteSpace(name)
|
||||
datFile.FileName = WebUtility.HtmlDecode(String.IsNullOrWhiteSpace(name)
|
||||
? FileName
|
||||
: (shortname
|
||||
? Path.GetFileName(name)
|
||||
@@ -6039,7 +6039,7 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
DatFile lastdirdat = new DatFile
|
||||
{
|
||||
FileName = "DIR: " + HttpUtility.HtmlEncode(lastdir),
|
||||
FileName = "DIR: " + WebUtility.HtmlEncode(lastdir),
|
||||
_datStats = dirStats,
|
||||
};
|
||||
|
||||
@@ -6091,7 +6091,7 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
DatFile dirdat = new DatFile
|
||||
{
|
||||
FileName = "DIR: " + HttpUtility.HtmlEncode(lastdir),
|
||||
FileName = "DIR: " + WebUtility.HtmlEncode(lastdir),
|
||||
_datStats = dirStats,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
@@ -660,7 +660,7 @@ namespace SabreTools.Library.DatFiles
|
||||
try
|
||||
{
|
||||
string header = "<?xml version=\"1.0\"?>\n" +
|
||||
"<mame build=\"" + HttpUtility.HtmlEncode(Name) + "\"" +
|
||||
"<mame build=\"" + WebUtility.HtmlEncode(Name) + "\"" +
|
||||
// " debug=\"" + Debug + "\"" +
|
||||
// " mameconfig=\"" + MameConfig + "\"" +
|
||||
">\n\n";
|
||||
@@ -694,7 +694,7 @@ namespace SabreTools.Library.DatFiles
|
||||
rom.MachineName = rom.MachineName.Substring(1);
|
||||
}
|
||||
|
||||
string state = "\t<machine name=\"" + (!ExcludeFields[(int)Field.MachineName] ? HttpUtility.HtmlEncode(rom.MachineName) : "") + "\""
|
||||
string state = "\t<machine name=\"" + (!ExcludeFields[(int)Field.MachineName] ? WebUtility.HtmlEncode(rom.MachineName) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.SourceFile] && rom.SourceFile != null ? " sourcefile=\"" + rom.SourceFile + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MachineType] && (rom.MachineType & MachineType.Bios) != 0 ? " isbios=\"yes\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MachineType] && (rom.MachineType & MachineType.Device) != 0 ? " isdevice=\"yes\"" : "")
|
||||
@@ -704,23 +704,23 @@ namespace SabreTools.Library.DatFiles
|
||||
: (!ExcludeFields[(int)Field.Runnable] && rom.Runnable == false ? " runnable=\"no\"" : ""))
|
||||
+ (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) || (rom.MachineName.ToLowerInvariant() == rom.CloneOf.ToLowerInvariant())
|
||||
? ""
|
||||
: " cloneof=\"" + HttpUtility.HtmlEncode(rom.CloneOf) + "\"")
|
||||
: " cloneof=\"" + WebUtility.HtmlEncode(rom.CloneOf) + "\"")
|
||||
+ (!ExcludeFields[(int)Field.RomOf] && String.IsNullOrWhiteSpace(rom.RomOf) || (rom.MachineName.ToLowerInvariant() == rom.RomOf.ToLowerInvariant())
|
||||
? ""
|
||||
: " romof=\"" + HttpUtility.HtmlEncode(rom.RomOf) + "\"")
|
||||
: " romof=\"" + WebUtility.HtmlEncode(rom.RomOf) + "\"")
|
||||
+ (!ExcludeFields[(int)Field.SampleOf] && String.IsNullOrWhiteSpace(rom.SampleOf) || (rom.MachineName.ToLowerInvariant() == rom.SampleOf.ToLowerInvariant())
|
||||
? ""
|
||||
: " sampleof=\"" + HttpUtility.HtmlEncode(rom.SampleOf) + "\"")
|
||||
: " sampleof=\"" + WebUtility.HtmlEncode(rom.SampleOf) + "\"")
|
||||
+ ">\n"
|
||||
+ (!ExcludeFields[(int)Field.Description] ? "\t\t<description>" + HttpUtility.HtmlEncode(rom.MachineDescription) + "</description>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Year] && rom.Year != null ? "\t\t<year>" + HttpUtility.HtmlEncode(rom.Year) + "</year>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Publisher] && rom.Publisher != null ? "\t\t<publisher>" + HttpUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : "");
|
||||
+ (!ExcludeFields[(int)Field.Description] ? "\t\t<description>" + WebUtility.HtmlEncode(rom.MachineDescription) + "</description>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Year] && rom.Year != null ? "\t\t<year>" + WebUtility.HtmlEncode(rom.Year) + "</year>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Publisher] && rom.Publisher != null ? "\t\t<publisher>" + WebUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : "");
|
||||
|
||||
if (!ExcludeFields[(int)Field.Infos] && rom.Infos != null && rom.Infos.Count > 0)
|
||||
{
|
||||
foreach (Tuple<string, string> kvp in rom.Infos)
|
||||
{
|
||||
state += "\t\t<info name=\"" + HttpUtility.HtmlEncode(kvp.Item1) + "\" value=\"" + HttpUtility.HtmlEncode(kvp.Item2) + "\" />\n";
|
||||
state += "\t\t<info name=\"" + WebUtility.HtmlEncode(kvp.Item1) + "\" value=\"" + WebUtility.HtmlEncode(kvp.Item2) + "\" />\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,15 +788,15 @@ namespace SabreTools.Library.DatFiles
|
||||
case ItemType.Archive:
|
||||
break;
|
||||
case ItemType.BiosSet: // TODO: Separate out MachineDescription from Description
|
||||
state += "\t\t<biosset name\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Description] && !String.IsNullOrWhiteSpace(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||
state += "\t\t<biosset name\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Description] && !String.IsNullOrWhiteSpace(((BiosSet)rom).Description) ? " description=\"" + WebUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Default] && ((BiosSet)rom).Default != null
|
||||
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
||||
: "")
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Disk:
|
||||
state += "\t\t<disk name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "\t\t<disk name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA1] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA256] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA256) ? " sha256=\"" + ((Disk)rom).SHA256.ToLowerInvariant() + "\"" : "")
|
||||
@@ -814,7 +814,7 @@ namespace SabreTools.Library.DatFiles
|
||||
//TODO: Am I missing this?
|
||||
break;
|
||||
case ItemType.Rom:
|
||||
state += "\t\t<rom name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "\t\t<rom name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Size] && ((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.CRC] && !String.IsNullOrWhiteSpace(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
@@ -831,7 +831,7 @@ namespace SabreTools.Library.DatFiles
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Sample:
|
||||
state += "\t\t<sample name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "\t\t<sample name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ "/>\n";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
@@ -752,18 +752,18 @@ namespace SabreTools.Library.DatFiles
|
||||
"<!DOCTYPE datafile PUBLIC \"-//Logiqx//DTD ROM Management Datafile//EN\" \"http://www.logiqx.com/Dats/datafile.dtd\">\n\n" +
|
||||
"<datafile>\n" +
|
||||
"\t<header>\n" +
|
||||
"\t\t<name>" + HttpUtility.HtmlEncode(Name) + "</name>\n" +
|
||||
"\t\t<description>" + HttpUtility.HtmlEncode(Description) + "</description>\n" +
|
||||
(!String.IsNullOrWhiteSpace(RootDir) ? "\t\t<rootdir>" + HttpUtility.HtmlEncode(RootDir) + "</rootdir>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Category) ? "\t\t<category>" + HttpUtility.HtmlEncode(Category) + "</category>\n" : "") +
|
||||
"\t\t<version>" + HttpUtility.HtmlEncode(Version) + "</version>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Date) ? "\t\t<date>" + HttpUtility.HtmlEncode(Date) + "</date>\n" : "") +
|
||||
"\t\t<author>" + HttpUtility.HtmlEncode(Author) + "</author>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Email) ? "\t\t<email>" + HttpUtility.HtmlEncode(Email) + "</email>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Homepage) ? "\t\t<homepage>" + HttpUtility.HtmlEncode(Homepage) + "</homepage>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Url) ? "\t\t<url>" + HttpUtility.HtmlEncode(Url) + "</url>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Comment) ? "\t\t<comment>" + HttpUtility.HtmlEncode(Comment) + "</comment>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Type) ? "\t\t<type>" + HttpUtility.HtmlEncode(Type) + "</type>\n" : "") +
|
||||
"\t\t<name>" + WebUtility.HtmlEncode(Name) + "</name>\n" +
|
||||
"\t\t<description>" + WebUtility.HtmlEncode(Description) + "</description>\n" +
|
||||
(!String.IsNullOrWhiteSpace(RootDir) ? "\t\t<rootdir>" + WebUtility.HtmlEncode(RootDir) + "</rootdir>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Category) ? "\t\t<category>" + WebUtility.HtmlEncode(Category) + "</category>\n" : "") +
|
||||
"\t\t<version>" + WebUtility.HtmlEncode(Version) + "</version>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Date) ? "\t\t<date>" + WebUtility.HtmlEncode(Date) + "</date>\n" : "") +
|
||||
"\t\t<author>" + WebUtility.HtmlEncode(Author) + "</author>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Email) ? "\t\t<email>" + WebUtility.HtmlEncode(Email) + "</email>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Homepage) ? "\t\t<homepage>" + WebUtility.HtmlEncode(Homepage) + "</homepage>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Url) ? "\t\t<url>" + WebUtility.HtmlEncode(Url) + "</url>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Comment) ? "\t\t<comment>" + WebUtility.HtmlEncode(Comment) + "</comment>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Type) ? "\t\t<type>" + WebUtility.HtmlEncode(Type) + "</type>\n" : "") +
|
||||
(ForcePacking != ForcePacking.None || ForceMerging != ForceMerging.None || ForceNodump != ForceNodump.None || !String.IsNullOrWhiteSpace(Header) ?
|
||||
"\t\t<clrmamepro" +
|
||||
(ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : "") +
|
||||
@@ -809,7 +809,7 @@ namespace SabreTools.Library.DatFiles
|
||||
rom.MachineName = rom.MachineName.Substring(1);
|
||||
}
|
||||
|
||||
string state = "\t<" + (_depreciated ? "game" : "machine") + " name=\"" + (!ExcludeFields[(int)Field.MachineName] ? HttpUtility.HtmlEncode(rom.MachineName) : "") + "\""
|
||||
string state = "\t<" + (_depreciated ? "game" : "machine") + " name=\"" + (!ExcludeFields[(int)Field.MachineName] ? WebUtility.HtmlEncode(rom.MachineName) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.MachineType] && (rom.MachineType & MachineType.Bios) != 0 ? " isbios=\"yes\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MachineType] && (rom.MachineType & MachineType.Device) != 0 ? " isdevice=\"yes\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MachineType] && (rom.MachineType & MachineType.Mechanical) != 0 ? " ismechanical=\"yes\"" : "")
|
||||
@@ -817,20 +817,20 @@ namespace SabreTools.Library.DatFiles
|
||||
? " runnable=\"yes\""
|
||||
: (!ExcludeFields[(int)Field.Runnable] && rom.Runnable == false ? " runnable=\"no\"" : ""))
|
||||
+ (!ExcludeFields[(int)Field.CloneOf] && !String.IsNullOrWhiteSpace(rom.CloneOf) && (rom.MachineName.ToLowerInvariant() != rom.CloneOf.ToLowerInvariant())
|
||||
? " cloneof=\"" + HttpUtility.HtmlEncode(rom.CloneOf) + "\""
|
||||
? " cloneof=\"" + WebUtility.HtmlEncode(rom.CloneOf) + "\""
|
||||
: "")
|
||||
+ (!ExcludeFields[(int)Field.RomOf] && !String.IsNullOrWhiteSpace(rom.RomOf) && (rom.MachineName.ToLowerInvariant() != rom.RomOf.ToLowerInvariant())
|
||||
? " romof=\"" + HttpUtility.HtmlEncode(rom.RomOf) + "\""
|
||||
? " romof=\"" + WebUtility.HtmlEncode(rom.RomOf) + "\""
|
||||
: "")
|
||||
+ (!ExcludeFields[(int)Field.SampleOf] && !String.IsNullOrWhiteSpace(rom.SampleOf) && (rom.MachineName.ToLowerInvariant() != rom.SampleOf.ToLowerInvariant())
|
||||
? " sampleof=\"" + HttpUtility.HtmlEncode(rom.SampleOf) + "\""
|
||||
? " sampleof=\"" + WebUtility.HtmlEncode(rom.SampleOf) + "\""
|
||||
: "")
|
||||
+ ">\n"
|
||||
+ (!ExcludeFields[(int)Field.Comment] && !String.IsNullOrWhiteSpace(rom.Comment) ? "\t\t<comment>" + HttpUtility.HtmlEncode(rom.Comment) + "</comment>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Description] ? "\t\t<description>" + HttpUtility.HtmlEncode((String.IsNullOrWhiteSpace(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) + "</description>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Year] && !String.IsNullOrWhiteSpace(rom.Year) ? "\t\t<year>" + HttpUtility.HtmlEncode(rom.Year) + "</year>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Publisher] && !String.IsNullOrWhiteSpace(rom.Publisher) ? "\t\t<publisher>" + HttpUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Manufacturer] && !String.IsNullOrWhiteSpace(rom.Manufacturer) ? "\t\t<manufacturer>" + HttpUtility.HtmlEncode(rom.Manufacturer) + "</manufacturer>\n" : "");
|
||||
+ (!ExcludeFields[(int)Field.Comment] && !String.IsNullOrWhiteSpace(rom.Comment) ? "\t\t<comment>" + WebUtility.HtmlEncode(rom.Comment) + "</comment>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Description] ? "\t\t<description>" + WebUtility.HtmlEncode((String.IsNullOrWhiteSpace(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) + "</description>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Year] && !String.IsNullOrWhiteSpace(rom.Year) ? "\t\t<year>" + WebUtility.HtmlEncode(rom.Year) + "</year>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Publisher] && !String.IsNullOrWhiteSpace(rom.Publisher) ? "\t\t<publisher>" + WebUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Manufacturer] && !String.IsNullOrWhiteSpace(rom.Manufacturer) ? "\t\t<manufacturer>" + WebUtility.HtmlEncode(rom.Manufacturer) + "</manufacturer>\n" : "");
|
||||
|
||||
sw.Write(state);
|
||||
sw.Flush();
|
||||
@@ -894,19 +894,19 @@ namespace SabreTools.Library.DatFiles
|
||||
switch (rom.ItemType)
|
||||
{
|
||||
case ItemType.Archive:
|
||||
state += "\t\t<archive name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "\t\t<archive name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.BiosSet:
|
||||
state += "\t\t<biosset name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Description] && !String.IsNullOrWhiteSpace(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||
state += "\t\t<biosset name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Description] && !String.IsNullOrWhiteSpace(((BiosSet)rom).Description) ? " description=\"" + WebUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Default] && ((BiosSet)rom).Default != null
|
||||
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
||||
: "")
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Disk:
|
||||
state += "\t\t<disk name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "\t\t<disk name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA1] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA256] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA256) ? " sha256=\"" + ((Disk)rom).SHA256.ToLowerInvariant() + "\"" : "")
|
||||
@@ -916,17 +916,17 @@ namespace SabreTools.Library.DatFiles
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Release:
|
||||
state += "\t\t<release name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Region] && !String.IsNullOrWhiteSpace(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Language] && !String.IsNullOrWhiteSpace(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Date] && !String.IsNullOrWhiteSpace(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : "")
|
||||
state += "\t\t<release name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Region] && !String.IsNullOrWhiteSpace(((Release)rom).Region) ? " region=\"" + WebUtility.HtmlEncode(((Release)rom).Region) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Language] && !String.IsNullOrWhiteSpace(((Release)rom).Language) ? " language=\"" + WebUtility.HtmlEncode(((Release)rom).Language) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Date] && !String.IsNullOrWhiteSpace(((Release)rom).Date) ? " date=\"" + WebUtility.HtmlEncode(((Release)rom).Date) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Default] && ((Release)rom).Default != null
|
||||
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
||||
: "")
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Rom:
|
||||
state += "\t\t<rom name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "\t\t<rom name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Size] && ((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.CRC] && !String.IsNullOrWhiteSpace(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
@@ -939,7 +939,7 @@ namespace SabreTools.Library.DatFiles
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Sample:
|
||||
state += "\t\t<sample name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "\t\t<sample name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ "/>\n";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
@@ -856,7 +856,7 @@ namespace SabreTools.Library.DatFiles
|
||||
string header = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
|
||||
+ "<dat xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"datas.xsd\">\n"
|
||||
+ "\t<configuration>\n"
|
||||
+ "\t\t<datName>" + HttpUtility.HtmlEncode(Name) + "</datName>\n"
|
||||
+ "\t\t<datName>" + WebUtility.HtmlEncode(Name) + "</datName>\n"
|
||||
+ "\t\t<datVersion>" + Count + "</datVersion>\n"
|
||||
+ "\t\t<system>none</system>\n"
|
||||
+ "\t\t<screenshotsWidth>240</screenshotsWidth>\n"
|
||||
@@ -880,9 +880,9 @@ namespace SabreTools.Library.DatFiles
|
||||
+ "\t\t\t<extension>.bin</extension>\n"
|
||||
+ "\t\t</canOpen>\n"
|
||||
+ "\t\t<newDat>\n"
|
||||
+ "\t\t\t<datVersionURL>" + HttpUtility.HtmlEncode(Url) + "</datVersionURL>\n"
|
||||
+ "\t\t\t<datURL fileName=\"" + HttpUtility.HtmlEncode(FileName) + ".zip\">" + HttpUtility.HtmlEncode(Url) + "</datURL>\n"
|
||||
+ "\t\t\t<imURL>" + HttpUtility.HtmlEncode(Url) + "</imURL>\n"
|
||||
+ "\t\t\t<datVersionURL>" + WebUtility.HtmlEncode(Url) + "</datVersionURL>\n"
|
||||
+ "\t\t\t<datURL fileName=\"" + WebUtility.HtmlEncode(FileName) + ".zip\">" + WebUtility.HtmlEncode(Url) + "</datURL>\n"
|
||||
+ "\t\t\t<imURL>" + WebUtility.HtmlEncode(Url) + "</imURL>\n"
|
||||
+ "\t\t</newDat>\n"
|
||||
+ "\t\t<search>\n"
|
||||
+ "\t\t\t<to value=\"location\" default=\"true\" auto=\"true\"/>\n"
|
||||
@@ -959,7 +959,7 @@ namespace SabreTools.Library.DatFiles
|
||||
state += "\t\t<game>\n"
|
||||
+ "\t\t\t<imageNumber>1</imageNumber>\n"
|
||||
+ "\t\t\t<releaseNumber>1</releaseNumber>\n"
|
||||
+ "\t\t\t<title>" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "</title>\n"
|
||||
+ "\t\t\t<title>" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "</title>\n"
|
||||
+ "\t\t\t<saveType>None</saveType>\n";
|
||||
|
||||
if (rom.ItemType == ItemType.Rom)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
@@ -661,7 +661,7 @@ Generation MSXIDs by www.generation-msx.nl
|
||||
}
|
||||
|
||||
string state = "<software>\n"
|
||||
+ "\t<title>" + (!ExcludeFields[(int)Field.MachineName] ? HttpUtility.HtmlEncode(rom.MachineName) : "") + "</title>\n"
|
||||
+ "\t<title>" + (!ExcludeFields[(int)Field.MachineName] ? WebUtility.HtmlEncode(rom.MachineName) : "") + "</title>\n"
|
||||
// + "\t<genmsxid>" + msxid + "</genmsxid>\n"
|
||||
// + "\t<system>" + system + "</system>\n"
|
||||
+ "\t<company>" + (!ExcludeFields[(int)Field.Manufacturer] ? rom.Manufacturer : "") + "</company>\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -344,21 +344,21 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
if (rom.ItemType == ItemType.Rom)
|
||||
{
|
||||
state += "¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? HttpUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? HttpUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.MachineName] ? HttpUtility.HtmlEncode(rom.MachineName) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Description] ? HttpUtility.HtmlEncode((String.IsNullOrWhiteSpace(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") +
|
||||
state += "¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? WebUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? WebUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.MachineName] ? WebUtility.HtmlEncode(rom.MachineName) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Description] ? WebUtility.HtmlEncode((String.IsNullOrWhiteSpace(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.CRC] ? ((Rom)rom).CRC.ToLowerInvariant() : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Size] && ((Rom)rom).Size != -1 ? ((Rom)rom).Size.ToString() : "") + "¬¬¬\n";
|
||||
}
|
||||
else if (rom.ItemType == ItemType.Disk)
|
||||
{
|
||||
state += "¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? HttpUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? HttpUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.MachineName] ? HttpUtility.HtmlEncode(rom.MachineName) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Description] ? HttpUtility.HtmlEncode((String.IsNullOrWhiteSpace(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") +
|
||||
state += "¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? WebUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.CloneOf] && String.IsNullOrWhiteSpace(rom.CloneOf) ? WebUtility.HtmlEncode(rom.CloneOf) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.MachineName] ? WebUtility.HtmlEncode(rom.MachineName) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Description] ? WebUtility.HtmlEncode((String.IsNullOrWhiteSpace(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) : "") +
|
||||
"¬" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") +
|
||||
"¬¬¬¬¬\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
@@ -660,17 +660,17 @@ namespace SabreTools.Library.DatFiles
|
||||
"<!DOCTYPE sabredat SYSTEM \"newdat.xsd\">\n\n" +
|
||||
"<datafile>\n" +
|
||||
"\t<header>\n" +
|
||||
"\t\t<name>" + HttpUtility.HtmlEncode(Name) + "</name>\n" +
|
||||
"\t\t<description>" + HttpUtility.HtmlEncode(Description) + "</description>\n" +
|
||||
(!String.IsNullOrWhiteSpace(RootDir) ? "\t\t<rootdir>" + HttpUtility.HtmlEncode(RootDir) + "</rootdir>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Category) ? "\t\t<category>" + HttpUtility.HtmlEncode(Category) + "</category>\n" : "") +
|
||||
"\t\t<version>" + HttpUtility.HtmlEncode(Version) + "</version>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Date) ? "\t\t<date>" + HttpUtility.HtmlEncode(Date) + "</date>\n" : "") +
|
||||
"\t\t<author>" + HttpUtility.HtmlEncode(Author) + "</author>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Comment) ? "\t\t<comment>" + HttpUtility.HtmlEncode(Comment) + "</comment>\n" : "") +
|
||||
"\t\t<name>" + WebUtility.HtmlEncode(Name) + "</name>\n" +
|
||||
"\t\t<description>" + WebUtility.HtmlEncode(Description) + "</description>\n" +
|
||||
(!String.IsNullOrWhiteSpace(RootDir) ? "\t\t<rootdir>" + WebUtility.HtmlEncode(RootDir) + "</rootdir>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Category) ? "\t\t<category>" + WebUtility.HtmlEncode(Category) + "</category>\n" : "") +
|
||||
"\t\t<version>" + WebUtility.HtmlEncode(Version) + "</version>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Date) ? "\t\t<date>" + WebUtility.HtmlEncode(Date) + "</date>\n" : "") +
|
||||
"\t\t<author>" + WebUtility.HtmlEncode(Author) + "</author>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Comment) ? "\t\t<comment>" + WebUtility.HtmlEncode(Comment) + "</comment>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Type) || ForcePacking != ForcePacking.None || ForceMerging != ForceMerging.None || ForceNodump != ForceNodump.None ?
|
||||
"\t\t<flags>\n" +
|
||||
(!String.IsNullOrWhiteSpace(Type) ? "\t\t\t<flag name=\"type\" value=\"" + HttpUtility.HtmlEncode(Type) + "\"/>\n" : "") +
|
||||
(!String.IsNullOrWhiteSpace(Type) ? "\t\t\t<flag name=\"type\" value=\"" + WebUtility.HtmlEncode(Type) + "\"/>\n" : "") +
|
||||
(ForcePacking == ForcePacking.Unzip ? "\t\t\t<flag name=\"forcepacking\" value=\"unzip\"/>\n" : "") +
|
||||
(ForcePacking == ForcePacking.Zip ? "\t\t\t<flag name=\"forcepacking\" value=\"zip\"/>\n" : "") +
|
||||
(ForceMerging == ForceMerging.Full ? "\t\t\t<flag name=\"forcemerging\" value=\"full\"/>\n" : "") +
|
||||
@@ -725,8 +725,8 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
state += "\t";
|
||||
}
|
||||
state += "<directory name=\"" + (!ExcludeFields[(int)Field.MachineName] ? HttpUtility.HtmlEncode(newsplit[i]) : "") + "\" description=\"" +
|
||||
HttpUtility.HtmlEncode(newsplit[i]) + "\">\n";
|
||||
state += "<directory name=\"" + (!ExcludeFields[(int)Field.MachineName] ? WebUtility.HtmlEncode(newsplit[i]) : "") + "\" description=\"" +
|
||||
WebUtility.HtmlEncode(newsplit[i]) + "\">\n";
|
||||
}
|
||||
depth = depth - (last == -1 ? 0 : last) + newsplit.Count;
|
||||
|
||||
@@ -833,19 +833,19 @@ namespace SabreTools.Library.DatFiles
|
||||
switch (rom.ItemType)
|
||||
{
|
||||
case ItemType.Archive:
|
||||
state += "<file type=\"archive\" name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "<file type=\"archive\" name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.BiosSet:
|
||||
state += "<file type=\"biosset\" name\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Description] && !String.IsNullOrWhiteSpace(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||
state += "<file type=\"biosset\" name\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Description] && !String.IsNullOrWhiteSpace(((BiosSet)rom).Description) ? " description=\"" + WebUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Default] && ((BiosSet)rom).Default != null
|
||||
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
||||
: "")
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Disk:
|
||||
state += "<file type=\"disk\" name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "<file type=\"disk\" name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA1] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA256] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA256) ? " sha256=\"" + ((Disk)rom).SHA256.ToLowerInvariant() + "\"" : "")
|
||||
@@ -857,17 +857,17 @@ namespace SabreTools.Library.DatFiles
|
||||
prefix + "</file>\n" : "/>\n");
|
||||
break;
|
||||
case ItemType.Release:
|
||||
state += "<file type=\"release\" name\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Region] && !String.IsNullOrWhiteSpace(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Language] && !String.IsNullOrWhiteSpace(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Date] && !String.IsNullOrWhiteSpace(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : "")
|
||||
state += "<file type=\"release\" name\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Region] && !String.IsNullOrWhiteSpace(((Release)rom).Region) ? " region=\"" + WebUtility.HtmlEncode(((Release)rom).Region) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Language] && !String.IsNullOrWhiteSpace(((Release)rom).Language) ? " language=\"" + WebUtility.HtmlEncode(((Release)rom).Language) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Date] && !String.IsNullOrWhiteSpace(((Release)rom).Date) ? " date=\"" + WebUtility.HtmlEncode(((Release)rom).Date) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Default] && ((Release)rom).Default != null
|
||||
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
||||
: "")
|
||||
+ "/>\n";
|
||||
break;
|
||||
case ItemType.Rom:
|
||||
state += "<file type=\"rom\" name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "<file type=\"rom\" name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Size] && ((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.CRC] && !String.IsNullOrWhiteSpace(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
@@ -882,7 +882,7 @@ namespace SabreTools.Library.DatFiles
|
||||
prefix + "</file>\n" : "/>\n");
|
||||
break;
|
||||
case ItemType.Sample:
|
||||
state += "<file type=\"sample\" name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
state += "<file type=\"sample\" name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ "/>\n";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
@@ -668,8 +668,8 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
string header = "<?xml version=\"1.0\"?>\n" +
|
||||
"<!DOCTYPE softwarelist SYSTEM \"softwarelist.dtd\">\n\n" +
|
||||
"<softwarelist name=\"" + HttpUtility.HtmlEncode(Name) + "\"" +
|
||||
" description=\"" + HttpUtility.HtmlEncode(Description) + "\"" +
|
||||
"<softwarelist name=\"" + WebUtility.HtmlEncode(Name) + "\"" +
|
||||
" description=\"" + WebUtility.HtmlEncode(Description) + "\"" +
|
||||
(ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : "") +
|
||||
(ForcePacking == ForcePacking.Zip ? " forcepacking=\"zip\"" : "") +
|
||||
(ForceMerging == ForceMerging.Full ? " forcemerging=\"full\"" : "") +
|
||||
@@ -710,19 +710,19 @@ namespace SabreTools.Library.DatFiles
|
||||
rom.MachineName = rom.MachineName.Substring(1);
|
||||
}
|
||||
|
||||
string state = "\t<software name=\"" + (!ExcludeFields[(int)Field.MachineName] ? HttpUtility.HtmlEncode(rom.MachineName) : "") + "\""
|
||||
string state = "\t<software name=\"" + (!ExcludeFields[(int)Field.MachineName] ? WebUtility.HtmlEncode(rom.MachineName) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.CloneOf] && !String.IsNullOrWhiteSpace(rom.CloneOf) && (rom.MachineName.ToLowerInvariant() != rom.CloneOf.ToLowerInvariant())
|
||||
? " cloneof=\"" + HttpUtility.HtmlEncode(rom.CloneOf) + "\"" : "")
|
||||
? " cloneof=\"" + WebUtility.HtmlEncode(rom.CloneOf) + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.Supported] ? " supported=\"" + (rom.Supported == true ? "yes" : rom.Supported == false ? "no" : "partial") + "\">\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Description] ? "\t\t<description>" + HttpUtility.HtmlEncode(rom.MachineDescription) + "</description>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Year] && rom.Year != null ? "\t\t<year>" + HttpUtility.HtmlEncode(rom.Year) + "</year>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Publisher] && rom.Publisher != null ? "\t\t<publisher>" + HttpUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : "");
|
||||
+ (!ExcludeFields[(int)Field.Description] ? "\t\t<description>" + WebUtility.HtmlEncode(rom.MachineDescription) + "</description>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Year] && rom.Year != null ? "\t\t<year>" + WebUtility.HtmlEncode(rom.Year) + "</year>\n" : "")
|
||||
+ (!ExcludeFields[(int)Field.Publisher] && rom.Publisher != null ? "\t\t<publisher>" + WebUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : "");
|
||||
|
||||
if (!ExcludeFields[(int)Field.Infos])
|
||||
{
|
||||
foreach (Tuple<string, string> kvp in rom.Infos)
|
||||
{
|
||||
state += "\t\t<info name=\"" + HttpUtility.HtmlEncode(kvp.Item1) + "\" value=\"" + HttpUtility.HtmlEncode(kvp.Item2) + "\" />\n";
|
||||
state += "\t\t<info name=\"" + WebUtility.HtmlEncode(kvp.Item1) + "\" value=\"" + WebUtility.HtmlEncode(kvp.Item2) + "\" />\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -792,7 +792,7 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
foreach (Tuple<string, string> kvp in rom.Features)
|
||||
{
|
||||
state += "\t\t\t<feature name=\"" + HttpUtility.HtmlEncode(kvp.Item1) + "\" value=\"" + HttpUtility.HtmlEncode(kvp.Item2) + "\"/>\n";
|
||||
state += "\t\t\t<feature name=\"" + WebUtility.HtmlEncode(kvp.Item1) + "\" value=\"" + WebUtility.HtmlEncode(kvp.Item2) + "\"/>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -801,7 +801,7 @@ namespace SabreTools.Library.DatFiles
|
||||
case ItemType.Disk:
|
||||
state += "\t\t\t<diskarea name=\"" + (!ExcludeFields[(int)Field.AreaName] ? (String.IsNullOrWhiteSpace(rom.AreaName) ? "cdrom" : rom.AreaName) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.AreaSize] && rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||
+ "\t\t\t\t<disk name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ "\t\t\t\t<disk name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA1] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.SHA256] && !String.IsNullOrWhiteSpace(((Disk)rom).SHA256) ? " sha256=\"" + ((Disk)rom).SHA256.ToLowerInvariant() + "\"" : "")
|
||||
@@ -815,7 +815,7 @@ namespace SabreTools.Library.DatFiles
|
||||
case ItemType.Rom:
|
||||
state += "\t\t\t<dataarea name=\"" + (!ExcludeFields[(int)Field.AreaName] ? (String.IsNullOrWhiteSpace(rom.AreaName) ? "rom" : rom.AreaName) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.AreaSize] && rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||
+ "\t\t\t\t<rom name=\"" + (!ExcludeFields[(int)Field.Name] ? HttpUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ "\t\t\t\t<rom name=\"" + (!ExcludeFields[(int)Field.Name] ? WebUtility.HtmlEncode(rom.Name) : "") + "\""
|
||||
+ (!ExcludeFields[(int)Field.Size] && ((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.CRC] && !String.IsNullOrWhiteSpace(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : "")
|
||||
+ (!ExcludeFields[(int)Field.MD5] && !String.IsNullOrWhiteSpace(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||
|
||||
Reference in New Issue
Block a user