Skip to content

Commit

Permalink
Add ReadNext(), extract ReadHeaders()
Browse files Browse the repository at this point in the history
  • Loading branch information
Bokonon79 committed Jan 21, 2019
1 parent e1cb5a3 commit ae7a4fd
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions CANLib/DataWithColumns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,12 @@ public void Read(StreamReader streamReader, Action<List<string>> callback, uint
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
try
{
ReadCustomHeader(streamReader);

if (HeaderRow)
{
ReadColumnHeader(streamReader);
}
ReadHeaders(streamReader);

uint dataPointCount = 0;
while ((dataPointLimit == 0) || (dataPointCount < dataPointLimit))
{
List<string> row = ReadDataRow(streamReader);
List<string> row = ReadNext(streamReader);
if (row == null)
{
break;
Expand All @@ -219,6 +214,21 @@ public void Read(StreamReader streamReader, Action<List<string>> callback, uint
}
}

public void ReadHeaders(StreamReader streamReader)
{
ReadCustomHeader(streamReader);

if (HeaderRow)
{
ReadColumnHeader(streamReader);
}
}

public List<string> ReadNext(StreamReader streamReader)
{
return ReadDataRow(streamReader);
}

protected void ReadBlankLine(StreamReader streamReader)
{
ReadFixedString(streamReader, "");
Expand Down

0 comments on commit ae7a4fd

Please sign in to comment.