[DatFile, FileTools] Move GetXmlTextReader to a better location

This commit is contained in:
Matt Nadareski
2016-09-22 17:14:23 -07:00
parent 27cd7e89da
commit ae9bfb9cd3
4 changed files with 28 additions and 27 deletions

View File

@@ -519,30 +519,6 @@ namespace SabreTools.Helper
}
}
/// <summary>
/// Get the XmlTextReader associated with a file, if possible
/// </summary>
/// <param name="filename">Name of the file to be parsed</param>
/// <param name="logger">Logger object for console and file output</param>
/// <returns>The XmlTextReader representing the (possibly converted) file, null otherwise</returns>
public static XmlTextReader GetXmlTextReader(string filename, Logger logger)
{
logger.Log("Attempting to read file: \"" + filename + "\"");
// Check if file exists
if (!File.Exists(filename))
{
logger.Warning("File '" + filename + "' could not read from!");
return null;
}
XmlTextReader xtr;
xtr = new XmlTextReader(filename);
xtr.WhitespaceHandling = WhitespaceHandling.None;
xtr.DtdProcessing = DtdProcessing.Ignore;
return xtr;
}
/// <summary>
/// Parse a DAT and return all found games and roms within
/// </summary>
@@ -1509,7 +1485,7 @@ namespace SabreTools.Helper
ItemStatus its = ItemStatus.None;
List<string> parent = new List<string>();
XmlTextReader xtr = GetXmlTextReader(filename, logger);
XmlTextReader xtr = FileTools.GetXmlTextReader(filename, logger);
if (xtr != null)
{
xtr.MoveToContent();