Class EtlPipelineFixedWidthExtensions
- Namespace
- Wolfgang.Etl.FixedWidth
- Assembly
- Wolfgang.Etl.FixedWidth.dll
Class-named fixed-width source factories and sink terminators for the fluent Wolfgang.Etl.Abstractions.EtlPipeline
chain (issue #253). Source factories hang off Wolfgang.Etl.Abstractions.EtlPipeline so a pipeline reads
EtlPipeline.Create().FixedWidthExtractor<Person>("people.txt"); sink terminators hang off
Wolfgang.Etl.Abstractions.IEtlPipeline<T> so it ends
… .FixedWidthLoader<Person>("out.txt").RunAsync().
public static class EtlPipelineFixedWidthExtensions
- Inheritance
-
EtlPipelineFixedWidthExtensions
- Inherited Members
Remarks
Path-based factories own the file stream they open and dispose it after the run (success or
failure). Factories that accept a caller-supplied Stream, TextReader,
TextWriter, or a pre-built extractor do not dispose it — the caller owns the lifecycle
and, for a writer, is responsible for flushing it. The fluent setters returned by these factories map
1:1 to the underlying FixedWidthExtractor<T> / FixedWidthLoader<T>
properties; encoding is set via the builder's Encoding method.
Methods
FixedWidthExtractor<T>(EtlPipeline, Stream)
Begins a pipeline that reads fixed-width records from stream. The caller
retains ownership of the stream; only the extractor's internal reader is disposed.
public static IFixedWidthExtractorBuilder<T> FixedWidthExtractor<T>(this EtlPipeline pipeline, Stream stream) where T : notnull, new()
Parameters
pipelineEtlPipelineThe seed returned by Wolfgang.Etl.Abstractions.EtlPipeline.Create().
streamStreamThe stream to read from.
Returns
Type Parameters
TThe record type to produce.
Exceptions
- ArgumentNullException
pipelineorstreamis null.
FixedWidthExtractor<T>(EtlPipeline, TextReader)
Begins a pipeline that reads fixed-width records from reader. The caller
retains ownership of the reader; nothing is disposed by the pipeline.
public static IFixedWidthExtractorBuilder<T> FixedWidthExtractor<T>(this EtlPipeline pipeline, TextReader reader) where T : notnull, new()
Parameters
pipelineEtlPipelineThe seed returned by Wolfgang.Etl.Abstractions.EtlPipeline.Create().
readerTextReaderThe reader to read from.
Returns
Type Parameters
TThe record type to produce.
Exceptions
- ArgumentNullException
pipelineorreaderis null.
FixedWidthExtractor<T>(EtlPipeline, string)
Begins a pipeline that reads fixed-width records from the file at path. The
opened file reader is owned by the pipeline and disposed when the run finishes.
public static IFixedWidthExtractorBuilder<T> FixedWidthExtractor<T>(this EtlPipeline pipeline, string path) where T : notnull, new()
Parameters
pipelineEtlPipelineThe seed returned by Wolfgang.Etl.Abstractions.EtlPipeline.Create().
pathstringThe path of the fixed-width file to read.
Returns
Type Parameters
TThe record type to produce.
Exceptions
- ArgumentNullException
pipelineorpathis null.
FixedWidthExtractor<T>(EtlPipeline, FixedWidthExtractor<T>)
Begins a pipeline from an already-configured FixedWidthExtractor<TRecord>. The caller retains ownership of the instance; nothing is disposed by the pipeline. The returned builder can still layer further configuration over the supplied extractor.
public static IFixedWidthExtractorBuilder<T> FixedWidthExtractor<T>(this EtlPipeline pipeline, FixedWidthExtractor<T> extractor) where T : notnull, new()
Parameters
pipelineEtlPipelineThe seed returned by Wolfgang.Etl.Abstractions.EtlPipeline.Create().
extractorFixedWidthExtractor<T>The extractor that seeds the pipeline.
Returns
Type Parameters
TThe record type to produce.
Exceptions
- ArgumentNullException
pipelineorextractoris null.
FixedWidthLoader<T>(IEtlPipeline<T>, Stream)
Terminates the pipeline by writing fixed-width records to stream. The caller
retains ownership of the stream; only the loader's internal writer is disposed.
public static IFixedWidthLoaderBuilder<T> FixedWidthLoader<T>(this IEtlPipeline<T> pipeline, Stream stream) where T : notnull
Parameters
pipelineIEtlPipeline<T>The pipeline to terminate.
streamStreamThe stream to write to.
Returns
- IFixedWidthLoaderBuilder<T>
A fluent IFixedWidthLoaderBuilder<T>.
Type Parameters
TThe record type to write.
Exceptions
- ArgumentNullException
pipelineorstreamis null.
FixedWidthLoader<T>(IEtlPipeline<T>, TextWriter)
Terminates the pipeline by writing fixed-width records to writer. The caller
retains ownership of the writer and is responsible for flushing it; nothing is disposed by the
pipeline.
public static IFixedWidthLoaderBuilder<T> FixedWidthLoader<T>(this IEtlPipeline<T> pipeline, TextWriter writer) where T : notnull
Parameters
pipelineIEtlPipeline<T>The pipeline to terminate.
writerTextWriterThe writer to write to.
Returns
- IFixedWidthLoaderBuilder<T>
A fluent IFixedWidthLoaderBuilder<T>.
Type Parameters
TThe record type to write.
Exceptions
- ArgumentNullException
pipelineorwriteris null.
FixedWidthLoader<T>(IEtlPipeline<T>, string)
Terminates the pipeline by writing fixed-width records to the file at path.
The opened file writer is owned by the pipeline and disposed after the run, flushing to disk.
public static IFixedWidthLoaderBuilder<T> FixedWidthLoader<T>(this IEtlPipeline<T> pipeline, string path) where T : notnull
Parameters
pipelineIEtlPipeline<T>The pipeline to terminate.
pathstringThe path of the fixed-width file to write. An existing file is overwritten.
Returns
- IFixedWidthLoaderBuilder<T>
A fluent IFixedWidthLoaderBuilder<T>.
Type Parameters
TThe record type to write.
Exceptions
- ArgumentNullException
pipelineorpathis null.