Class OptionsBuilder

Builder for Options.

Options itself is immutable, but OptionsBuilder is chainable and mutable.

Inheritance
System.Object
OptionsBuilder
Namespace: Cesil
Assembly: Cesil.dll
Syntax
public sealed class OptionsBuilder : Object

Properties

CommentCharacter

Which character, if any, is used to indicate the start of a comment.

Typically not set, but when set often '#'.

Declaration
public Nullable<char> CommentCharacter { get; }
Property Value
Type Description
System.Nullable<System.Char>

DynamicRowDisposal

When to dispose any dynamic rows returned by an IReader or IAsyncReader.

Declaration
public DynamicRowDisposal DynamicRowDisposal { get; }
Property Value
Type Description
DynamicRowDisposal

EscapedValueEscapeCharacter

Character used to escape another character in an escaped value.

Typically a double quote, but can be null for some formats and MUST be null for formats without an EscapedValueStartAndEnd.

Declaration
public Nullable<char> EscapedValueEscapeCharacter { get; }
Property Value
Type Description
System.Nullable<System.Char>

EscapedValueStartAndEnd

Character used to start an escaped value.

Typically a double quote, but can be null for some formats.

Declaration
public Nullable<char> EscapedValueStartAndEnd { get; }
Property Value
Type Description
System.Nullable<System.Char>

ExtraColumnTreatment

How to handle extra colums encountered when reading a CSV.

Declaration
public ExtraColumnTreatment ExtraColumnTreatment { get; }
Property Value
Type Description
ExtraColumnTreatment

MemoryPoolProvider

Provider for MemoryPools needed during reading or writing CSVs.

Declaration
public IMemoryPoolProvider MemoryPoolProvider { get; }
Property Value
Type Description
IMemoryPoolProvider

ReadBufferSizeHint

How big a buffer to request from the MemoryPool for servicing read operations.

Set to 0 to use a default size.

Declaration
public int ReadBufferSizeHint { get; }
Property Value
Type Description
System.Int32

ReadHeader

Whether or not to read headers when reading a CSV.

Declaration
public ReadHeader ReadHeader { get; }
Property Value
Type Description
ReadHeader

ReadRowEnding

The sequence of characters used to end a row when reading.

Declaration
public ReadRowEnding ReadRowEnding { get; }
Property Value
Type Description
ReadRowEnding

TypeDescriber

The instance of ITypeDescriber that will be used to discover which columns to read or write, as well as the manner of their reading and writing.

Declaration
public ITypeDescriber TypeDescriber { get; }
Property Value
Type Description
ITypeDescriber

ValueSeparator

Character used to separate two values in a row

Typically a comma.

Declaration
public string ValueSeparator { get; }
Property Value
Type Description
System.String

WhitespaceTreatment

How to handle whitespace when encountered during parsing.

Declaration
public WhitespaceTreatments WhitespaceTreatment { get; }
Property Value
Type Description
WhitespaceTreatments

WriteBufferSizeHint

How big a buffer to request from the MemoryPool for buffering write operations.

Set to 0 to disable buffering.

Set to null to use a default size.

Declaration
public Nullable<int> WriteBufferSizeHint { get; }
Property Value
Type Description
System.Nullable<System.Int32>

WriteHeader

Whether or not to write headers when writing a CSV.

Declaration
public WriteHeader WriteHeader { get; }
Property Value
Type Description
WriteHeader

WriteRowEnding

The sequence of characters used to end a row when writing.

Declaration
public WriteRowEnding WriteRowEnding { get; }
Property Value
Type Description
WriteRowEnding

WriteTrailingRowEnding

Whether or not to write a row ending after the last row in a CSV.

Declaration
public WriteTrailingRowEnding WriteTrailingRowEnding { get; }
Property Value
Type Description
WriteTrailingRowEnding

Methods

CreateBuilder()

Create a new, empty, OptionsBuilder.

Declaration
public static OptionsBuilder CreateBuilder()
Returns
Type Description
OptionsBuilder

CreateBuilder(Options)

Create a new OptionsBuilder, copying defaults from the given Options.

Declaration
public static OptionsBuilder CreateBuilder(Options options)
Parameters
Type Name Description
Options options
Returns
Type Description
OptionsBuilder

ToOptions()

Create the Options object that has been configured by this builder.

Declaration
public Options ToOptions()
Returns
Type Description
Options

ToString()

Returns a representation of this OptionsBuilder object.

Only for debugging, this value is not guaranteed to be stable.

Declaration
public override string ToString()
Returns
Type Description
System.String

WithCommentCharacter(Nullable<Char>)

Set or clear the character that starts a row that is a comment.

Declaration
public OptionsBuilder WithCommentCharacter(Nullable<char> commentStart)
Parameters
Type Name Description
System.Nullable<System.Char> commentStart
Returns
Type Description
OptionsBuilder

WithDynamicRowDisposal(DynamicRowDisposal)

Set when dynamic rows returned by a reader are disposed.

The options are either when the reader is disposed (the default) or when the row is explicitly disposed.

Declaration
public OptionsBuilder WithDynamicRowDisposal(DynamicRowDisposal dynamicRowDisposal)
Parameters
Type Name Description
DynamicRowDisposal dynamicRowDisposal
Returns
Type Description
OptionsBuilder

WithEscapedValueEscapeCharacter(Nullable<Char>)

Set the character used to escape another character in an escaped value.

If this is non-null, EscapedValueStartAndEnd must also be non-null.

Declaration
public OptionsBuilder WithEscapedValueEscapeCharacter(Nullable<char> escape)
Parameters
Type Name Description
System.Nullable<System.Char> escape
Returns
Type Description
OptionsBuilder

WithEscapedValueStartAndEnd(Nullable<Char>)

Set the character used to start an escaped value.

If this is null, EscapedValueEscapeCharacter must also be null.

Declaration
public OptionsBuilder WithEscapedValueStartAndEnd(Nullable<char> escapeStart)
Parameters
Type Name Description
System.Nullable<System.Char> escapeStart
Returns
Type Description
OptionsBuilder

WithExtraColumnTreatment(ExtraColumnTreatment)

Set how to treat extra columns when parsing.

Declaration
public OptionsBuilder WithExtraColumnTreatment(ExtraColumnTreatment extraColumnTreatment)
Parameters
Type Name Description
ExtraColumnTreatment extraColumnTreatment
Returns
Type Description
OptionsBuilder

WithMemoryPoolProvider(IMemoryPoolProvider)

Set the MemoryPoolProvider used during reading and writing.

Declaration
public OptionsBuilder WithMemoryPoolProvider(IMemoryPoolProvider memoryPoolProvider)
Parameters
Type Name Description
IMemoryPoolProvider memoryPoolProvider
Returns
Type Description
OptionsBuilder

WithReadBufferSizeHint(Int32)

Set the buffer size hint for read operations.

Setting to 0 will cause a default "best guess" size to be requested from the configured MemoryPool.

All values are treated as hints, it's up to the configured MemoryPool to satisfy the request.

Declaration
public OptionsBuilder WithReadBufferSizeHint(int sizeHint)
Parameters
Type Name Description
System.Int32 sizeHint
Returns
Type Description
OptionsBuilder

WithReadHeader(ReadHeader)

Set whether or not to read headers.

Declaration
public OptionsBuilder WithReadHeader(ReadHeader readHeader)
Parameters
Type Name Description
ReadHeader readHeader
Returns
Type Description
OptionsBuilder

WithReadRowEnding(ReadRowEnding)

Set the sequence of characters that will end a row when reading.

Declaration
public OptionsBuilder WithReadRowEnding(ReadRowEnding readRowEnding)
Parameters
Type Name Description
ReadRowEnding readRowEnding
Returns
Type Description
OptionsBuilder

WithTypeDescriber(ITypeDescriber)

Set the ITypeDescriber used to discover and configure the columns that are read and written.

Declaration
public OptionsBuilder WithTypeDescriber(ITypeDescriber typeDescriber)
Parameters
Type Name Description
ITypeDescriber typeDescriber
Returns
Type Description
OptionsBuilder

WithValueSeparator(String)

Set the character used to separate two values in a row.

Declaration
public OptionsBuilder WithValueSeparator(string valueSeparator)
Parameters
Type Name Description
System.String valueSeparator
Returns
Type Description
OptionsBuilder

WithWhitespaceTreatment(WhitespaceTreatments)

Set how to treat whitespace when parsing.

Declaration
public OptionsBuilder WithWhitespaceTreatment(WhitespaceTreatments whitespaceTreatment)
Parameters
Type Name Description
WhitespaceTreatments whitespaceTreatment
Returns
Type Description
OptionsBuilder

WithWriteBufferSizeHint(Nullable<Int32>)

Set or clear the buffer size hint for write operations.

Setting it to null will cause a default "best guess" buffer to be requested from the configured MemoryPool.

Setting it to 0 will disable buffering.

All values are treated as hints, it's up to the configured MemoryPool to satisfy the request.

Declaration
public OptionsBuilder WithWriteBufferSizeHint(Nullable<int> sizeHint)
Parameters
Type Name Description
System.Nullable<System.Int32> sizeHint
Returns
Type Description
OptionsBuilder

WithWriteHeader(WriteHeader)

Set whether or not to write headers.

Declaration
public OptionsBuilder WithWriteHeader(WriteHeader writeHeader)
Parameters
Type Name Description
WriteHeader writeHeader
Returns
Type Description
OptionsBuilder

WithWriteRowEnding(WriteRowEnding)

Set the sequence of characters that will end a row when write.

Declaration
public OptionsBuilder WithWriteRowEnding(WriteRowEnding writeRowEnding)
Parameters
Type Name Description
WriteRowEnding writeRowEnding
Returns
Type Description
OptionsBuilder

WithWriteTrailingRowEnding(WriteTrailingRowEnding)

Set whether or not to end the last row with a new line.

Declaration
public OptionsBuilder WithWriteTrailingRowEnding(WriteTrailingRowEnding writeTrailingNewLine)
Parameters
Type Name Description
WriteTrailingRowEnding writeTrailingNewLine
Returns
Type Description
OptionsBuilder
In This Article
Back to top Generated by DocFX