Files
LeafWeb/Core/Charter/CurveDataList.cs
T
2015-12-04 10:15:51 -05:00

42 lines
872 B
C#

using System.Collections.Generic;
using System.IO;
namespace LeafWeb.Core.Charter
{
public class CurveDataList
{
// Each element will be a PiscalCurve element that contains
// all of the output data for one curve.
public List<CurveData> CurveData { get; }
public CurveDataList()
{
CurveData = new List<CurveData>();
}
public bool ReadFromStream(StreamReader sr)
{
// Skip the first two lines.
sr.ReadLine();
sr.ReadLine();
var lineNbr = 2;
// Now, there should be one or more rows, delimited by a row that has
// CO2i in the first field. Read in all of these rows. The first field
// in each row is the curve ID (input filename).
var more = true;
while (more)
{
var curve = new CurveData(sr, ref lineNbr);
CurveData.Add(curve);
if (sr.EndOfStream)
more = false;
}
return true;
}
}
}