MultiColumnTypeConverterT Class

Abstract base class for type converters that provides conversions between .NET data types and CSV data that is distributed across multiple columns of a CSV file.

Definition

Namespace: FolkerKinzel.CsvTools.Mappings.TypeConverters
Assembly: FolkerKinzel.CsvTools.Mappings (in FolkerKinzel.CsvTools.Mappings.dll) Version: 1.1.0+1263e8243dc2cd78095f678f813d7d9c52ea4315
C#
public abstract class MultiColumnTypeConverter<T> : ITypeConverter<T>, 
	ICloneable
Inheritance
Object    MultiColumnTypeConverterT
Implements
ITypeConverterT, ICloneable

Type Parameters

T
The data Type that the MultiColumnTypeConverterT converts.

Remarks

A ready-to-use implementation of this class can't be provided because their structure depends on the CSV file to be processed. Fortunately, writing a derived class is easy:

Constructors

MultiColumnTypeConverterT(MultiColumnTypeConverterT) Copy constructor used by derived classes to implement ICloneable.
MultiColumnTypeConverterT(CsvMappingBuilder, Boolean, T) Constructor used by derived classes.

Properties

AcceptsNull Gets a value indicating whether the converter accepts null references as input.
DataType The data type the converter converts.
DefaultValue Gets the value to return if the parser finds no data in the CSV, or if parsing fails and the Throwing property is false.
Mapping The CsvMapping to use to access those columns of the CSV file that are required for the Type conversion.
Throwing Gets a value indicating whether the converter throws a FormatException when a parsing error occurs, or if it returns DefaultValue value instead.

Methods

Clone Creates a deep copy of the MultiColumnTypeConverterT instance.
ConvertToCsv(T) Writes value to the selected fields of Record using Mapping.
ConvertToCsv(Object) Writes value to the selected fields of Record using Mapping.
DoConvertToCsv Writes a T value to several properties of Mapping.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Parse Converts the content of Mapping to T.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryParse Tries to convert the content of Mapping to T.

Thread Safety

Static members of this type are not safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.

See Also