Ensure nullified items are taken care of

This commit is contained in:
Matt Nadareski
2023-07-30 23:50:55 -04:00
parent 439129d284
commit d08cbbe6cd
10 changed files with 113 additions and 15 deletions

View File

@@ -93,8 +93,14 @@ namespace SabreTools.DatFiles.Formats
continue; continue;
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -89,8 +89,14 @@ namespace SabreTools.DatFiles.Formats
continue; continue;
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -254,8 +254,14 @@ namespace SabreTools.DatFiles.Formats
var dipswitches = new List<Models.ClrMamePro.DipSwitch>(); var dipswitches = new List<Models.ClrMamePro.DipSwitch>();
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -140,8 +140,14 @@ namespace SabreTools.DatFiles.Formats
var files = new List<Models.DosCenter.File>(); var files = new List<Models.DosCenter.File>();
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -106,8 +106,14 @@ namespace SabreTools.DatFiles.Formats
continue; continue;
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -226,8 +226,15 @@ namespace SabreTools.DatFiles.Formats
if (items == null || !items.Any()) if (items == null || !items.Any())
continue; continue;
foreach (var item in items) // Loop through and convert the items to respective lists
for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;
@@ -268,8 +275,15 @@ namespace SabreTools.DatFiles.Formats
if (items == null || !items.Any()) if (items == null || !items.Any())
continue; continue;
foreach (var item in items) // Loop through and convert the items to respective lists
for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;
@@ -326,8 +340,15 @@ namespace SabreTools.DatFiles.Formats
if (items == null || !items.Any()) if (items == null || !items.Any())
continue; continue;
foreach (var item in items) // Loop through and convert the items to respective lists
for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;
@@ -384,8 +405,15 @@ namespace SabreTools.DatFiles.Formats
if (items == null || !items.Any()) if (items == null || !items.Any())
continue; continue;
foreach (var item in items) // Loop through and convert the items to respective lists
for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;
@@ -434,8 +462,15 @@ namespace SabreTools.DatFiles.Formats
if (items == null || !items.Any()) if (items == null || !items.Any())
continue; continue;
foreach (var item in items) // Loop through and convert the items to respective lists
for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;
@@ -476,8 +511,15 @@ namespace SabreTools.DatFiles.Formats
if (items == null || !items.Any()) if (items == null || !items.Any())
continue; continue;
foreach (var item in items) // Loop through and convert the items to respective lists
for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;
@@ -518,8 +560,15 @@ namespace SabreTools.DatFiles.Formats
if (items == null || !items.Any()) if (items == null || !items.Any())
continue; continue;
foreach (var item in items) // Loop through and convert the items to respective lists
for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -120,8 +120,14 @@ namespace SabreTools.DatFiles.Formats
}; };
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -151,8 +151,14 @@ namespace SabreTools.DatFiles.Formats
continue; continue;
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -121,8 +121,14 @@ namespace SabreTools.DatFiles.Formats
continue; continue;
// Loop through and convert the items to respective lists // Loop through and convert the items to respective lists
foreach (var item in items) for (int index = 0; index < items.Count; index++)
{ {
// Get the item
var item = items[index];
// Check for a "null" item
item = ProcessNullifiedItem(item);
// Skip if we're ignoring the item // Skip if we're ignoring the item
if (ShouldIgnore(item, ignoreblanks)) if (ShouldIgnore(item, ignoreblanks))
continue; continue;

View File

@@ -45,6 +45,7 @@ namespace SabreTools.Serialization
CheckCharacters = false, CheckCharacters = false,
Encoding = Encoding.UTF8, Encoding = Encoding.UTF8,
Indent = true, Indent = true,
IndentChars = "\t",
NewLineChars = "\n", NewLineChars = "\n",
}; };
var stream = new MemoryStream(); var stream = new MemoryStream();