C# Класс BExIS.IO.Transform.Input.AsciiReader

this class is used to read and validate ascii files
Наследование: DataReader
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
ValidateDatastructure ( string line, char sep ) : bool

Validate the datastructure

Приватные методы

Метод Описание
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

Описание методов

ReadFile() публичный Метод

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
Результат List

ReadFile() публичный Метод

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
Результат List

ReadFile() публичный Метод

public ReadFile ( Stream file, AsciiFileReaderInfo fri ) : List>
file Stream
fri AsciiFileReaderInfo
Результат List>

ReadValuesFromFile() публичный Метод

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
Результат List>

ValidateDatastructure() защищенный Метод

Validate the datastructure
protected ValidateDatastructure ( string line, char sep ) : bool
line string line which include the datastructure as names
sep char TextSeparator as Character
Результат bool

ValidateFile() публичный Метод

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
Результат void