daecabcf 9b21 200d ca8b a4bfe38a28a1 - akesseler/Plexdata.CsvParser GitHub Wiki

CsvImporter(TInstance).ProcessLine Method

This method tries to process given line according to given set of parameters.

Namespace: Plexdata.CsvParser.Processors
Assembly: Plexdata.CsvParser.NET (in Plexdata.CsvParser.NET.dll) Version: 1.1.3+d5bef99aa35461ce4bafadf0bf2c2aeca18044ea

Syntax

C#

private static TInstance ProcessLine(
	string line,
	char separator,
	bool exactly,
	CultureInfo culture,
	CsvMappings mapping,
	List<ItemDescriptor> descriptors
)

Parameters

 

line
Type: System.String
The line to be processed.
separator
Type: System.Char
The separator to be used to split given line at.
exactly
Type: System.Boolean
An exception of type 'FormatException' is throw if this parameter is 'true' and converting one of the values has failed. Otherwise, each variable is set to a default value. Which default value will be used in such a failure case depends on current data type. For example, strings using as default value, 'false' is used as default for Boolean types, and the corresponding max-value is used for all other types.
culture
Type: System.Globalization.CultureInfo
The culture information to be used for data conversion.
mapping
Type: Plexdata.CsvParser.Processors.CsvMappings
The value mappings to be used for an extended data interpretation.
descriptors
Type: System.Collections.Generic.List(ItemDescriptor)
A list of data type descriptor items that help interpreting data.

Return Value

Type: TInstance
An instance of class of type TInstance.

Exceptions

 

Exception Condition
InvalidOperationException This exception is thrown for example if TInstance does not provide a default constructor.
FormatException This exception is thrown for example if 'exactly' is set to 'true' and one of the data items could not be converted.
NotSupportedException This exception is thrown as soon as a class of type TInstance wants to use an unsupported data type.

Remarks

This method processes given line by splitting it into its pieces and then by trying to convert each element into its type-safe object expression.

See Also

Reference

CsvImporter(TInstance) Class
Plexdata.CsvParser.Processors Namespace

⚠️ **GitHub.com Fallback** ⚠️