Class CsvBooleanValuesAttribute
- Namespace
- FlameCsv.Attributes
- Assembly
- FlameCsv.Core.dll
Overrides the converter for bool and bool?.
For nullable booleans, attempts to fetch user defined null token from the options via
NullTokens.
public sealed class CsvBooleanValuesAttribute : CsvConverterAttribute
- Inheritance
-
objectCsvBooleanValuesAttribute
- Inherited Members
Properties
FalseValues
Values that represent false. Must not be empty.
public string[] FalseValues { get; set; }
Property Value
- string[]
IgnoreCase
Whether to ignore case when parsing. The default is true.
public bool IgnoreCase { get; set; }
Property Value
TrueValues
Values that represent true. Must not be empty.
public string[] TrueValues { get; set; }
Property Value
- string[]
Methods
TryCreateConverterOrFactory<T>(Type, CsvOptions<T>, out CsvConverter<T>?)
Attempts to create a converter for the target member or parameter.
If the configured converter is not for token type T, this method should return false.
If the converter is not for the target type, this method should throw a CsvConfigurationException.
protected override bool TryCreateConverterOrFactory<T>(Type targetType, CsvOptions<T> options, out CsvConverter<T>? converter) where T : unmanaged, IBinaryInteger<T>
Parameters
targetTypeTypeType to convert
optionsCsvOptions<T>Current configuration instance
converterCsvConverter<T>
Returns
- bool
Converter instance
Type Parameters
T
Exceptions
- CsvConfigurationException
Thrown if
targetTypeis not valid for the member, or is not present in the configuration and has no parameterless constructor.