C# Class BExIS.IO.Transform.Input.AsciiReader

this class is used to read and validate ascii files
Inheritance: DataReader
ファイルを表示 Open project: BEXIS2/Core Class Usage Examples

Public Methods

Method Description
ReadFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId ) : List

Read the whole FileStream line by line until no more come. Convert the lines into a datatuple based on the datastructure. Return value is a list of datatuples

ReadFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId, int packageSize ) : List

Read line by line based on a packageSize. Convert the lines into a datatuple based on the datastructure. Return value is a list of datatuples

ReadFile ( Stream file, AsciiFileReaderInfo fri ) : List>
ReadValuesFromFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId, List variableList, int packageSize ) : List>

Get all values from the FileStream of each variable in variable list

ValidateFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId ) : void

Validate the whole FileStream line by line until no more come. Convert the lines into a datatuple based on the datastructure. Return value is a list of datatuples

A list of errorMessages is filled when the fil is not valid

Protected Methods

Method Description
ValidateDatastructure ( string line, char sep ) : bool

Validate the datastructure

Private Methods

Method Description
convertAndAddToSubmitedVariableIdentifier ( ) : void

Convert a list of variable names to VariableIdentifiers

rowToList ( string line, char seperator ) : List

Convert a row as a string to a list of strings

textMarkerHandling ( string row, char separator, char textmarker ) : List

If a seperator is present in a text which is highlighted with highlighter (bsp quotes), which is a special case which is treated in this function

Method Details

ReadFile() public method

Read the whole FileStream line by line until no more come. Convert the lines into a datatuple based on the datastructure. Return value is a list of datatuples
public ReadFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId ) : List
file Stream
fileName string name of the FileStream
fri AsciiFileReaderInfo AsciiFileReaderInfo needed
sds BExIS.Dlm.Entities.DataStructure.StructuredDataStructure StructuredDataStructure
datasetId long Id of the dataset
return List

ReadFile() public method

Read line by line based on a packageSize. Convert the lines into a datatuple based on the datastructure. Return value is a list of datatuples
public ReadFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId, int packageSize ) : List
file Stream
fileName string name of the FileStream
fri AsciiFileReaderInfo AsciiFileReaderInfo needed
sds BExIS.Dlm.Entities.DataStructure.StructuredDataStructure StructuredDataStructure
datasetId long Id of the dataset
packageSize int
return List

ReadFile() public method

public ReadFile ( Stream file, AsciiFileReaderInfo fri ) : List>
file Stream
fri AsciiFileReaderInfo
return List>

ReadValuesFromFile() public method

Get all values from the FileStream of each variable in variable list
public ReadValuesFromFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId, List variableList, int packageSize ) : List>
file Stream
fileName string name of the FileStream
fri AsciiFileReaderInfo AsciiFileReaderInfo needed
sds BExIS.Dlm.Entities.DataStructure.StructuredDataStructure StructuredDataStructure
datasetId long Id of the dataset
variableList List List of variables
packageSize int size of a package
return List>

ValidateDatastructure() protected method

Validate the datastructure
protected ValidateDatastructure ( string line, char sep ) : bool
line string line which include the datastructure as names
sep char TextSeparator as Character
return bool

ValidateFile() public method

Validate the whole FileStream line by line until no more come. Convert the lines into a datatuple based on the datastructure. Return value is a list of datatuples
A list of errorMessages is filled when the fil is not valid
public ValidateFile ( Stream file, string fileName, AsciiFileReaderInfo fri, StructuredDataStructure sds, long datasetId ) : void
file Stream
fileName string name of the FileStream
fri AsciiFileReaderInfo AsciiFileReaderInfo needed
sds BExIS.Dlm.Entities.DataStructure.StructuredDataStructure StructuredDataStructure
datasetId long Id of the dataset
return void