Table of Contents

Struct CsvOptions<T>.AotSafeConverters

Namespace
FlameCsv
Assembly
FlameCsv.Core.dll

Wrapper around Converters to provide AOT-safe access to converters.

[EditorBrowsable(EditorBrowsableState.Never)]
public readonly struct CsvOptions<T>.AotSafeConverters

Methods

GetConverter<TResult>()

Returns a converter for TResult.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TResult> GetConverter<TResult>()

Returns

CsvConverter<T, TResult>

Type Parameters

TResult

Type to convert

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.
CsvConverterFactory<T> added to Converters are not supported.

Exceptions

CsvConverterMissingException

GetOrCreateEnum<TEnum>()

Creates a converter for an enum type.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TEnum> GetOrCreateEnum<TEnum>() where TEnum : struct, Enum

Returns

CsvConverter<T, TEnum>

Type Parameters

TEnum

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.

GetOrCreateNullable<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>>, Guid)

Returns a nullable converter, falling back to the built-in one if UseDefaultConverters is true.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TValue?> GetOrCreateNullable<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>> factory, Guid identifier = default) where TValue : struct

Parameters

factory Func<CsvOptions<T>, CsvConverter<T, TValue>>

Factory to create the inner converter

identifier Guid

Unique identifier for the target member or constructor parameter. If none is specified, the converter is global and the value should be Guid.Empty.

Returns

CsvConverter<T, TValue?>

Type Parameters

TValue

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.

GetOrCreateOverridden<TValue, TConverter>(Func<CsvOptions<T>, TConverter>, Guid)

Returns a converter for TValue, either a configured one or from the factory.

[EditorBrowsable(EditorBrowsableState.Never)]
public TConverter GetOrCreateOverridden<TValue, TConverter>(Func<CsvOptions<T>, TConverter> factory, Guid identifier) where TConverter : CsvConverter<T, TValue>

Parameters

factory Func<CsvOptions<T>, TConverter>

Factory to create the converter

identifier Guid

Unique identifier for the target member or constructor parameter.

Returns

TConverter

Type Parameters

TValue
TConverter

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.

GetOrCreate<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>>)

Returns a converter for TValue, either a configured one or from the factory.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TValue> GetOrCreate<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>> factory)

Parameters

factory Func<CsvOptions<T>, CsvConverter<T, TValue>>

Factory to create the converter

Returns

CsvConverter<T, TValue>

Type Parameters

TValue

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.