Merging changes
This commit is contained in:
1 parent
c4216d2272
commit
797816be7e
437 files changed
+54228
-28
No files matched your search
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
|
||||
|
||||
namespace BCG
|
||||
{
|
||||
public class FileRowCollection : CircularRowCollection
|
||||
{
|
||||
public FileRowCollection(string dataFileName,
|
||||
string schemaFileName)
|
||||
: this(dataFileName, schemaFileName, Int32.MaxValue)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="dataFileName">file with the rows</param>
|
||||
/// <param name="schemFileName">file with schema (written as columns names in the first line and types in the 2nd</param>
|
||||
/// <param name="maxSize">if max size is mentioned then a buffer is mantained for only
|
||||
/// that number of rows, ie the last maxSize number of rows in the file
|
||||
/// </param>
|
||||
public FileRowCollection(string dataFileName,
|
||||
string schemaFileName,
|
||||
int maxSize)
|
||||
: this(new StreamReader(dataFileName),
|
||||
new StreamReader(schemaFileName),
|
||||
maxSize)
|
||||
{ }
|
||||
|
||||
public FileRowCollection(StreamReader dataReader,
|
||||
StreamReader schemaReader)
|
||||
: this(dataReader, schemaReader, Int32.MaxValue)
|
||||
{ }
|
||||
|
||||
public FileRowCollection(StreamReader dataReader,
|
||||
StreamReader schemaReader,
|
||||
int maxSize)
|
||||
: base(BlueDataUtility.createSchemaFromCSVSchemaFile(schemaReader), maxSize)
|
||||
{
|
||||
int id = 0;
|
||||
while (dataReader.Peek() > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
addRow(BlueDataUtility.createRowFromCSVFileRow(dataReader.ReadLine(), mySchema, id++));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//BlueEventLog.logEvent (e.Message, BlueEventLevel.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user