Fix ParentablePath issues; fix parse logging

This commit is contained in:
Matt Nadareski
2020-09-21 13:04:11 -07:00
parent 07066c2299
commit a04a3485ef
20 changed files with 517 additions and 388 deletions

View File

@@ -16,6 +16,16 @@ namespace SabreTools.Library.IO
/// </summary>
private StreamReader sr;
/// <summary>
/// Contents of the current line, unprocessed
/// </summary>
public string CurrentLine { get; private set; } = string.Empty;
/// <summary>
/// Get the current line number
/// </summary>
public long LineNumber { get; private set; } = 0;
/// <summary>
/// Get if at end of stream
/// </summary>
@@ -74,7 +84,6 @@ namespace SabreTools.Library.IO
public ClrMameProReader(string filename)
{
sr = new StreamReader(filename);
DosCenter = true;
}
/// <summary>
@@ -83,7 +92,6 @@ namespace SabreTools.Library.IO
public ClrMameProReader(Stream stream, Encoding encoding)
{
sr = new StreamReader(stream, encoding);
DosCenter = true;
}
/// <summary>
@@ -94,8 +102,11 @@ namespace SabreTools.Library.IO
if (!(sr.BaseStream?.CanRead ?? false) || sr.EndOfStream)
return false;
string line = sr.ReadLine().Trim();
ProcessLine(line);
CurrentLine = sr.ReadLine().Trim();
LineNumber++;
// TODO: Act like IniReader here
ProcessLine(CurrentLine);
return true;
}