mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Extract out IO namespace, Part 3
This commit is contained in:
@@ -3,10 +3,10 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
|
||||
using SabreTools.IO;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.DatFiles
|
||||
@@ -34,7 +34,15 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <param name="throwOnError">True if the error that is thrown should be thrown back to the caller, false otherwise</param>
|
||||
protected override void ParseFile(string filename, int indexId, bool keep, bool throwOnError = false)
|
||||
{
|
||||
XmlReader xtr = filename.GetXmlTextReader();
|
||||
XmlReader xtr = XmlReader.Create(filename, new XmlReaderSettings
|
||||
{
|
||||
CheckCharacters = false,
|
||||
DtdProcessing = DtdProcessing.Ignore,
|
||||
IgnoreComments = true,
|
||||
IgnoreWhitespace = true,
|
||||
ValidationFlags = XmlSchemaValidationFlags.None,
|
||||
ValidationType = ValidationType.None,
|
||||
});
|
||||
|
||||
// If we got a null reader, just return
|
||||
if (xtr == null)
|
||||
@@ -677,7 +685,7 @@ namespace SabreTools.Library.DatFiles
|
||||
try
|
||||
{
|
||||
logger.User($"Opening file for writing: {outfile}");
|
||||
FileStream fs = FileExtensions.TryCreate(outfile);
|
||||
FileStream fs = File.Create(outfile);
|
||||
|
||||
// If we get back null for some reason, just log and return
|
||||
if (fs == null)
|
||||
|
||||
Reference in New Issue
Block a user