mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix ParentablePath issues; fix parse logging
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user