Class CsvWriter<T>
- Namespace
- FlameCsv
- Assembly
- FlameCsv.Core.dll
Instance that provides convenience methods around CsvFieldWriter<T>.
public class CsvWriter<T> : CsvAsyncWriter<T>, IAsyncDisposable, IDisposable where T : unmanaged, IBinaryInteger<T>
Type Parameters
T
Token type
- Inheritance
-
CsvWriter<T>
- Implements
- Inherited Members
Constructors
CsvWriter(CsvFieldWriter<T>, bool)
Initializes a new writer instance.
public CsvWriter(CsvFieldWriter<T> inner, bool autoFlush)
Parameters
inner
CsvFieldWriter<T>autoFlush
bool
Methods
Complete(Exception?)
Completes the writer, flushing any remaining data if exception
is null.
Multiple completions are no-ops.
public void Complete(Exception? exception = null)
Parameters
exception
ExceptionObserved exception when writing the data. If not null, the final buffer is not flushed and the exception is rethrown.
Flush()
Flushes the writer.
public void Flush()
Exceptions
- ObjectDisposedException
Thrown if the writer has completed (see Complete(Exception?)).
NextRecord()
Writes a newline and flushes the buffer if needed when AutoFlush is true.
public void NextRecord()
Exceptions
- ObjectDisposedException
The writer has completed