Interface Csv.IWriteBuilderBase<T, TSelf>
- Namespace
- FlameCsv
- Assembly
- FlameCsv.Core.dll
Base builder to create a CSV writing pipeline from.
public interface Csv.IWriteBuilderBase<T, TSelf> where T : unmanaged, IBinaryInteger<T> where TSelf : Csv.IWriteBuilderBase<T, TSelf>
Type Parameters
TTSelf
Properties
IOOptions
Options to configure I/O for the CSV reader, such as buffer size and memory pool.
CsvIOOptions IOOptions { get; }
Property Value
Methods
AsParallel(CsvParallelOptions)
Configures the builder to write CSV data in parallel.
Csv.IParallelWriteBuilder<T> AsParallel(CsvParallelOptions parallelOptions = default)
Parameters
parallelOptionsCsvParallelOptionsOptions to use for parallel writing. You can pass a cancellation token to implicitly convert it to CsvParallelOptions.
Returns
CreateAsyncParallelWriter(out AsyncParallelSink<T>)
Creates a sink for asynchronous parallel writing. The sink is not thread-safe.
IAsyncDisposable? CreateAsyncParallelWriter(out Csv.AsyncParallelSink<T> sink)
Parameters
sinkCsv.AsyncParallelSink<T>Action to use to write the data to the underlying destination, with a boolean indicating whether this is the final call.
Returns
- IAsyncDisposable
An optional instance that should be disposed once the writing has fully completed
CreateParallelWriter(out ParallelSink<T>)
Creates a sink for parallel writing. The sink is not thread-safe.
IDisposable? CreateParallelWriter(out Csv.ParallelSink<T> sink)
Parameters
sinkCsv.ParallelSink<T>Action to use to write the data to the underlying destination, with a boolean indicating whether this is the final call.
Returns
- IDisposable
An optional instance that should be disposed once the writing has fully completed
CreateWriter(bool)
Creates a CSV buffer writer from the builder.
ICsvBufferWriter<T> CreateWriter(bool isAsync)
Parameters
isAsyncboolHint to the builder how the data will be written, for example to configure Asynchronous. The builder is free to ignore this parameter, and has no effect on whether the returned writer supports asynchronous operations.
Returns
ToFieldWriter(CsvOptions<T>?)
Returns a writer instance that can be used to write low-level CSV structure. After use, the writer should be disposed.
[EditorBrowsable(EditorBrowsableState.Advanced)]
CsvFieldWriter<T> ToFieldWriter(CsvOptions<T>? options = null)
Parameters
optionsCsvOptions<T>Options instance. If null, Default is used
Returns
- CsvFieldWriter<T>
Writer instance
ToWriter(CsvOptions<T>?)
Returns a writer instance that can be used to write custom fields, multiple different types,
or multiple CSV documents into the same output.
After use, the writer should be disposed, or completed with Complete(Exception?) or
CompleteAsync(Exception?, CancellationToken).
CsvWriter<T> ToWriter(CsvOptions<T>? options = null)
Parameters
optionsCsvOptions<T>Options instance. If null, Default is used
Returns
- CsvWriter<T>
Writer instance
WithIOOptions(in CsvIOOptions)
Configures the builder to use the given I/O options.
TSelf WithIOOptions(in CsvIOOptions ioOptions)
Parameters
ioOptionsCsvIOOptionsOptions to configure the buffer size and other IO related options
Returns
- TSelf