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

this class is used to read and validate ascii files
Inheritance: DataReader
Afficher le fichier Open project: BEXIS2/Core Class Usage Examples

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
ValidateDatastructure ( string line, char sep ) : bool

Validate the datastructure

Private Methods

Méthode 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 méthode

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
Résultat List

ReadFile() public méthode

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
Résultat List

ReadFile() public méthode

public ReadFile ( Stream file, AsciiFileReaderInfo fri ) : List>
file Stream
fri AsciiFileReaderInfo
Résultat List>

ReadValuesFromFile() public méthode

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
Résultat List>

ValidateDatastructure() protected méthode

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

ValidateFile() public méthode

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
Résultat void